| OLD | NEW |
| 1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. |
| 2 // Use of this source code is governed by a BSD-style license that can be | 2 // Use of this source code is governed by a BSD-style license that can be |
| 3 // found in the LICENSE file. | 3 // found in the LICENSE file. |
| 4 | 4 |
| 5 #import "chrome/browser/ui/cocoa/browser_window_controller_private.h" | 5 #import "chrome/browser/ui/cocoa/browser_window_controller_private.h" |
| 6 | 6 |
| 7 #include <cmath> | 7 #include <cmath> |
| 8 | 8 |
| 9 #import "base/auto_reset.h" | 9 #import "base/auto_reset.h" |
| 10 #include "base/command_line.h" | 10 #include "base/command_line.h" |
| (...skipping 686 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 697 | 697 |
| 698 enteringAppKitFullscreen_ = YES; | 698 enteringAppKitFullscreen_ = YES; |
| 699 enteringAppKitFullscreenOnPrimaryScreen_ = | 699 enteringAppKitFullscreenOnPrimaryScreen_ = |
| 700 [[[self window] screen] isEqual:[[NSScreen screens] firstObject]]; | 700 [[[self window] screen] isEqual:[[NSScreen screens] firstObject]]; |
| 701 | 701 |
| 702 [self setSheetHiddenForFullscreenTransition:YES]; | 702 [self setSheetHiddenForFullscreenTransition:YES]; |
| 703 [self adjustUIForEnteringFullscreen]; | 703 [self adjustUIForEnteringFullscreen]; |
| 704 } | 704 } |
| 705 | 705 |
| 706 - (void)windowDidEnterFullScreen:(NSNotification*)notification { | 706 - (void)windowDidEnterFullScreen:(NSNotification*)notification { |
| 707 [tabStripController_ setVisualEffectsDisabledForFullscreen:YES]; |
| 708 |
| 707 // In Yosemite, some combination of the titlebar and toolbar always show in | 709 // In Yosemite, some combination of the titlebar and toolbar always show in |
| 708 // full-screen mode. We do not want either to show. Search for the window that | 710 // full-screen mode. We do not want either to show. Search for the window that |
| 709 // contains the views, and hide it. There is no need to ever unhide the view. | 711 // contains the views, and hide it. There is no need to ever unhide the view. |
| 710 // http://crbug.com/380235 | 712 // http://crbug.com/380235 |
| 711 if (base::mac::IsOSYosemiteOrLater()) { | 713 if (base::mac::IsOSYosemiteOrLater()) { |
| 712 for (NSWindow* window in [[NSApplication sharedApplication] windows]) { | 714 for (NSWindow* window in [[NSApplication sharedApplication] windows]) { |
| 713 if ([window | 715 if ([window |
| 714 isKindOfClass:NSClassFromString(@"NSToolbarFullScreenWindow")]) { | 716 isKindOfClass:NSClassFromString(@"NSToolbarFullScreenWindow")]) { |
| 715 // Hide the toolbar if it is for a FramedBrowserWindow. | 717 // Hide the toolbar if it is for a FramedBrowserWindow. |
| 716 if ([window respondsToSelector:@selector(_windowForToolbar)]) { | 718 if ([window respondsToSelector:@selector(_windowForToolbar)]) { |
| (...skipping 41 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 758 | 760 |
| 759 [self resetCustomAppKitFullscreenVariables]; | 761 [self resetCustomAppKitFullscreenVariables]; |
| 760 [[tabStripController_ activeTabContentsController] | 762 [[tabStripController_ activeTabContentsController] |
| 761 updateFullscreenWidgetFrame]; | 763 updateFullscreenWidgetFrame]; |
| 762 | 764 |
| 763 [self showFullscreenExitBubbleIfNecessary]; | 765 [self showFullscreenExitBubbleIfNecessary]; |
| 764 browser_->WindowFullscreenStateChanged(); | 766 browser_->WindowFullscreenStateChanged(); |
| 765 } | 767 } |
| 766 | 768 |
| 767 - (void)windowWillExitFullScreen:(NSNotification*)notification { | 769 - (void)windowWillExitFullScreen:(NSNotification*)notification { |
| 770 [tabStripController_ setVisualEffectsDisabledForFullscreen:NO]; |
| 771 |
| 768 if (notification) // For System Fullscreen when non-nil. | 772 if (notification) // For System Fullscreen when non-nil. |
| 769 [self registerForContentViewResizeNotifications]; | 773 [self registerForContentViewResizeNotifications]; |
| 770 exitingAppKitFullscreen_ = YES; | 774 exitingAppKitFullscreen_ = YES; |
| 771 | 775 |
| 772 // Like windowWillEnterFullScreen, if we use custom animations, | 776 // Like windowWillEnterFullScreen, if we use custom animations, |
| 773 // adjustUIForExitingFullscreen should be called after the layout resizes in | 777 // adjustUIForExitingFullscreen should be called after the layout resizes in |
| 774 // startCustomAnimationToExitFullScreenWithDuration. | 778 // startCustomAnimationToExitFullScreenWithDuration. |
| 775 if (isUsingCustomAnimation_) { | 779 if (isUsingCustomAnimation_) { |
| 776 blockLayoutSubviews_ = YES; | 780 blockLayoutSubviews_ = YES; |
| 777 [self.chromeContentView setAutoresizesSubviews:NO]; | 781 [self.chromeContentView setAutoresizesSubviews:NO]; |
| (...skipping 464 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1242 } | 1246 } |
| 1243 | 1247 |
| 1244 - (BOOL)isFullscreenForTabContentOrExtension { | 1248 - (BOOL)isFullscreenForTabContentOrExtension { |
| 1245 FullscreenController* controller = | 1249 FullscreenController* controller = |
| 1246 browser_->exclusive_access_manager()->fullscreen_controller(); | 1250 browser_->exclusive_access_manager()->fullscreen_controller(); |
| 1247 return controller->IsWindowFullscreenForTabOrPending() || | 1251 return controller->IsWindowFullscreenForTabOrPending() || |
| 1248 controller->IsExtensionFullscreenOrPending(); | 1252 controller->IsExtensionFullscreenOrPending(); |
| 1249 } | 1253 } |
| 1250 | 1254 |
| 1251 @end // @implementation BrowserWindowController(Private) | 1255 @end // @implementation BrowserWindowController(Private) |
| OLD | NEW |