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 #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 407 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
418 NSNotificationCenter* center = [NSNotificationCenter defaultCenter]; | 418 NSNotificationCenter* center = [NSNotificationCenter defaultCenter]; |
419 [center removeObserver:self | 419 [center removeObserver:self |
420 name:NSWindowWillCloseNotification | 420 name:NSWindowWillCloseNotification |
421 object:[notification object]]; | 421 object:[notification object]]; |
422 [self releaseBarVisibilityForOwner:[notification object] | 422 [self releaseBarVisibilityForOwner:[notification object] |
423 withAnimation:YES | 423 withAnimation:YES |
424 delay:YES]; | 424 delay:YES]; |
425 } | 425 } |
426 | 426 |
427 - (void)configurePresentationModeController { | 427 - (void)configurePresentationModeController { |
428 BOOL fullscreen_for_tab = | 428 BOOL fullscreen_for_tab = browser_->GetExclusiveAccessManager() |
429 browser_->fullscreen_controller()->IsWindowFullscreenForTabOrPending(); | 429 ->GetFullscreenController() |
| 430 ->IsWindowFullscreenForTabOrPending(); |
430 BOOL kiosk_mode = | 431 BOOL kiosk_mode = |
431 base::CommandLine::ForCurrentProcess()->HasSwitch(switches::kKioskMode); | 432 base::CommandLine::ForCurrentProcess()->HasSwitch(switches::kKioskMode); |
432 BOOL showDropdown = | 433 BOOL showDropdown = |
433 !fullscreen_for_tab && !kiosk_mode && ([self floatingBarHasFocus]); | 434 !fullscreen_for_tab && !kiosk_mode && ([self floatingBarHasFocus]); |
434 if (permissionBubbleCocoa_ && permissionBubbleCocoa_->IsVisible()) { | 435 if (permissionBubbleCocoa_ && permissionBubbleCocoa_->IsVisible()) { |
435 DCHECK(permissionBubbleCocoa_->window()); | 436 DCHECK(permissionBubbleCocoa_->window()); |
436 // A visible permission bubble will force the dropdown to remain visible. | 437 // A visible permission bubble will force the dropdown to remain visible. |
437 [self lockBarVisibilityForOwner:permissionBubbleCocoa_->window() | 438 [self lockBarVisibilityForOwner:permissionBubbleCocoa_->window() |
438 withAnimation:NO | 439 withAnimation:NO |
439 delay:NO]; | 440 delay:NO]; |
(...skipping 222 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
662 RecordFullscreenWindowLocation([self window]); | 663 RecordFullscreenWindowLocation([self window]); |
663 RecordFullscreenStyle(enteringPresentationMode_ ? PRESENTATION_MODE | 664 RecordFullscreenStyle(enteringPresentationMode_ ? PRESENTATION_MODE |
664 : CANONICAL_FULLSCREEN); | 665 : CANONICAL_FULLSCREEN); |
665 | 666 |
666 if (notification) // For System Fullscreen when non-nil. | 667 if (notification) // For System Fullscreen when non-nil. |
667 [self registerForContentViewResizeNotifications]; | 668 [self registerForContentViewResizeNotifications]; |
668 | 669 |
669 NSWindow* window = [self window]; | 670 NSWindow* window = [self window]; |
670 savedRegularWindowFrame_ = [window frame]; | 671 savedRegularWindowFrame_ = [window frame]; |
671 BOOL mode = enteringPresentationMode_ || | 672 BOOL mode = enteringPresentationMode_ || |
672 browser_->fullscreen_controller()->IsWindowFullscreenForTabOrPending(); | 673 browser_->GetExclusiveAccessManager() |
| 674 ->GetFullscreenController() |
| 675 ->IsWindowFullscreenForTabOrPending(); |
673 enteringAppKitFullscreen_ = YES; | 676 enteringAppKitFullscreen_ = YES; |
674 enteringAppKitFullscreenOnPrimaryScreen_ = | 677 enteringAppKitFullscreenOnPrimaryScreen_ = |
675 [[[self window] screen] isEqual:[[NSScreen screens] objectAtIndex:0]]; | 678 [[[self window] screen] isEqual:[[NSScreen screens] objectAtIndex:0]]; |
676 | 679 |
677 fullscreen_mac::SlidingStyle style = | 680 fullscreen_mac::SlidingStyle style = |
678 mode ? fullscreen_mac::OMNIBOX_TABS_HIDDEN | 681 mode ? fullscreen_mac::OMNIBOX_TABS_HIDDEN |
679 : fullscreen_mac::OMNIBOX_TABS_PRESENT; | 682 : fullscreen_mac::OMNIBOX_TABS_PRESENT; |
680 | 683 |
681 [self adjustUIForSlidingFullscreenStyle:style]; | 684 [self adjustUIForSlidingFullscreenStyle:style]; |
682 } | 685 } |
(...skipping 328 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1011 } | 1014 } |
1012 if (!enteringAppKitFullscreen_) | 1015 if (!enteringAppKitFullscreen_) |
1013 return NO; | 1016 return NO; |
1014 if (enteringAppKitFullscreenOnPrimaryScreen_) | 1017 if (enteringAppKitFullscreenOnPrimaryScreen_) |
1015 return NO; | 1018 return NO; |
1016 | 1019 |
1017 return YES; | 1020 return YES; |
1018 } | 1021 } |
1019 | 1022 |
1020 @end // @implementation BrowserWindowController(Private) | 1023 @end // @implementation BrowserWindowController(Private) |
OLD | NEW |