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

Side by Side 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 unified diff | Download patch
« no previous file with comments | « chrome/browser/ui/cocoa/browser_window_controller.h ('k') | no next file » | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
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 746 matching lines...) Expand 10 before | Expand all | Expand 10 after
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 764
765 if (fullscreenLowPowerCoordinator_) 765 if (fullscreenLowPowerCoordinator_)
766 fullscreenLowPowerCoordinator_->SetInFullscreenTransition(false); 766 fullscreenLowPowerCoordinator_->SetInFullscreenTransition(false);
767
768 if (shouldExitAfterEnteringFullscreen_) {
769 shouldExitAfterEnteringFullscreen_ = NO;
770 [self exitAppKitFullscreen];
771 }
767 } 772 }
768 773
769 - (void)windowWillExitFullScreen:(NSNotification*)notification { 774 - (void)windowWillExitFullScreen:(NSNotification*)notification {
770 if (fullscreenLowPowerCoordinator_) 775 if (fullscreenLowPowerCoordinator_)
771 fullscreenLowPowerCoordinator_->SetInFullscreenTransition(true); 776 fullscreenLowPowerCoordinator_->SetInFullscreenTransition(true);
772 777
773 if (notification) // For System Fullscreen when non-nil. 778 if (notification) // For System Fullscreen when non-nil.
774 [self registerForContentViewResizeNotifications]; 779 [self registerForContentViewResizeNotifications];
775 exitingAppKitFullscreen_ = YES; 780 exitingAppKitFullscreen_ = YES;
776 781
(...skipping 145 matching lines...) Expand 10 before | Expand all | Expand 10 after
922 - (void)enterAppKitFullscreen { 927 - (void)enterAppKitFullscreen {
923 if (FramedBrowserWindow* framedBrowserWindow = 928 if (FramedBrowserWindow* framedBrowserWindow =
924 base::mac::ObjCCast<FramedBrowserWindow>([self window])) { 929 base::mac::ObjCCast<FramedBrowserWindow>([self window])) {
925 [framedBrowserWindow toggleSystemFullScreen]; 930 [framedBrowserWindow toggleSystemFullScreen];
926 } 931 }
927 } 932 }
928 933
929 - (void)exitAppKitFullscreen { 934 - (void)exitAppKitFullscreen {
930 if (FramedBrowserWindow* framedBrowserWindow = 935 if (FramedBrowserWindow* framedBrowserWindow =
931 base::mac::ObjCCast<FramedBrowserWindow>([self window])) { 936 base::mac::ObjCCast<FramedBrowserWindow>([self window])) {
937
938 // If we're in the process of entering fullscreen, toggleSystemFullscreen
939 // will get ignored. Set |shouldExitAfterEnteringFullscreen_| to true so
940 // the browser will exit fullscreen immediately after it enters it.
941 if (enteringAppKitFullscreen_) {
942 shouldExitAfterEnteringFullscreen_ = YES;
943 return;
944 }
945
932 [framedBrowserWindow toggleSystemFullScreen]; 946 [framedBrowserWindow toggleSystemFullScreen];
933 } 947 }
934 } 948 }
935 949
936 - (NSRect)fullscreenButtonFrame { 950 - (NSRect)fullscreenButtonFrame {
937 NSButton* fullscreenButton = 951 NSButton* fullscreenButton =
938 [[self window] standardWindowButton:NSWindowFullScreenButton]; 952 [[self window] standardWindowButton:NSWindowFullScreenButton];
939 if (!fullscreenButton) 953 if (!fullscreenButton)
940 return NSZeroRect; 954 return NSZeroRect;
941 955
(...skipping 347 matching lines...) Expand 10 before | Expand all | Expand 10 after
1289 if (fullscreenLowPowerCoordinator_) 1303 if (fullscreenLowPowerCoordinator_)
1290 fullscreenLowPowerCoordinator_->SetHasActiveSheet(false); 1304 fullscreenLowPowerCoordinator_->SetHasActiveSheet(false);
1291 } 1305 }
1292 1306
1293 - (void)childWindowsDidChange { 1307 - (void)childWindowsDidChange {
1294 if (fullscreenLowPowerCoordinator_) 1308 if (fullscreenLowPowerCoordinator_)
1295 fullscreenLowPowerCoordinator_->ChildWindowsChanged(); 1309 fullscreenLowPowerCoordinator_->ChildWindowsChanged();
1296 } 1310 }
1297 1311
1298 @end // @implementation BrowserWindowController(Private) 1312 @end // @implementation BrowserWindowController(Private)
OLDNEW
« 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