| 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 592 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 603 | 603 |
| 604 NSWindow* window = [self window]; | 604 NSWindow* window = [self window]; |
| 605 savedRegularWindowFrame_ = [window frame]; | 605 savedRegularWindowFrame_ = [window frame]; |
| 606 | 606 |
| 607 enteringAppKitFullscreen_ = YES; | 607 enteringAppKitFullscreen_ = YES; |
| 608 enteringAppKitFullscreenOnPrimaryScreen_ = | 608 enteringAppKitFullscreenOnPrimaryScreen_ = |
| 609 [[[self window] screen] isEqual:[[NSScreen screens] firstObject]]; | 609 [[[self window] screen] isEqual:[[NSScreen screens] firstObject]]; |
| 610 | 610 |
| 611 [self setSheetHiddenForFullscreenTransition:YES]; | 611 [self setSheetHiddenForFullscreenTransition:YES]; |
| 612 [self adjustUIForEnteringFullscreen]; | 612 [self adjustUIForEnteringFullscreen]; |
| 613 browser_->WindowFullscreenStateWillChange(); |
| 613 } | 614 } |
| 614 | 615 |
| 615 - (void)windowDidEnterFullScreen:(NSNotification*)notification { | 616 - (void)windowDidEnterFullScreen:(NSNotification*)notification { |
| 616 [tabStripController_ setVisualEffectsDisabledForFullscreen:YES]; | 617 [tabStripController_ setVisualEffectsDisabledForFullscreen:YES]; |
| 617 | 618 |
| 618 // In Yosemite, some combination of the titlebar and toolbar always show in | 619 // In Yosemite, some combination of the titlebar and toolbar always show in |
| 619 // full-screen mode. We do not want either to show. Search for the window that | 620 // full-screen mode. We do not want either to show. Search for the window that |
| 620 // contains the views, and hide it. There is no need to ever unhide the view. | 621 // contains the views, and hide it. There is no need to ever unhide the view. |
| 621 // http://crbug.com/380235 | 622 // http://crbug.com/380235 |
| 622 if (base::mac::IsAtLeastOS10_10()) { | 623 if (base::mac::IsAtLeastOS10_10()) { |
| (...skipping 70 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 693 // Like windowWillEnterFullScreen, if we use custom animations, | 694 // Like windowWillEnterFullScreen, if we use custom animations, |
| 694 // adjustUIForExitingFullscreen should be called after the layout resizes in | 695 // adjustUIForExitingFullscreen should be called after the layout resizes in |
| 695 // startCustomAnimationToExitFullScreenWithDuration. | 696 // startCustomAnimationToExitFullScreenWithDuration. |
| 696 if (isUsingCustomAnimation_) { | 697 if (isUsingCustomAnimation_) { |
| 697 blockLayoutSubviews_ = YES; | 698 blockLayoutSubviews_ = YES; |
| 698 [self.chromeContentView setAutoresizesSubviews:NO]; | 699 [self.chromeContentView setAutoresizesSubviews:NO]; |
| 699 [self setSheetHiddenForFullscreenTransition:YES]; | 700 [self setSheetHiddenForFullscreenTransition:YES]; |
| 700 } else { | 701 } else { |
| 701 [self adjustUIForExitingFullscreen]; | 702 [self adjustUIForExitingFullscreen]; |
| 702 } | 703 } |
| 704 browser_->WindowFullscreenStateWillChange(); |
| 703 } | 705 } |
| 704 | 706 |
| 705 - (void)windowDidExitFullScreen:(NSNotification*)notification { | 707 - (void)windowDidExitFullScreen:(NSNotification*)notification { |
| 706 DCHECK(exitingAppKitFullscreen_); | 708 DCHECK(exitingAppKitFullscreen_); |
| 707 | 709 |
| 708 // If the custom transition isn't complete, then just set the flag and | 710 // If the custom transition isn't complete, then just set the flag and |
| 709 // return. Once the transition is completed, windowDidExitFullscreen will | 711 // return. Once the transition is completed, windowDidExitFullscreen will |
| 710 // be called again. | 712 // be called again. |
| 711 if (isUsingCustomAnimation_ && | 713 if (isUsingCustomAnimation_ && |
| 712 ![fullscreenTransition_ isTransitionCompleted]) { | 714 ![fullscreenTransition_ isTransitionCompleted]) { |
| (...skipping 479 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1192 if (fullscreenLowPowerCoordinator_) | 1194 if (fullscreenLowPowerCoordinator_) |
| 1193 fullscreenLowPowerCoordinator_->SetHasActiveSheet(false); | 1195 fullscreenLowPowerCoordinator_->SetHasActiveSheet(false); |
| 1194 } | 1196 } |
| 1195 | 1197 |
| 1196 - (void)childWindowsDidChange { | 1198 - (void)childWindowsDidChange { |
| 1197 if (fullscreenLowPowerCoordinator_) | 1199 if (fullscreenLowPowerCoordinator_) |
| 1198 fullscreenLowPowerCoordinator_->ChildWindowsChanged(); | 1200 fullscreenLowPowerCoordinator_->ChildWindowsChanged(); |
| 1199 } | 1201 } |
| 1200 | 1202 |
| 1201 @end // @implementation BrowserWindowController(Private) | 1203 @end // @implementation BrowserWindowController(Private) |
| OLD | NEW |