Chromium Code Reviews| 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 743 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 754 | 754 |
| 755 enteringImmersiveFullscreen_ = NO; | 755 enteringImmersiveFullscreen_ = NO; |
| 756 enteringPresentationMode_ = NO; | 756 enteringPresentationMode_ = NO; |
| 757 | 757 |
| 758 [self resetCustomAppKitFullscreenVariables]; | 758 [self resetCustomAppKitFullscreenVariables]; |
| 759 [[tabStripController_ activeTabContentsController] | 759 [[tabStripController_ activeTabContentsController] |
| 760 updateFullscreenWidgetFrame]; | 760 updateFullscreenWidgetFrame]; |
| 761 | 761 |
| 762 [self showFullscreenExitBubbleIfNecessary]; | 762 [self showFullscreenExitBubbleIfNecessary]; |
| 763 browser_->WindowFullscreenStateChanged(); | 763 browser_->WindowFullscreenStateChanged(); |
| 764 | |
| 765 if (shouldExitAfterEnteringFullscreen_) | |
|
erikchen
2016/06/10 20:54:23
Don't you need to unset shouldExitAfterEnteringFul
spqchan
2016/06/10 21:27:32
Right
| |
| 766 [self exitAppKitFullscreen]; | |
| 764 } | 767 } |
| 765 | 768 |
| 766 - (void)windowWillExitFullScreen:(NSNotification*)notification { | 769 - (void)windowWillExitFullScreen:(NSNotification*)notification { |
| 767 if (notification) // For System Fullscreen when non-nil. | 770 if (notification) // For System Fullscreen when non-nil. |
| 768 [self registerForContentViewResizeNotifications]; | 771 [self registerForContentViewResizeNotifications]; |
| 769 exitingAppKitFullscreen_ = YES; | 772 exitingAppKitFullscreen_ = YES; |
| 770 | 773 |
| 771 // Like windowWillEnterFullScreen, if we use custom animations, | 774 // Like windowWillEnterFullScreen, if we use custom animations, |
| 772 // adjustUIForExitingFullscreen should be called after the layout resizes in | 775 // adjustUIForExitingFullscreen should be called after the layout resizes in |
| 773 // startCustomAnimationToExitFullScreenWithDuration. | 776 // startCustomAnimationToExitFullScreenWithDuration. |
| (...skipping 142 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 916 - (void)enterAppKitFullscreen { | 919 - (void)enterAppKitFullscreen { |
| 917 if (FramedBrowserWindow* framedBrowserWindow = | 920 if (FramedBrowserWindow* framedBrowserWindow = |
| 918 base::mac::ObjCCast<FramedBrowserWindow>([self window])) { | 921 base::mac::ObjCCast<FramedBrowserWindow>([self window])) { |
| 919 [framedBrowserWindow toggleSystemFullScreen]; | 922 [framedBrowserWindow toggleSystemFullScreen]; |
| 920 } | 923 } |
| 921 } | 924 } |
| 922 | 925 |
| 923 - (void)exitAppKitFullscreen { | 926 - (void)exitAppKitFullscreen { |
| 924 if (FramedBrowserWindow* framedBrowserWindow = | 927 if (FramedBrowserWindow* framedBrowserWindow = |
| 925 base::mac::ObjCCast<FramedBrowserWindow>([self window])) { | 928 base::mac::ObjCCast<FramedBrowserWindow>([self window])) { |
| 929 | |
| 930 // If we're in the process of entering fullscreen, toggleSystemFullscreen | |
| 931 // will get ignored. Set |shouldExitAfterEnteringFullscreen_| to true so | |
| 932 // the browser will exit fullscreen immediately after it enters it. | |
| 933 if (enteringAppKitFullscreen_) { | |
| 934 shouldExitAfterEnteringFullscreen_ = YES; | |
| 935 return; | |
| 936 } | |
| 937 | |
| 926 [framedBrowserWindow toggleSystemFullScreen]; | 938 [framedBrowserWindow toggleSystemFullScreen]; |
| 927 } | 939 } |
| 928 } | 940 } |
| 929 | 941 |
| 930 - (NSRect)fullscreenButtonFrame { | 942 - (NSRect)fullscreenButtonFrame { |
| 931 NSButton* fullscreenButton = | 943 NSButton* fullscreenButton = |
| 932 [[self window] standardWindowButton:NSWindowFullScreenButton]; | 944 [[self window] standardWindowButton:NSWindowFullScreenButton]; |
| 933 if (!fullscreenButton) | 945 if (!fullscreenButton) |
| 934 return NSZeroRect; | 946 return NSZeroRect; |
| 935 | 947 |
| (...skipping 326 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 1262 } | 1274 } |
| 1263 | 1275 |
| 1264 - (BOOL)isFullscreenForTabContentOrExtension { | 1276 - (BOOL)isFullscreenForTabContentOrExtension { |
| 1265 FullscreenController* controller = | 1277 FullscreenController* controller = |
| 1266 browser_->exclusive_access_manager()->fullscreen_controller(); | 1278 browser_->exclusive_access_manager()->fullscreen_controller(); |
| 1267 return controller->IsWindowFullscreenForTabOrPending() || | 1279 return controller->IsWindowFullscreenForTabOrPending() || |
| 1268 controller->IsExtensionFullscreenOrPending(); | 1280 controller->IsExtensionFullscreenOrPending(); |
| 1269 } | 1281 } |
| 1270 | 1282 |
| 1271 @end // @implementation BrowserWindowController(Private) | 1283 @end // @implementation BrowserWindowController(Private) |
| OLD | NEW |