| OLD | NEW |
| 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 1007 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1018 if (manager) | 1018 if (manager) |
| 1019 manager->HideBubble(); | 1019 manager->HideBubble(); |
| 1020 } | 1020 } |
| 1021 | 1021 |
| 1022 if (newContents) { | 1022 if (newContents) { |
| 1023 manager = PermissionRequestManager::FromWebContents(newContents); | 1023 manager = PermissionRequestManager::FromWebContents(newContents); |
| 1024 if (manager) | 1024 if (manager) |
| 1025 manager->DisplayPendingRequests(); | 1025 manager->DisplayPendingRequests(); |
| 1026 } | 1026 } |
| 1027 | 1027 |
| 1028 // If the web contents want to focus on the location bar, do not call the | 1028 if ([self isInAnyFullscreenMode]) |
| 1029 // animation since the location bar will drop down when it's focused. | |
| 1030 bool willFocusLocationBar = | |
| 1031 newContents && newContents->FocusLocationBarByDefault(); | |
| 1032 if ([self isInAnyFullscreenMode] && !willFocusLocationBar) | |
| 1033 [[self fullscreenToolbarController] revealToolbarForTabStripChanges]; | 1029 [[self fullscreenToolbarController] revealToolbarForTabStripChanges]; |
| 1034 } | 1030 } |
| 1035 | 1031 |
| 1036 - (void)zoomChangedForActiveTab:(BOOL)canShowBubble { | 1032 - (void)zoomChangedForActiveTab:(BOOL)canShowBubble { |
| 1037 [toolbarController_ zoomChangedForActiveTab:canShowBubble]; | 1033 [toolbarController_ zoomChangedForActiveTab:canShowBubble]; |
| 1038 } | 1034 } |
| 1039 | 1035 |
| 1040 // Accept tabs from a BrowserWindowController with the same Profile. | 1036 // Accept tabs from a BrowserWindowController with the same Profile. |
| 1041 - (BOOL)canReceiveFrom:(TabWindowController*)source { | 1037 - (BOOL)canReceiveFrom:(TabWindowController*)source { |
| 1042 BrowserWindowController* realSource = | 1038 BrowserWindowController* realSource = |
| (...skipping 417 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1460 windowShim_->BookmarkBarStateChanged( | 1456 windowShim_->BookmarkBarStateChanged( |
| 1461 BookmarkBar::DONT_ANIMATE_STATE_CHANGE); | 1457 BookmarkBar::DONT_ANIMATE_STATE_CHANGE); |
| 1462 } | 1458 } |
| 1463 } | 1459 } |
| 1464 | 1460 |
| 1465 - (void)onTabDetachedWithContents:(WebContents*)contents { | 1461 - (void)onTabDetachedWithContents:(WebContents*)contents { |
| 1466 [infoBarContainerController_ tabDetachedWithContents:contents]; | 1462 [infoBarContainerController_ tabDetachedWithContents:contents]; |
| 1467 } | 1463 } |
| 1468 | 1464 |
| 1469 - (void)onTabInsertedInForeground:(BOOL)inForeground { | 1465 - (void)onTabInsertedInForeground:(BOOL)inForeground { |
| 1470 if ([self isInAnyFullscreenMode] && !inForeground && | 1466 if ([self isInAnyFullscreenMode] && !inForeground) |
| 1471 ![toolbarController_ isLocationBarFocused]) { | |
| 1472 [[self fullscreenToolbarController] revealToolbarForTabStripChanges]; | 1467 [[self fullscreenToolbarController] revealToolbarForTabStripChanges]; |
| 1473 } | |
| 1474 } | 1468 } |
| 1475 | 1469 |
| 1476 - (void)userChangedTheme { | 1470 - (void)userChangedTheme { |
| 1477 NSView* rootView = [[[self window] contentView] superview]; | 1471 NSView* rootView = [[[self window] contentView] superview]; |
| 1478 [rootView cr_recursivelyInvokeBlock:^(id view) { | 1472 [rootView cr_recursivelyInvokeBlock:^(id view) { |
| 1479 if ([view conformsToProtocol:@protocol(ThemedWindowDrawing)]) | 1473 if ([view conformsToProtocol:@protocol(ThemedWindowDrawing)]) |
| 1480 [view windowDidChangeTheme]; | 1474 [view windowDidChangeTheme]; |
| 1481 | 1475 |
| 1482 // TODO(andresantoso): Remove this once all themed views respond to | 1476 // TODO(andresantoso): Remove this once all themed views respond to |
| 1483 // windowDidChangeTheme above. | 1477 // windowDidChangeTheme above. |
| (...skipping 529 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 2013 | 2007 |
| 2014 - (NSRect)savedRegularWindowFrame { | 2008 - (NSRect)savedRegularWindowFrame { |
| 2015 return savedRegularWindowFrame_; | 2009 return savedRegularWindowFrame_; |
| 2016 } | 2010 } |
| 2017 | 2011 |
| 2018 - (BOOL)isFullscreenTransitionInProgress { | 2012 - (BOOL)isFullscreenTransitionInProgress { |
| 2019 return enteringAppKitFullscreen_ || exitingAppKitFullscreen_; | 2013 return enteringAppKitFullscreen_ || exitingAppKitFullscreen_; |
| 2020 } | 2014 } |
| 2021 | 2015 |
| 2022 @end // @implementation BrowserWindowController(WindowType) | 2016 @end // @implementation BrowserWindowController(WindowType) |
| OLD | NEW |