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 #import "base/auto_reset.h" | 9 #import "base/auto_reset.h" |
10 #include "base/command_line.h" | 10 #include "base/command_line.h" |
(...skipping 442 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
453 manager->UpdateAnchorPosition(); | 453 manager->UpdateAnchorPosition(); |
454 } | 454 } |
455 | 455 |
456 - (void)configureFullscreenToolbarController { | 456 - (void)configureFullscreenToolbarController { |
457 BOOL fullscreenForTab = [self isFullscreenForTabContentOrExtension]; | 457 BOOL fullscreenForTab = [self isFullscreenForTabContentOrExtension]; |
458 BOOL kioskMode = | 458 BOOL kioskMode = |
459 base::CommandLine::ForCurrentProcess()->HasSwitch(switches::kKioskMode); | 459 base::CommandLine::ForCurrentProcess()->HasSwitch(switches::kKioskMode); |
460 BOOL showDropdown = | 460 BOOL showDropdown = |
461 !fullscreenForTab && !kioskMode && ([self floatingBarHasFocus]); | 461 !fullscreenForTab && !kioskMode && ([self floatingBarHasFocus]); |
462 | 462 |
| 463 NSView* contentView = [[self window] contentView]; |
463 [fullscreenToolbarController_ | 464 [fullscreenToolbarController_ |
464 setupFullscreenToolbarWithDropdown:showDropdown]; | 465 setupFullscreenToolbarForContentView:contentView |
| 466 showDropdown:showDropdown]; |
465 } | 467 } |
466 | 468 |
467 - (void)adjustUIForExitingFullscreenAndStopOmniboxSliding { | 469 - (void)adjustUIForExitingFullscreenAndStopOmniboxSliding { |
468 [fullscreenToolbarController_ exitFullscreenMode]; | 470 [fullscreenToolbarController_ exitFullscreenMode]; |
469 fullscreenToolbarController_.reset(); | 471 fullscreenToolbarController_.reset(); |
470 | 472 |
471 // Force the bookmark bar z-order to update. | 473 // Force the bookmark bar z-order to update. |
472 [[bookmarkBarController_ view] removeFromSuperview]; | 474 [[bookmarkBarController_ view] removeFromSuperview]; |
473 [self layoutSubviews]; | 475 [self layoutSubviews]; |
474 } | 476 } |
475 | 477 |
476 - (void)adjustUIForSlidingFullscreenStyle:(fullscreen_mac::SlidingStyle)style { | 478 - (void)adjustUIForSlidingFullscreenStyle:(fullscreen_mac::SlidingStyle)style { |
| 479 // The UI should only be adjusted in fullscreen mode. |
| 480 if (![self isInAnyFullscreenMode]) |
| 481 return; |
| 482 |
477 if (!fullscreenToolbarController_) { | 483 if (!fullscreenToolbarController_) { |
478 fullscreenToolbarController_.reset( | 484 fullscreenToolbarController_.reset( |
479 [self newFullscreenToolbarControllerWithStyle:style]); | 485 [self newFullscreenToolbarControllerWithStyle:style]); |
480 [self configureFullscreenToolbarController]; | 486 [self configureFullscreenToolbarController]; |
481 } else { | 487 } else { |
482 fullscreenToolbarController_.get().slidingStyle = style; | 488 fullscreenToolbarController_.get().slidingStyle = style; |
483 } | 489 } |
484 | 490 |
485 if (!floatingBarBackingView_.get() && | 491 if (!floatingBarBackingView_.get() && |
486 ([self hasTabStrip] || [self hasToolbar] || [self hasLocationBar])) { | 492 ([self hasTabStrip] || [self hasToolbar] || [self hasLocationBar])) { |
(...skipping 515 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1002 [infoBarContainerController_ | 1008 [infoBarContainerController_ |
1003 setMaxTopArrowHeight:output.infoBarMaxTopArrowHeight]; | 1009 setMaxTopArrowHeight:output.infoBarMaxTopArrowHeight]; |
1004 [infoBarContainerController_ | 1010 [infoBarContainerController_ |
1005 setInfobarArrowX:[self locationBarBridge]->GetPageInfoBubblePoint().x]; | 1011 setInfobarArrowX:[self locationBarBridge]->GetPageInfoBubblePoint().x]; |
1006 | 1012 |
1007 if (!NSIsEmptyRect(output.downloadShelfFrame)) | 1013 if (!NSIsEmptyRect(output.downloadShelfFrame)) |
1008 [[downloadShelfController_ view] setFrame:output.downloadShelfFrame]; | 1014 [[downloadShelfController_ view] setFrame:output.downloadShelfFrame]; |
1009 | 1015 |
1010 [self layoutTabContentArea:output.contentAreaFrame]; | 1016 [self layoutTabContentArea:output.contentAreaFrame]; |
1011 | 1017 |
1012 if (!NSIsEmptyRect(output.fullscreenBackingBarFrame)) | 1018 if (!NSIsEmptyRect(output.fullscreenBackingBarFrame)) { |
1013 [floatingBarBackingView_ setFrame:output.fullscreenBackingBarFrame]; | 1019 [floatingBarBackingView_ setFrame:output.fullscreenBackingBarFrame]; |
| 1020 [fullscreenToolbarController_ |
| 1021 setTrackingAreaFromOverlayFrame:output.fullscreenBackingBarFrame]; |
| 1022 } |
1014 | 1023 |
1015 [findBarCocoaController_ | 1024 [findBarCocoaController_ |
1016 positionFindBarViewAtMaxY:output.findBarMaxY | 1025 positionFindBarViewAtMaxY:output.findBarMaxY |
1017 maxWidth:NSWidth(output.contentAreaFrame)]; | 1026 maxWidth:NSWidth(output.contentAreaFrame)]; |
1018 | 1027 |
1019 exclusiveAccessController_->Layout(output.fullscreenExitButtonMaxY); | 1028 exclusiveAccessController_->Layout(output.fullscreenExitButtonMaxY); |
1020 | 1029 |
1021 if (fullscreenLowPowerCoordinator_) { | 1030 if (fullscreenLowPowerCoordinator_) { |
1022 fullscreenLowPowerCoordinator_->SetLayoutParameters( | 1031 fullscreenLowPowerCoordinator_->SetLayoutParameters( |
1023 output.toolbarFrame, output.infoBarFrame, output.contentAreaFrame, | 1032 output.toolbarFrame, output.infoBarFrame, output.contentAreaFrame, |
(...skipping 242 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1266 if (fullscreenLowPowerCoordinator_) | 1275 if (fullscreenLowPowerCoordinator_) |
1267 fullscreenLowPowerCoordinator_->SetHasActiveSheet(false); | 1276 fullscreenLowPowerCoordinator_->SetHasActiveSheet(false); |
1268 } | 1277 } |
1269 | 1278 |
1270 - (void)childWindowsDidChange { | 1279 - (void)childWindowsDidChange { |
1271 if (fullscreenLowPowerCoordinator_) | 1280 if (fullscreenLowPowerCoordinator_) |
1272 fullscreenLowPowerCoordinator_->ChildWindowsChanged(); | 1281 fullscreenLowPowerCoordinator_->ChildWindowsChanged(); |
1273 } | 1282 } |
1274 | 1283 |
1275 @end // @implementation BrowserWindowController(Private) | 1284 @end // @implementation BrowserWindowController(Private) |
OLD | NEW |