Chromium Code Reviews| 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 1564f0c8bc974b6852ae0f5d895d4bb0a7a869e1..be1846ad155fbb8ddf82abedd1583803aa08ddc4 100644 |
| --- a/chrome/browser/ui/cocoa/browser_window_controller_private.mm |
| +++ b/chrome/browser/ui/cocoa/browser_window_controller_private.mm |
| @@ -761,6 +761,9 @@ willPositionSheet:(NSWindow*)sheet |
| [self showFullscreenExitBubbleIfNecessary]; |
| browser_->WindowFullscreenStateChanged(); |
| + |
| + if (shouldExitAfterEnteringFullscreen_) |
|
erikchen
2016/06/10 20:54:23
Don't you need to unset shouldExitAfterEnteringFul
spqchan
2016/06/10 21:27:32
Right
|
| + [self exitAppKitFullscreen]; |
| } |
| - (void)windowWillExitFullScreen:(NSNotification*)notification { |
| @@ -923,6 +926,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]; |
| } |
| } |