Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(2582)

Unified Diff: chrome/browser/ui/cocoa/browser_window_controller_private.mm

Issue 2053343003: [Mac] Fix Issue to Exit Fullscreen (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: rebased Created 4 years, 6 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « chrome/browser/ui/cocoa/browser_window_controller.h ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: chrome/browser/ui/cocoa/browser_window_controller_private.mm
diff --git a/chrome/browser/ui/cocoa/browser_window_controller_private.mm b/chrome/browser/ui/cocoa/browser_window_controller_private.mm
index 7a79c2d42937933878cdfc4b4815f2a843fc3d72..996e3d6b3ce3110895a4ad4dbf89adf27122978f 100644
--- a/chrome/browser/ui/cocoa/browser_window_controller_private.mm
+++ b/chrome/browser/ui/cocoa/browser_window_controller_private.mm
@@ -764,6 +764,11 @@ willPositionSheet:(NSWindow*)sheet
if (fullscreenLowPowerCoordinator_)
fullscreenLowPowerCoordinator_->SetInFullscreenTransition(false);
+
+ if (shouldExitAfterEnteringFullscreen_) {
+ shouldExitAfterEnteringFullscreen_ = NO;
+ [self exitAppKitFullscreen];
+ }
}
- (void)windowWillExitFullScreen:(NSNotification*)notification {
@@ -929,6 +934,15 @@ willPositionSheet:(NSWindow*)sheet
- (void)exitAppKitFullscreen {
if (FramedBrowserWindow* framedBrowserWindow =
base::mac::ObjCCast<FramedBrowserWindow>([self window])) {
+
+ // If we're in the process of entering fullscreen, toggleSystemFullscreen
+ // will get ignored. Set |shouldExitAfterEnteringFullscreen_| to true so
+ // the browser will exit fullscreen immediately after it enters it.
+ if (enteringAppKitFullscreen_) {
+ shouldExitAfterEnteringFullscreen_ = YES;
+ return;
+ }
+
[framedBrowserWindow toggleSystemFullScreen];
}
}
« no previous file with comments | « chrome/browser/ui/cocoa/browser_window_controller.h ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698