Chromium Code Reviews| Index: chrome/browser/ui/cocoa/browser_window_controller.mm |
| diff --git a/chrome/browser/ui/cocoa/browser_window_controller.mm b/chrome/browser/ui/cocoa/browser_window_controller.mm |
| index 4ab8af89a5846f6f22131b898c78520a55fe9f89..af7b00c4b7b9828691334630823ec8feb8df2c39 100644 |
| --- a/chrome/browser/ui/cocoa/browser_window_controller.mm |
| +++ b/chrome/browser/ui/cocoa/browser_window_controller.mm |
| @@ -1028,6 +1028,13 @@ bool IsTabDetachingInFullscreenEnabled() { |
| if (manager) |
| manager->DisplayPendingRequests(); |
| } |
| + |
| + // If the web contents want to focus on the location bar, do not call the |
| + // animation since the location bar will drop down when it's focused. |
| + bool willFocusLocationBar = |
| + newContents && newContents->FocusLocationBarByDefault(); |
| + if ([self isInAnyFullscreenMode] && !willFocusLocationBar) |
| + [[self presentationModeController] revealToolbarForTabStripChanges]; |
| } |
| - (void)zoomChangedForActiveTab:(BOOL)canShowBubble { |
| @@ -1476,6 +1483,13 @@ bool IsTabDetachingInFullscreenEnabled() { |
| [infoBarContainerController_ tabDetachedWithContents:contents]; |
| } |
| +- (void)onTabInsertedInForeground:(BOOL)inForeground { |
| + if ([self isInAnyFullscreenMode] && !inForeground && |
| + ![toolbarController_ isLocationBarFocused]) { |
| + [[self presentationModeController] revealToolbarForTabStripChanges]; |
| + } |
| +} |
| + |
| - (void)userChangedTheme { |
| NSView* rootView = [[[self window] contentView] superview]; |
| [rootView cr_recursivelyInvokeBlock:^(id view) { |
| @@ -1824,6 +1838,10 @@ willAnimateFromState:(BookmarkBar::State)oldState |
| return presentationModeController_.get(); |
| } |
| +- (void)setPresentationModeController:(PresentationModeController*)controller { |
| + presentationModeController_.reset(controller); |
|
Robert Sesek
2016/06/28 23:11:26
Since you're taking ownership, I'd make the argume
spqchan
2016/06/29 00:35:50
Done.
|
| +} |
| + |
| - (void)executeExtensionCommand:(const std::string&)extension_id |
| command:(const extensions::Command&)command { |
| // Global commands are handled by the ExtensionCommandsGlobalRegistry |