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

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

Issue 2086273003: [Mac] Reveal Fullscreen Toolbar for Tab Strip Changes (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Fixed test Created 4 years, 6 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 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 1011 matching lines...) Expand 10 before | Expand all | Expand 10 after
1022 manager = PermissionBubbleManager::FromWebContents(oldContents); 1022 manager = PermissionBubbleManager::FromWebContents(oldContents);
1023 if (manager) 1023 if (manager)
1024 manager->HideBubble(); 1024 manager->HideBubble();
1025 } 1025 }
1026 1026
1027 if (newContents) { 1027 if (newContents) {
1028 manager = PermissionBubbleManager::FromWebContents(newContents); 1028 manager = PermissionBubbleManager::FromWebContents(newContents);
1029 if (manager) 1029 if (manager)
1030 manager->DisplayPendingRequests(); 1030 manager->DisplayPendingRequests();
1031 } 1031 }
1032
1033 // If the web contents want to focus on the location bar, do not call the
1034 // animation since the location bar will drop down when it's focused.
1035 bool will_focus_location_bar =
Robert Sesek 2016/06/23 14:08:24 naming: camelCase
spqchan 2016/06/23 19:41:52 Done.
1036 newContents && newContents->FocusLocationBarByDefault();
1037 if ([self isInAnyFullscreenMode] && !will_focus_location_bar)
1038 [[self presentationModeController] revealToolbarForTabStripChanges];
1032 } 1039 }
1033 1040
1034 - (void)zoomChangedForActiveTab:(BOOL)canShowBubble { 1041 - (void)zoomChangedForActiveTab:(BOOL)canShowBubble {
1035 [toolbarController_ zoomChangedForActiveTab:canShowBubble]; 1042 [toolbarController_ zoomChangedForActiveTab:canShowBubble];
1036 } 1043 }
1037 1044
1038 // Return the rect, in WebKit coordinates (flipped), of the window's grow box 1045 // Return the rect, in WebKit coordinates (flipped), of the window's grow box
1039 // in the coordinate system of the content area of the currently selected tab. 1046 // in the coordinate system of the content area of the currently selected tab.
1040 // |windowGrowBox| needs to be in the window's coordinate system. 1047 // |windowGrowBox| needs to be in the window's coordinate system.
1041 - (NSRect)selectedTabGrowBoxRect { 1048 - (NSRect)selectedTabGrowBoxRect {
(...skipping 428 matching lines...) Expand 10 before | Expand all | Expand 10 after
1470 if (change != TabStripModelObserver::TITLE_NOT_LOADING) { 1477 if (change != TabStripModelObserver::TITLE_NOT_LOADING) {
1471 windowShim_->BookmarkBarStateChanged( 1478 windowShim_->BookmarkBarStateChanged(
1472 BookmarkBar::DONT_ANIMATE_STATE_CHANGE); 1479 BookmarkBar::DONT_ANIMATE_STATE_CHANGE);
1473 } 1480 }
1474 } 1481 }
1475 1482
1476 - (void)onTabDetachedWithContents:(WebContents*)contents { 1483 - (void)onTabDetachedWithContents:(WebContents*)contents {
1477 [infoBarContainerController_ tabDetachedWithContents:contents]; 1484 [infoBarContainerController_ tabDetachedWithContents:contents];
1478 } 1485 }
1479 1486
1487 - (void)onTabInsertedInForeground:(BOOL)inForeground {
1488 if ([self isInAnyFullscreenMode] && !inForeground)
1489 [[self presentationModeController] revealToolbarForTabStripChanges];
1490 }
1491
1480 - (void)userChangedTheme { 1492 - (void)userChangedTheme {
1481 NSView* rootView = [[[self window] contentView] superview]; 1493 NSView* rootView = [[[self window] contentView] superview];
1482 [rootView cr_recursivelyInvokeBlock:^(id view) { 1494 [rootView cr_recursivelyInvokeBlock:^(id view) {
1483 if ([view conformsToProtocol:@protocol(ThemedWindowDrawing)]) 1495 if ([view conformsToProtocol:@protocol(ThemedWindowDrawing)])
1484 [view windowDidChangeTheme]; 1496 [view windowDidChangeTheme];
1485 1497
1486 // TODO(andresantoso): Remove this once all themed views respond to 1498 // TODO(andresantoso): Remove this once all themed views respond to
1487 // windowDidChangeTheme above. 1499 // windowDidChangeTheme above.
1488 [view setNeedsDisplay:YES]; 1500 [view setNeedsDisplay:YES];
1489 }]; 1501 }];
(...skipping 566 matching lines...) Expand 10 before | Expand all | Expand 10 after
2056 2068
2057 - (BOOL)isTabbedWindow { 2069 - (BOOL)isTabbedWindow {
2058 return browser_->is_type_tabbed(); 2070 return browser_->is_type_tabbed();
2059 } 2071 }
2060 2072
2061 - (NSRect)savedRegularWindowFrame { 2073 - (NSRect)savedRegularWindowFrame {
2062 return savedRegularWindowFrame_; 2074 return savedRegularWindowFrame_;
2063 } 2075 }
2064 2076
2065 @end // @implementation BrowserWindowController(WindowType) 2077 @end // @implementation BrowserWindowController(WindowType)
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698