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

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

Issue 2738043002: [Mac] Fullscreen Toolbar Fixes (Closed)
Patch Set: Fixed test Created 3 years, 9 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
« no previous file with comments | « no previous file | chrome/browser/ui/cocoa/browser_window_controller_browsertest.mm » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 // Copyright 2012 The Chromium Authors. All rights reserved. 1 // Copyright 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.h" 5 #import "chrome/browser/ui/cocoa/browser_window_controller.h"
6 6
7 #include <cmath> 7 #include <cmath>
8 #include <numeric> 8 #include <numeric>
9 #include <utility> 9 #include <utility>
10 10
(...skipping 1013 matching lines...) Expand 10 before | Expand all | Expand 10 after
1024 if (manager) 1024 if (manager)
1025 manager->HideBubble(); 1025 manager->HideBubble();
1026 } 1026 }
1027 1027
1028 if (newContents) { 1028 if (newContents) {
1029 manager = PermissionRequestManager::FromWebContents(newContents); 1029 manager = PermissionRequestManager::FromWebContents(newContents);
1030 if (manager) 1030 if (manager)
1031 manager->DisplayPendingRequests(); 1031 manager->DisplayPendingRequests();
1032 } 1032 }
1033 1033
1034 // If the web contents want to focus on the location bar, do not call the 1034 if ([self isInAnyFullscreenMode])
1035 // animation since the location bar will drop down when it's focused.
1036 bool willFocusLocationBar =
1037 newContents && newContents->FocusLocationBarByDefault();
1038 if ([self isInAnyFullscreenMode] && !willFocusLocationBar)
1039 [[self fullscreenToolbarController] revealToolbarForTabStripChanges]; 1035 [[self fullscreenToolbarController] revealToolbarForTabStripChanges];
1040 } 1036 }
1041 1037
1042 - (void)zoomChangedForActiveTab:(BOOL)canShowBubble { 1038 - (void)zoomChangedForActiveTab:(BOOL)canShowBubble {
1043 [toolbarController_ zoomChangedForActiveTab:canShowBubble]; 1039 [toolbarController_ zoomChangedForActiveTab:canShowBubble];
1044 } 1040 }
1045 1041
1046 // Accept tabs from a BrowserWindowController with the same Profile. 1042 // Accept tabs from a BrowserWindowController with the same Profile.
1047 - (BOOL)canReceiveFrom:(TabWindowController*)source { 1043 - (BOOL)canReceiveFrom:(TabWindowController*)source {
1048 BrowserWindowController* realSource = 1044 BrowserWindowController* realSource =
(...skipping 420 matching lines...) Expand 10 before | Expand all | Expand 10 after
1469 windowShim_->BookmarkBarStateChanged( 1465 windowShim_->BookmarkBarStateChanged(
1470 BookmarkBar::DONT_ANIMATE_STATE_CHANGE); 1466 BookmarkBar::DONT_ANIMATE_STATE_CHANGE);
1471 } 1467 }
1472 } 1468 }
1473 1469
1474 - (void)onTabDetachedWithContents:(WebContents*)contents { 1470 - (void)onTabDetachedWithContents:(WebContents*)contents {
1475 [infoBarContainerController_ tabDetachedWithContents:contents]; 1471 [infoBarContainerController_ tabDetachedWithContents:contents];
1476 } 1472 }
1477 1473
1478 - (void)onTabInsertedInForeground:(BOOL)inForeground { 1474 - (void)onTabInsertedInForeground:(BOOL)inForeground {
1479 if ([self isInAnyFullscreenMode] && !inForeground && 1475 if ([self isInAnyFullscreenMode] && !inForeground)
1480 ![toolbarController_ isLocationBarFocused]) {
1481 [[self fullscreenToolbarController] revealToolbarForTabStripChanges]; 1476 [[self fullscreenToolbarController] revealToolbarForTabStripChanges];
1482 }
1483 } 1477 }
1484 1478
1485 - (void)userChangedTheme { 1479 - (void)userChangedTheme {
1486 NSView* rootView = [[[self window] contentView] superview]; 1480 NSView* rootView = [[[self window] contentView] superview];
1487 [rootView cr_recursivelyInvokeBlock:^(id view) { 1481 [rootView cr_recursivelyInvokeBlock:^(id view) {
1488 if ([view conformsToProtocol:@protocol(ThemedWindowDrawing)]) 1482 if ([view conformsToProtocol:@protocol(ThemedWindowDrawing)])
1489 [view windowDidChangeTheme]; 1483 [view windowDidChangeTheme];
1490 1484
1491 // TODO(andresantoso): Remove this once all themed views respond to 1485 // TODO(andresantoso): Remove this once all themed views respond to
1492 // windowDidChangeTheme above. 1486 // windowDidChangeTheme above.
(...skipping 535 matching lines...) Expand 10 before | Expand all | Expand 10 after
2028 2022
2029 - (NSRect)savedRegularWindowFrame { 2023 - (NSRect)savedRegularWindowFrame {
2030 return savedRegularWindowFrame_; 2024 return savedRegularWindowFrame_;
2031 } 2025 }
2032 2026
2033 - (BOOL)isFullscreenTransitionInProgress { 2027 - (BOOL)isFullscreenTransitionInProgress {
2034 return enteringAppKitFullscreen_ || exitingAppKitFullscreen_; 2028 return enteringAppKitFullscreen_ || exitingAppKitFullscreen_;
2035 } 2029 }
2036 2030
2037 @end // @implementation BrowserWindowController(WindowType) 2031 @end // @implementation BrowserWindowController(WindowType)
OLDNEW
« no previous file with comments | « no previous file | chrome/browser/ui/cocoa/browser_window_controller_browsertest.mm » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698