| 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 687 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 698 | 698 |
| 699 enteringAppKitFullscreen_ = YES; | 699 enteringAppKitFullscreen_ = YES; |
| 700 enteringAppKitFullscreenOnPrimaryScreen_ = | 700 enteringAppKitFullscreenOnPrimaryScreen_ = |
| 701 [[[self window] screen] isEqual:[[NSScreen screens] firstObject]]; | 701 [[[self window] screen] isEqual:[[NSScreen screens] firstObject]]; |
| 702 | 702 |
| 703 [self setSheetHiddenForFullscreenTransition:YES]; | 703 [self setSheetHiddenForFullscreenTransition:YES]; |
| 704 [self adjustUIForEnteringFullscreen]; | 704 [self adjustUIForEnteringFullscreen]; |
| 705 } | 705 } |
| 706 | 706 |
| 707 - (void)windowDidEnterFullScreen:(NSNotification*)notification { | 707 - (void)windowDidEnterFullScreen:(NSNotification*)notification { |
| 708 [tabStripController_ setVisualEffectsDisabledForFullscreen:YES]; |
| 709 |
| 708 // In Yosemite, some combination of the titlebar and toolbar always show in | 710 // In Yosemite, some combination of the titlebar and toolbar always show in |
| 709 // full-screen mode. We do not want either to show. Search for the window that | 711 // full-screen mode. We do not want either to show. Search for the window that |
| 710 // contains the views, and hide it. There is no need to ever unhide the view. | 712 // contains the views, and hide it. There is no need to ever unhide the view. |
| 711 // http://crbug.com/380235 | 713 // http://crbug.com/380235 |
| 712 if (base::mac::IsOSYosemiteOrLater()) { | 714 if (base::mac::IsOSYosemiteOrLater()) { |
| 713 for (NSWindow* window in [[NSApplication sharedApplication] windows]) { | 715 for (NSWindow* window in [[NSApplication sharedApplication] windows]) { |
| 714 if ([window | 716 if ([window |
| 715 isKindOfClass:NSClassFromString(@"NSToolbarFullScreenWindow")]) { | 717 isKindOfClass:NSClassFromString(@"NSToolbarFullScreenWindow")]) { |
| 716 // Hide the toolbar if it is for a FramedBrowserWindow. | 718 // Hide the toolbar if it is for a FramedBrowserWindow. |
| 717 if ([window respondsToSelector:@selector(_windowForToolbar)]) { | 719 if ([window respondsToSelector:@selector(_windowForToolbar)]) { |
| (...skipping 47 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 765 if (fullscreenLowPowerCoordinator_) | 767 if (fullscreenLowPowerCoordinator_) |
| 766 fullscreenLowPowerCoordinator_->SetInFullscreenTransition(false); | 768 fullscreenLowPowerCoordinator_->SetInFullscreenTransition(false); |
| 767 | 769 |
| 768 if (shouldExitAfterEnteringFullscreen_) { | 770 if (shouldExitAfterEnteringFullscreen_) { |
| 769 shouldExitAfterEnteringFullscreen_ = NO; | 771 shouldExitAfterEnteringFullscreen_ = NO; |
| 770 [self exitAppKitFullscreen]; | 772 [self exitAppKitFullscreen]; |
| 771 } | 773 } |
| 772 } | 774 } |
| 773 | 775 |
| 774 - (void)windowWillExitFullScreen:(NSNotification*)notification { | 776 - (void)windowWillExitFullScreen:(NSNotification*)notification { |
| 777 [tabStripController_ setVisualEffectsDisabledForFullscreen:NO]; |
| 778 |
| 775 if (fullscreenLowPowerCoordinator_) | 779 if (fullscreenLowPowerCoordinator_) |
| 776 fullscreenLowPowerCoordinator_->SetInFullscreenTransition(true); | 780 fullscreenLowPowerCoordinator_->SetInFullscreenTransition(true); |
| 777 | 781 |
| 778 if (notification) // For System Fullscreen when non-nil. | 782 if (notification) // For System Fullscreen when non-nil. |
| 779 [self registerForContentViewResizeNotifications]; | 783 [self registerForContentViewResizeNotifications]; |
| 780 exitingAppKitFullscreen_ = YES; | 784 exitingAppKitFullscreen_ = YES; |
| 781 | 785 |
| 782 // Like windowWillEnterFullScreen, if we use custom animations, | 786 // Like windowWillEnterFullScreen, if we use custom animations, |
| 783 // adjustUIForExitingFullscreen should be called after the layout resizes in | 787 // adjustUIForExitingFullscreen should be called after the layout resizes in |
| 784 // startCustomAnimationToExitFullScreenWithDuration. | 788 // startCustomAnimationToExitFullScreenWithDuration. |
| (...skipping 518 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1303 if (fullscreenLowPowerCoordinator_) | 1307 if (fullscreenLowPowerCoordinator_) |
| 1304 fullscreenLowPowerCoordinator_->SetHasActiveSheet(false); | 1308 fullscreenLowPowerCoordinator_->SetHasActiveSheet(false); |
| 1305 } | 1309 } |
| 1306 | 1310 |
| 1307 - (void)childWindowsDidChange { | 1311 - (void)childWindowsDidChange { |
| 1308 if (fullscreenLowPowerCoordinator_) | 1312 if (fullscreenLowPowerCoordinator_) |
| 1309 fullscreenLowPowerCoordinator_->ChildWindowsChanged(); | 1313 fullscreenLowPowerCoordinator_->ChildWindowsChanged(); |
| 1310 } | 1314 } |
| 1311 | 1315 |
| 1312 @end // @implementation BrowserWindowController(Private) | 1316 @end // @implementation BrowserWindowController(Private) |
| OLD | NEW |