| 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 435 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 446 // We're done moving focus, so re-enable bar visibility changes. | 446 // We're done moving focus, so re-enable bar visibility changes. |
| 447 [self enableBarVisibilityUpdates]; | 447 [self enableBarVisibilityUpdates]; |
| 448 } | 448 } |
| 449 | 449 |
| 450 - (void)updatePermissionBubbleAnchor { | 450 - (void)updatePermissionBubbleAnchor { |
| 451 PermissionRequestManager* manager = [self permissionRequestManager]; | 451 PermissionRequestManager* manager = [self permissionRequestManager]; |
| 452 if (manager) | 452 if (manager) |
| 453 manager->UpdateAnchorPosition(); | 453 manager->UpdateAnchorPosition(); |
| 454 } | 454 } |
| 455 | 455 |
| 456 - (void)configureFullscreenToolbarController { | |
| 457 NSView* contentView = [[self window] contentView]; | |
| 458 [fullscreenToolbarController_ | |
| 459 setupFullscreenToolbarForContentView:contentView]; | |
| 460 } | |
| 461 | |
| 462 - (void)adjustUIForExitingFullscreenAndStopOmniboxSliding { | 456 - (void)adjustUIForExitingFullscreenAndStopOmniboxSliding { |
| 463 [fullscreenToolbarController_ exitFullscreenMode]; | 457 [fullscreenToolbarController_ exitFullscreenMode]; |
| 464 fullscreenToolbarController_.reset(); | 458 fullscreenToolbarController_.reset(); |
| 465 | 459 |
| 466 // Force the bookmark bar z-order to update. | 460 // Force the bookmark bar z-order to update. |
| 467 [[bookmarkBarController_ view] removeFromSuperview]; | 461 [[bookmarkBarController_ view] removeFromSuperview]; |
| 468 [self layoutSubviews]; | 462 [self layoutSubviews]; |
| 469 } | 463 } |
| 470 | 464 |
| 471 - (void)adjustUIForSlidingFullscreenStyle:(FullscreenSlidingStyle)style { | 465 - (void)adjustUIForSlidingFullscreenStyle:(FullscreenSlidingStyle)style { |
| 472 // The UI should only be adjusted in fullscreen mode. | 466 // The UI should only be adjusted in fullscreen mode. |
| 473 if (![self isInAnyFullscreenMode]) | 467 if (![self isInAnyFullscreenMode]) |
| 474 return; | 468 return; |
| 475 | 469 |
| 476 if (!fullscreenToolbarController_) { | 470 if (!fullscreenToolbarController_) { |
| 477 fullscreenToolbarController_.reset( | 471 fullscreenToolbarController_.reset( |
| 478 [self newFullscreenToolbarControllerWithStyle:style]); | 472 [self newFullscreenToolbarControllerWithStyle:style]); |
| 479 [self configureFullscreenToolbarController]; | 473 [fullscreenToolbarController_ enterFullscreenMode]; |
| 480 } else { | 474 } else { |
| 481 fullscreenToolbarController_.get().slidingStyle = style; | 475 fullscreenToolbarController_.get().slidingStyle = style; |
| 482 } | 476 } |
| 483 | 477 |
| 484 if (!floatingBarBackingView_.get() && | 478 if (!floatingBarBackingView_.get() && |
| 485 ([self hasTabStrip] || [self hasToolbar] || [self hasLocationBar])) { | 479 ([self hasTabStrip] || [self hasToolbar] || [self hasLocationBar])) { |
| 486 floatingBarBackingView_.reset( | 480 floatingBarBackingView_.reset( |
| 487 [[FloatingBarBackingView alloc] initWithFrame:NSZeroRect]); | 481 [[FloatingBarBackingView alloc] initWithFrame:NSZeroRect]); |
| 488 [floatingBarBackingView_ | 482 [floatingBarBackingView_ |
| 489 setAutoresizingMask:(NSViewWidthSizable | NSViewMinYMargin)]; | 483 setAutoresizingMask:(NSViewWidthSizable | NSViewMinYMargin)]; |
| (...skipping 502 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 992 setInfobarArrowX:[self locationBarBridge]->GetPageInfoBubblePoint().x]; | 986 setInfobarArrowX:[self locationBarBridge]->GetPageInfoBubblePoint().x]; |
| 993 | 987 |
| 994 if (!NSIsEmptyRect(output.downloadShelfFrame)) | 988 if (!NSIsEmptyRect(output.downloadShelfFrame)) |
| 995 [[downloadShelfController_ view] setFrame:output.downloadShelfFrame]; | 989 [[downloadShelfController_ view] setFrame:output.downloadShelfFrame]; |
| 996 | 990 |
| 997 [self layoutTabContentArea:output.contentAreaFrame]; | 991 [self layoutTabContentArea:output.contentAreaFrame]; |
| 998 | 992 |
| 999 if (!NSIsEmptyRect(output.fullscreenBackingBarFrame)) { | 993 if (!NSIsEmptyRect(output.fullscreenBackingBarFrame)) { |
| 1000 [floatingBarBackingView_ setFrame:output.fullscreenBackingBarFrame]; | 994 [floatingBarBackingView_ setFrame:output.fullscreenBackingBarFrame]; |
| 1001 [fullscreenToolbarController_ | 995 [fullscreenToolbarController_ |
| 1002 setTrackingAreaFromOverlayFrame:output.fullscreenBackingBarFrame]; | 996 updateToolbarFrame:output.fullscreenBackingBarFrame]; |
| 1003 } | 997 } |
| 1004 | 998 |
| 1005 [findBarCocoaController_ | 999 [findBarCocoaController_ |
| 1006 positionFindBarViewAtMaxY:output.findBarMaxY | 1000 positionFindBarViewAtMaxY:output.findBarMaxY |
| 1007 maxWidth:NSWidth(output.contentAreaFrame)]; | 1001 maxWidth:NSWidth(output.contentAreaFrame)]; |
| 1008 | 1002 |
| 1009 if (fullscreenLowPowerCoordinator_) { | 1003 if (fullscreenLowPowerCoordinator_) { |
| 1010 fullscreenLowPowerCoordinator_->SetLayoutParameters( | 1004 fullscreenLowPowerCoordinator_->SetLayoutParameters( |
| 1011 output.toolbarFrame, output.infoBarFrame, output.contentAreaFrame, | 1005 output.toolbarFrame, output.infoBarFrame, output.contentAreaFrame, |
| 1012 output.downloadShelfFrame); | 1006 output.downloadShelfFrame); |
| (...skipping 241 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1254 if (fullscreenLowPowerCoordinator_) | 1248 if (fullscreenLowPowerCoordinator_) |
| 1255 fullscreenLowPowerCoordinator_->SetHasActiveSheet(false); | 1249 fullscreenLowPowerCoordinator_->SetHasActiveSheet(false); |
| 1256 } | 1250 } |
| 1257 | 1251 |
| 1258 - (void)childWindowsDidChange { | 1252 - (void)childWindowsDidChange { |
| 1259 if (fullscreenLowPowerCoordinator_) | 1253 if (fullscreenLowPowerCoordinator_) |
| 1260 fullscreenLowPowerCoordinator_->ChildWindowsChanged(); | 1254 fullscreenLowPowerCoordinator_->ChildWindowsChanged(); |
| 1261 } | 1255 } |
| 1262 | 1256 |
| 1263 @end // @implementation BrowserWindowController(Private) | 1257 @end // @implementation BrowserWindowController(Private) |
| OLD | NEW |