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

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

Issue 2272783002: [Mac] Fix for fullscreen toolbar (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: comments Created 4 years, 4 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 #import "base/auto_reset.h" 9 #import "base/auto_reset.h"
10 #include "base/command_line.h" 10 #include "base/command_line.h"
(...skipping 436 matching lines...) Expand 10 before | Expand all | Expand 10 after
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 { 456 - (void)configureFullscreenToolbarController {
457 BOOL fullscreenForTab = [self isFullscreenForTabContentOrExtension]; 457 NSView* contentView = [[self window] contentView];
458 BOOL kioskMode =
459 base::CommandLine::ForCurrentProcess()->HasSwitch(switches::kKioskMode);
460 BOOL showDropdown =
461 !fullscreenForTab && !kioskMode && ([self floatingBarHasFocus]);
462
463 [fullscreenToolbarController_ 458 [fullscreenToolbarController_
464 setupFullscreenToolbarWithDropdown:showDropdown]; 459 setupFullscreenToolbarForContentView:contentView];
465 } 460 }
466 461
467 - (void)adjustUIForExitingFullscreenAndStopOmniboxSliding { 462 - (void)adjustUIForExitingFullscreenAndStopOmniboxSliding {
468 [fullscreenToolbarController_ exitFullscreenMode]; 463 [fullscreenToolbarController_ exitFullscreenMode];
469 fullscreenToolbarController_.reset(); 464 fullscreenToolbarController_.reset();
470 465
471 // Force the bookmark bar z-order to update. 466 // Force the bookmark bar z-order to update.
472 [[bookmarkBarController_ view] removeFromSuperview]; 467 [[bookmarkBarController_ view] removeFromSuperview];
473 [self layoutSubviews]; 468 [self layoutSubviews];
474 } 469 }
475 470
476 - (void)adjustUIForSlidingFullscreenStyle:(fullscreen_mac::SlidingStyle)style { 471 - (void)adjustUIForSlidingFullscreenStyle:(fullscreen_mac::SlidingStyle)style {
472 // The UI should only be adjusted in fullscreen mode.
473 if (![self isInAnyFullscreenMode])
474 return;
475
477 if (!fullscreenToolbarController_) { 476 if (!fullscreenToolbarController_) {
478 fullscreenToolbarController_.reset( 477 fullscreenToolbarController_.reset(
479 [self newFullscreenToolbarControllerWithStyle:style]); 478 [self newFullscreenToolbarControllerWithStyle:style]);
480 [self configureFullscreenToolbarController]; 479 [self configureFullscreenToolbarController];
481 } else { 480 } else {
482 fullscreenToolbarController_.get().slidingStyle = style; 481 fullscreenToolbarController_.get().slidingStyle = style;
483 } 482 }
484 483
485 if (!floatingBarBackingView_.get() && 484 if (!floatingBarBackingView_.get() &&
486 ([self hasTabStrip] || [self hasToolbar] || [self hasLocationBar])) { 485 ([self hasTabStrip] || [self hasToolbar] || [self hasLocationBar])) {
(...skipping 515 matching lines...) Expand 10 before | Expand all | Expand 10 after
1002 [infoBarContainerController_ 1001 [infoBarContainerController_
1003 setMaxTopArrowHeight:output.infoBarMaxTopArrowHeight]; 1002 setMaxTopArrowHeight:output.infoBarMaxTopArrowHeight];
1004 [infoBarContainerController_ 1003 [infoBarContainerController_
1005 setInfobarArrowX:[self locationBarBridge]->GetPageInfoBubblePoint().x]; 1004 setInfobarArrowX:[self locationBarBridge]->GetPageInfoBubblePoint().x];
1006 1005
1007 if (!NSIsEmptyRect(output.downloadShelfFrame)) 1006 if (!NSIsEmptyRect(output.downloadShelfFrame))
1008 [[downloadShelfController_ view] setFrame:output.downloadShelfFrame]; 1007 [[downloadShelfController_ view] setFrame:output.downloadShelfFrame];
1009 1008
1010 [self layoutTabContentArea:output.contentAreaFrame]; 1009 [self layoutTabContentArea:output.contentAreaFrame];
1011 1010
1012 if (!NSIsEmptyRect(output.fullscreenBackingBarFrame)) 1011 if (!NSIsEmptyRect(output.fullscreenBackingBarFrame)) {
1013 [floatingBarBackingView_ setFrame:output.fullscreenBackingBarFrame]; 1012 [floatingBarBackingView_ setFrame:output.fullscreenBackingBarFrame];
1013 [fullscreenToolbarController_
1014 setTrackingAreaFromOverlayFrame:output.fullscreenBackingBarFrame];
1015 }
1014 1016
1015 [findBarCocoaController_ 1017 [findBarCocoaController_
1016 positionFindBarViewAtMaxY:output.findBarMaxY 1018 positionFindBarViewAtMaxY:output.findBarMaxY
1017 maxWidth:NSWidth(output.contentAreaFrame)]; 1019 maxWidth:NSWidth(output.contentAreaFrame)];
1018 1020
1019 exclusiveAccessController_->Layout(output.fullscreenExitButtonMaxY); 1021 exclusiveAccessController_->Layout(output.fullscreenExitButtonMaxY);
1020 1022
1021 if (fullscreenLowPowerCoordinator_) { 1023 if (fullscreenLowPowerCoordinator_) {
1022 fullscreenLowPowerCoordinator_->SetLayoutParameters( 1024 fullscreenLowPowerCoordinator_->SetLayoutParameters(
1023 output.toolbarFrame, output.infoBarFrame, output.contentAreaFrame, 1025 output.toolbarFrame, output.infoBarFrame, output.contentAreaFrame,
(...skipping 242 matching lines...) Expand 10 before | Expand all | Expand 10 after
1266 if (fullscreenLowPowerCoordinator_) 1268 if (fullscreenLowPowerCoordinator_)
1267 fullscreenLowPowerCoordinator_->SetHasActiveSheet(false); 1269 fullscreenLowPowerCoordinator_->SetHasActiveSheet(false);
1268 } 1270 }
1269 1271
1270 - (void)childWindowsDidChange { 1272 - (void)childWindowsDidChange {
1271 if (fullscreenLowPowerCoordinator_) 1273 if (fullscreenLowPowerCoordinator_)
1272 fullscreenLowPowerCoordinator_->ChildWindowsChanged(); 1274 fullscreenLowPowerCoordinator_->ChildWindowsChanged();
1273 } 1275 }
1274 1276
1275 @end // @implementation BrowserWindowController(Private) 1277 @end // @implementation BrowserWindowController(Private)
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698