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

Side by Side Diff: chrome/browser/ui/cocoa/browser_window_controller_private.mm

Issue 836933005: Refactor fullscreen_controller. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Rebase change Created 5 years, 11 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
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 #include "base/command_line.h" 9 #include "base/command_line.h"
10 #include "base/mac/bind_objc_block.h" 10 #include "base/mac/bind_objc_block.h"
(...skipping 408 matching lines...) Expand 10 before | Expand all | Expand 10 after
419 NSNotificationCenter* center = [NSNotificationCenter defaultCenter]; 419 NSNotificationCenter* center = [NSNotificationCenter defaultCenter];
420 [center removeObserver:self 420 [center removeObserver:self
421 name:NSWindowWillCloseNotification 421 name:NSWindowWillCloseNotification
422 object:[notification object]]; 422 object:[notification object]];
423 [self releaseBarVisibilityForOwner:[notification object] 423 [self releaseBarVisibilityForOwner:[notification object]
424 withAnimation:YES 424 withAnimation:YES
425 delay:YES]; 425 delay:YES];
426 } 426 }
427 427
428 - (void)configurePresentationModeController { 428 - (void)configurePresentationModeController {
429 BOOL fullscreen_for_tab = 429 BOOL fullscreen_for_tab = browser_->exclusive_access_manager()
430 browser_->fullscreen_controller()->IsWindowFullscreenForTabOrPending(); 430 ->fullscreen_controller()
431 ->IsWindowFullscreenForTabOrPending();
431 BOOL kiosk_mode = 432 BOOL kiosk_mode =
432 base::CommandLine::ForCurrentProcess()->HasSwitch(switches::kKioskMode); 433 base::CommandLine::ForCurrentProcess()->HasSwitch(switches::kKioskMode);
433 BOOL showDropdown = 434 BOOL showDropdown =
434 !fullscreen_for_tab && !kiosk_mode && ([self floatingBarHasFocus]); 435 !fullscreen_for_tab && !kiosk_mode && ([self floatingBarHasFocus]);
435 if (permissionBubbleCocoa_ && permissionBubbleCocoa_->IsVisible()) { 436 if (permissionBubbleCocoa_ && permissionBubbleCocoa_->IsVisible()) {
436 DCHECK(permissionBubbleCocoa_->window()); 437 DCHECK(permissionBubbleCocoa_->window());
437 // A visible permission bubble will force the dropdown to remain visible. 438 // A visible permission bubble will force the dropdown to remain visible.
438 [self lockBarVisibilityForOwner:permissionBubbleCocoa_->window() 439 [self lockBarVisibilityForOwner:permissionBubbleCocoa_->window()
439 withAnimation:NO 440 withAnimation:NO
440 delay:NO]; 441 delay:NO];
(...skipping 222 matching lines...) Expand 10 before | Expand all | Expand 10 after
663 RecordFullscreenWindowLocation([self window]); 664 RecordFullscreenWindowLocation([self window]);
664 RecordFullscreenStyle(enteringPresentationMode_ ? PRESENTATION_MODE 665 RecordFullscreenStyle(enteringPresentationMode_ ? PRESENTATION_MODE
665 : CANONICAL_FULLSCREEN); 666 : CANONICAL_FULLSCREEN);
666 667
667 if (notification) // For System Fullscreen when non-nil. 668 if (notification) // For System Fullscreen when non-nil.
668 [self registerForContentViewResizeNotifications]; 669 [self registerForContentViewResizeNotifications];
669 670
670 NSWindow* window = [self window]; 671 NSWindow* window = [self window];
671 savedRegularWindowFrame_ = [window frame]; 672 savedRegularWindowFrame_ = [window frame];
672 BOOL mode = enteringPresentationMode_ || 673 BOOL mode = enteringPresentationMode_ ||
673 browser_->fullscreen_controller()->IsWindowFullscreenForTabOrPending(); 674 browser_->exclusive_access_manager()
675 ->fullscreen_controller()
676 ->IsWindowFullscreenForTabOrPending();
674 enteringAppKitFullscreen_ = YES; 677 enteringAppKitFullscreen_ = YES;
675 enteringAppKitFullscreenOnPrimaryScreen_ = 678 enteringAppKitFullscreenOnPrimaryScreen_ =
676 [[[self window] screen] isEqual:[[NSScreen screens] objectAtIndex:0]]; 679 [[[self window] screen] isEqual:[[NSScreen screens] objectAtIndex:0]];
677 680
678 fullscreen_mac::SlidingStyle style = 681 fullscreen_mac::SlidingStyle style =
679 mode ? fullscreen_mac::OMNIBOX_TABS_HIDDEN 682 mode ? fullscreen_mac::OMNIBOX_TABS_HIDDEN
680 : fullscreen_mac::OMNIBOX_TABS_PRESENT; 683 : fullscreen_mac::OMNIBOX_TABS_PRESENT;
681 684
682 [self adjustUIForSlidingFullscreenStyle:style]; 685 [self adjustUIForSlidingFullscreenStyle:style];
683 } 686 }
(...skipping 379 matching lines...) Expand 10 before | Expand all | Expand 10 after
1063 } 1066 }
1064 1067
1065 - (BOOL)shouldConstrainFrameRect { 1068 - (BOOL)shouldConstrainFrameRect {
1066 if ([enterFullscreenTransition_ shouldWindowBeUnconstrained]) 1069 if ([enterFullscreenTransition_ shouldWindowBeUnconstrained])
1067 return NO; 1070 return NO;
1068 1071
1069 return [super shouldConstrainFrameRect]; 1072 return [super shouldConstrainFrameRect];
1070 } 1073 }
1071 1074
1072 @end // @implementation BrowserWindowController(Private) 1075 @end // @implementation BrowserWindowController(Private)
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698