Skip to content

Commit

Permalink
Disabled custom fullscreen animation for entering tab fullscreen since
Browse files Browse the repository at this point in the history
currently it breaks Flash content. Added a fix so that the flash content is
ensured to take up the entire fullscreen window when it enters fullscreen.

BUG=566588

Review URL: https://codereview.chromium.org/1526533005

Cr-Commit-Position: refs/heads/master@{#365293}
  • Loading branch information
spqchan authored and Commit bot committed Dec 15, 2015
1 parent a6605db commit b97a851
Show file tree
Hide file tree
Showing 2 changed files with 27 additions and 8 deletions.
3 changes: 3 additions & 0 deletions chrome/browser/ui/cocoa/browser_window_controller_private.h
Expand Up @@ -191,6 +191,9 @@ class WebContents;
// it when we are entering fullscreen.
- (void)adjustUIForEnteringFullscreen;

// Returns YES if the fullscreen is for tab content.
- (BOOL)isFullscreenForTabContent;

#endif

@end // @interface BrowserWindowController(Private)
Expand Down
32 changes: 24 additions & 8 deletions chrome/browser/ui/cocoa/browser_window_controller_private.mm
Expand Up @@ -455,13 +455,11 @@ - (void)permissionBubbleWindowWillClose:(NSNotification*)notification {
}

- (void)configurePresentationModeController {
BOOL fullscreen_for_tab = browser_->exclusive_access_manager()
->fullscreen_controller()
->IsWindowFullscreenForTabOrPending();
BOOL kiosk_mode =
BOOL fullscreenForTab = [self isFullscreenForTabContent];
BOOL kioskMode =
base::CommandLine::ForCurrentProcess()->HasSwitch(switches::kKioskMode);
BOOL showDropdown =
!fullscreen_for_tab && !kiosk_mode && ([self floatingBarHasFocus]);
!fullscreenForTab && !kioskMode && ([self floatingBarHasFocus]);

PermissionBubbleManager* manager = [self permissionBubbleManager];
if (manager && manager->IsBubbleVisible()) {
Expand Down Expand Up @@ -717,6 +715,13 @@ - (void)windowDidEnterFullScreen:(NSNotification*)notification {
blockLayoutSubviews_ = NO;
fullscreenTransition_.reset();

if ([self isFullscreenForTabContent]) {
NSRect windowFrame = [self window].frame;
NSRect contentViewFrame =
NSMakeRect(0, 0, windowFrame.size.width, windowFrame.size.height);
[self.chromeContentView setFrame:contentViewFrame];
}

// In Yosemite, some combination of the titlebar and toolbar always show in
// full-screen mode. We do not want either to show. Search for the window that
// contains the views, and hide it. There is no need to ever unhide the view.
Expand Down Expand Up @@ -857,9 +862,7 @@ - (void)adjustUIForExitingFullscreen {

- (void)adjustUIForEnteringFullscreen {
fullscreen_mac::SlidingStyle style;
if (browser_->exclusive_access_manager()
->fullscreen_controller()
->IsWindowFullscreenForTabOrPending()) {
if ([self isFullscreenForTabContent]) {
style = fullscreen_mac::OMNIBOX_TABS_NONE;
} else if (enteringPresentationMode_ || [self shouldHideFullscreenToolbar]) {
style = fullscreen_mac::OMNIBOX_TABS_HIDDEN;
Expand Down Expand Up @@ -1169,6 +1172,13 @@ - (BOOL)shouldUseCustomAppKitFullscreenTransition:(BOOL)enterFullScreen {
if (base::mac::IsOSMavericks() && !enterFullScreen)
return NO;

// Temporary disable custom enter animation since it currently breaks the
// fullscreen Flash content.
// TODO(spqchan): Fix the custom animation to enter fullscreen so that it
// will work with Flash content.
if (enterFullScreen && [self isFullscreenForTabContent])
return NO;

NSView* root = [[self.window contentView] superview];
if (!root.layer)
return NO;
Expand Down Expand Up @@ -1257,4 +1267,10 @@ - (PermissionBubbleManager*)permissionBubbleManager {
return nil;
}

- (BOOL)isFullscreenForTabContent {
return browser_->exclusive_access_manager()
->fullscreen_controller()
->IsWindowFullscreenForTabOrPending();
}

@end // @implementation BrowserWindowController(Private)

0 comments on commit b97a851

Please sign in to comment.