| OLD | NEW |
| 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 #include "base/command_line.h" | 9 #include "base/command_line.h" |
| 10 #import "base/mac/scoped_nsobject.h" | 10 #import "base/mac/scoped_nsobject.h" |
| 11 #include "base/prefs/pref_service.h" | 11 #include "base/prefs/pref_service.h" |
| 12 #include "chrome/browser/browser_process.h" | 12 #include "chrome/browser/browser_process.h" |
| 13 #include "chrome/browser/prefs/scoped_user_pref_update.h" | 13 #include "chrome/browser/prefs/scoped_user_pref_update.h" |
| 14 #include "chrome/browser/profiles/profile.h" | 14 #include "chrome/browser/profiles/profile.h" |
| 15 #include "chrome/browser/profiles/profile_info_util.h" | 15 #include "chrome/browser/profiles/profile_info_util.h" |
| 16 #include "chrome/browser/search/search.h" | |
| 17 #include "chrome/browser/ui/bookmarks/bookmark_tab_helper.h" | 16 #include "chrome/browser/ui/bookmarks/bookmark_tab_helper.h" |
| 18 #include "chrome/browser/ui/browser.h" | 17 #include "chrome/browser/ui/browser.h" |
| 19 #include "chrome/browser/ui/browser_window_state.h" | 18 #include "chrome/browser/ui/browser_window_state.h" |
| 20 #import "chrome/browser/ui/cocoa/browser/avatar_button_controller.h" | 19 #import "chrome/browser/ui/cocoa/browser/avatar_button_controller.h" |
| 21 #import "chrome/browser/ui/cocoa/dev_tools_controller.h" | 20 #import "chrome/browser/ui/cocoa/dev_tools_controller.h" |
| 22 #import "chrome/browser/ui/cocoa/fast_resize_view.h" | 21 #import "chrome/browser/ui/cocoa/fast_resize_view.h" |
| 23 #import "chrome/browser/ui/cocoa/find_bar/find_bar_cocoa_controller.h" | 22 #import "chrome/browser/ui/cocoa/find_bar/find_bar_cocoa_controller.h" |
| 24 #import "chrome/browser/ui/cocoa/floating_bar_backing_view.h" | 23 #import "chrome/browser/ui/cocoa/floating_bar_backing_view.h" |
| 25 #import "chrome/browser/ui/cocoa/framed_browser_window.h" | 24 #import "chrome/browser/ui/cocoa/framed_browser_window.h" |
| 26 #import "chrome/browser/ui/cocoa/fullscreen_window.h" | 25 #import "chrome/browser/ui/cocoa/fullscreen_window.h" |
| 27 #import "chrome/browser/ui/cocoa/infobars/infobar_container_controller.h" | 26 #import "chrome/browser/ui/cocoa/infobars/infobar_container_controller.h" |
| 28 #include "chrome/browser/ui/cocoa/last_active_browser_cocoa.h" | 27 #include "chrome/browser/ui/cocoa/last_active_browser_cocoa.h" |
| 29 #import "chrome/browser/ui/cocoa/nsview_additions.h" | 28 #import "chrome/browser/ui/cocoa/nsview_additions.h" |
| 30 #import "chrome/browser/ui/cocoa/presentation_mode_controller.h" | 29 #import "chrome/browser/ui/cocoa/presentation_mode_controller.h" |
| 31 #import "chrome/browser/ui/cocoa/status_bubble_mac.h" | 30 #import "chrome/browser/ui/cocoa/status_bubble_mac.h" |
| 32 #import "chrome/browser/ui/cocoa/tab_contents/overlayable_contents_controller.h" | 31 #import "chrome/browser/ui/cocoa/tab_contents/overlayable_contents_controller.h" |
| 33 #import "chrome/browser/ui/cocoa/tabs/tab_strip_controller.h" | 32 #import "chrome/browser/ui/cocoa/tabs/tab_strip_controller.h" |
| 34 #import "chrome/browser/ui/cocoa/tabs/tab_strip_view.h" | 33 #import "chrome/browser/ui/cocoa/tabs/tab_strip_view.h" |
| 35 #import "chrome/browser/ui/cocoa/toolbar/toolbar_controller.h" | 34 #import "chrome/browser/ui/cocoa/toolbar/toolbar_controller.h" |
| 36 #include "chrome/browser/ui/fullscreen/fullscreen_controller.h" | 35 #include "chrome/browser/ui/fullscreen/fullscreen_controller.h" |
| 37 #include "chrome/browser/ui/search/search_model.h" | |
| 38 #include "chrome/browser/ui/search/search_ui.h" | |
| 39 #include "chrome/browser/ui/tabs/tab_strip_model.h" | 36 #include "chrome/browser/ui/tabs/tab_strip_model.h" |
| 40 #include "chrome/common/chrome_switches.h" | 37 #include "chrome/common/chrome_switches.h" |
| 41 #include "chrome/common/pref_names.h" | 38 #include "chrome/common/pref_names.h" |
| 42 #include "content/public/browser/render_widget_host_view.h" | 39 #include "content/public/browser/render_widget_host_view.h" |
| 43 #include "content/public/browser/web_contents.h" | 40 #include "content/public/browser/web_contents.h" |
| 44 #include "content/public/browser/web_contents_view.h" | 41 #include "content/public/browser/web_contents_view.h" |
| 45 #import "ui/base/cocoa/focus_tracker.h" | 42 #import "ui/base/cocoa/focus_tracker.h" |
| 46 #include "ui/base/ui_base_types.h" | 43 #include "ui/base/ui_base_types.h" |
| 47 | 44 |
| 48 using content::RenderWidgetHostView; | 45 using content::RenderWidgetHostView; |
| (...skipping 158 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 207 maxY = [self layoutTabStripAtMaxY:maxY | 204 maxY = [self layoutTabStripAtMaxY:maxY |
| 208 width:width | 205 width:width |
| 209 fullscreen:[self isFullscreen]]; | 206 fullscreen:[self isFullscreen]]; |
| 210 } | 207 } |
| 211 | 208 |
| 212 // Sanity-check |maxY|. | 209 // Sanity-check |maxY|. |
| 213 DCHECK_GE(maxY, minY); | 210 DCHECK_GE(maxY, minY); |
| 214 DCHECK_LE(maxY, NSMaxY(contentBounds) + yOffset); | 211 DCHECK_LE(maxY, NSMaxY(contentBounds) + yOffset); |
| 215 | 212 |
| 216 // Place the toolbar at the top of the reserved area. | 213 // Place the toolbar at the top of the reserved area. |
| 217 CGFloat toolbarTopY = maxY; | |
| 218 maxY = [self layoutToolbarAtMinX:minX maxY:maxY width:width]; | 214 maxY = [self layoutToolbarAtMinX:minX maxY:maxY width:width]; |
| 219 | 215 |
| 220 // If we're not displaying the bookmark bar below the info bar, then it goes | 216 // If we're not displaying the bookmark bar below the info bar, then it goes |
| 221 // immediately below the toolbar. | 217 // immediately below the toolbar. |
| 222 BOOL placeBookmarkBarBelowInfoBar = [self placeBookmarkBarBelowInfoBar]; | 218 BOOL placeBookmarkBarBelowInfoBar = [self placeBookmarkBarBelowInfoBar]; |
| 223 if (!placeBookmarkBarBelowInfoBar) | 219 if (!placeBookmarkBarBelowInfoBar) |
| 224 maxY = [self layoutBookmarkBarAtMinX:minX maxY:maxY width:width]; | 220 maxY = [self layoutBookmarkBarAtMinX:minX maxY:maxY width:width]; |
| 225 CGFloat toolbarBottomY = maxY; | |
| 226 | 221 |
| 227 // The floating bar backing view doesn't actually add any height. | 222 // The floating bar backing view doesn't actually add any height. |
| 228 NSRect floatingBarBackingRect = | 223 NSRect floatingBarBackingRect = |
| 229 NSMakeRect(minX, maxY, width, floatingBarHeight); | 224 NSMakeRect(minX, maxY, width, floatingBarHeight); |
| 230 [self layoutFloatingBarBackingView:floatingBarBackingRect | 225 [self layoutFloatingBarBackingView:floatingBarBackingRect |
| 231 presentationMode:inPresentationMode]; | 226 presentationMode:inPresentationMode]; |
| 232 | 227 |
| 233 [fullscreenExitBubbleController_ positionInWindowAtTop:toolbarBottomY | 228 // Place the find bar immediately below the toolbar/attached bookmark bar. In |
| 234 width:width]; | 229 // presentation mode, it hangs off the top of the screen when the bar is |
| 230 // hidden. |
| 231 [findBarCocoaController_ positionFindBarViewAtMaxY:maxY maxWidth:width]; |
| 232 [fullscreenExitBubbleController_ positionInWindowAtTop:maxY width:width]; |
| 235 | 233 |
| 236 // If in presentation mode, reset |maxY| to top of screen, so that the | 234 // If in presentation mode, reset |maxY| to top of screen, so that the |
| 237 // floating bar slides over the things which appear to be in the content area. | 235 // floating bar slides over the things which appear to be in the content area. |
| 238 if (inPresentationMode) | 236 if (inPresentationMode) |
| 239 maxY = NSMaxY(contentBounds); | 237 maxY = NSMaxY(contentBounds); |
| 240 | 238 |
| 241 // Also place the info bar container immediate below the toolbar, except in | 239 // Also place the info bar container immediate below the toolbar, except in |
| 242 // presentation mode in which case it's at the top of the visual content area. | 240 // presentation mode in which case it's at the top of the visual content area. |
| 243 maxY = [self layoutInfoBarAtMinX:minX maxY:maxY width:width]; | 241 maxY = [self layoutInfoBarAtMinX:minX maxY:maxY width:width]; |
| 244 | 242 |
| 243 // If the bookmark bar is detached, place it next in the visual content area. |
| 244 if (placeBookmarkBarBelowInfoBar) |
| 245 maxY = [self layoutBookmarkBarAtMinX:minX maxY:maxY width:width]; |
| 246 |
| 245 // Place the download shelf, if any, at the bottom of the view. | 247 // Place the download shelf, if any, at the bottom of the view. |
| 246 minY = [self layoutDownloadShelfAtMinX:minX minY:minY width:width]; | 248 minY = [self layoutDownloadShelfAtMinX:minX minY:minY width:width]; |
| 247 | 249 |
| 248 // Place the bookmark bar. | 250 // Finally, the content area takes up all of the remaining space. |
| 249 if (placeBookmarkBarBelowInfoBar) | 251 NSRect contentAreaRect = NSMakeRect(minX, minY, width, maxY - minY); |
| 250 maxY = [self layoutBookmarkBarAtMinX:minX maxY:maxY width:width]; | |
| 251 | |
| 252 // In presentation mode the content area takes up all the remaining space | |
| 253 // (from the bottom of the info bar down). In normal mode the content area | |
| 254 // takes up the space between the bottom of the toolbar down. | |
| 255 CGFloat contentAreaTop = 0; | |
| 256 if (inPresentationMode) { | |
| 257 // The tabContentaArea starts at the bottom of the info bar (or top of the | |
| 258 // screen if there's no info bar). | |
| 259 contentAreaTop = maxY; | |
| 260 CGFloat floatingBarHeight = | |
| 261 NSHeight(floatingBarBackingRect) * [self floatingBarShownFraction]; | |
| 262 // When an instant overlay is shown this is the amount it needs to be pushed | |
| 263 // down so that it doesn't get covered by the floating toolbar. | |
| 264 toolbarToWebContentsOffset_ = | |
| 265 floatingBarHeight - (NSMaxY(contentBounds) - maxY); | |
| 266 } else { | |
| 267 // The tabContentArea view starts below the omnibox. | |
| 268 CGFloat minToolbarHeight = 0; | |
| 269 if ([self hasToolbar]) { | |
| 270 // 1 to account for the toolbar separator. | |
| 271 minToolbarHeight = [toolbarController_ desiredHeightForCompression:1]; | |
| 272 } | |
| 273 contentAreaTop = toolbarTopY - minToolbarHeight; | |
| 274 // This is the space between the bottom of the omnibox and the bottom of the | |
| 275 // last bar (info bar or bookmark bar or toolbar). This is used to push the | |
| 276 // tab web content down when no instant overlay is shown. | |
| 277 toolbarToWebContentsOffset_ = contentAreaTop - maxY; | |
| 278 } | |
| 279 [self updateContentOffsets]; | |
| 280 | |
| 281 // Place the find bar immediately below the toolbar/attached bookmark bar. In | |
| 282 // presentation mode, it hangs off the top of the screen when the bar is | |
| 283 // hidden. | |
| 284 if ([self currentInstantUIState] == | |
| 285 browser_window_controller::kInstantUIFullPageResults) { | |
| 286 [findBarCocoaController_ positionFindBarViewAtMaxY:contentAreaTop - 1 | |
| 287 maxWidth:width]; | |
| 288 } else { | |
| 289 [findBarCocoaController_ positionFindBarViewAtMaxY:toolbarBottomY | |
| 290 maxWidth:width]; | |
| 291 } | |
| 292 | |
| 293 NSRect contentAreaRect = NSMakeRect(minX, minY, width, contentAreaTop - minY); | |
| 294 [self layoutTabContentArea:contentAreaRect]; | 252 [self layoutTabContentArea:contentAreaRect]; |
| 295 | 253 |
| 296 // Normally, we don't need to tell the toolbar whether or not to show the | 254 // Normally, we don't need to tell the toolbar whether or not to show the |
| 297 // divider, but things break down during animation. | 255 // divider, but things break down during animation. |
| 298 [toolbarController_ setDividerOpacity:[self toolbarDividerOpacity]]; | 256 [toolbarController_ setDividerOpacity:[self toolbarDividerOpacity]]; |
| 299 } | 257 } |
| 300 | 258 |
| 301 - (CGFloat)floatingBarHeight { | 259 - (CGFloat)floatingBarHeight { |
| 302 if (![self inPresentationMode]) | 260 if (![self inPresentationMode]) |
| 303 return 0; | 261 return 0; |
| (...skipping 573 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 877 return; | 835 return; |
| 878 | 836 |
| 879 barVisibilityUpdatesEnabled_ = NO; | 837 barVisibilityUpdatesEnabled_ = NO; |
| 880 [presentationModeController_ cancelAnimationAndTimers]; | 838 [presentationModeController_ cancelAnimationAndTimers]; |
| 881 } | 839 } |
| 882 | 840 |
| 883 - (CGFloat)toolbarDividerOpacity { | 841 - (CGFloat)toolbarDividerOpacity { |
| 884 return [bookmarkBarController_ toolbarDividerOpacity]; | 842 return [bookmarkBarController_ toolbarDividerOpacity]; |
| 885 } | 843 } |
| 886 | 844 |
| 887 - (browser_window_controller::InstantUIState)currentInstantUIState { | |
| 888 if (!browser_->search_model()->mode().is_search()) | |
| 889 return browser_window_controller::kInstantUINone; | |
| 890 | |
| 891 // If the search suggestions are already being displayed in the overlay | |
| 892 // contents then return kInstantUIOverlay. | |
| 893 if ([overlayableContentsController_ isShowingOverlay]) | |
| 894 return browser_window_controller::kInstantUIOverlay; | |
| 895 | |
| 896 if (browser_->search_model()->top_bars_visible()) | |
| 897 return browser_window_controller::kInstantUINone; | |
| 898 | |
| 899 return browser_window_controller::kInstantUIFullPageResults; | |
| 900 } | |
| 901 | |
| 902 - (void)updateContentOffsets { | |
| 903 if ([self inPresentationMode]) { | |
| 904 // In presentation mode the tabContentArea starts at the bottom of the info | |
| 905 // bar (or top of the screen if there's no info bar). | |
| 906 if ([self currentInstantUIState] != | |
| 907 browser_window_controller::kInstantUIFullPageResults) { | |
| 908 // Normal mode, keep the tab web contents at the top (below the info bar). | |
| 909 [overlayableContentsController_ setActiveContainerOffset:0]; | |
| 910 } else { | |
| 911 // Instant suggestions are displayed in the main tab contents so push that | |
| 912 // down so that the floating toolbar doesn't obscure it. | |
| 913 [overlayableContentsController_ | |
| 914 setActiveContainerOffset:toolbarToWebContentsOffset_]; | |
| 915 } | |
| 916 // Floating overlay (if any) should also be below the floating toolbar. | |
| 917 [overlayableContentsController_ | |
| 918 setOverlayContentsOffset:toolbarToWebContentsOffset_]; | |
| 919 | |
| 920 [[self tabContentArea] setContentOffset:0]; | |
| 921 [devToolsController_ setTopContentOffset:0]; | |
| 922 } else { | |
| 923 // In normal mode the tabContentArea starts just below the omnibox and the | |
| 924 // bookmark bar and info bar overlap it. | |
| 925 if ([self currentInstantUIState] != | |
| 926 browser_window_controller::kInstantUIFullPageResults) { | |
| 927 // Normal mode, push the tab web contents down so that it doesn't obscure | |
| 928 // the bookmark bar and info bar. | |
| 929 [overlayableContentsController_ | |
| 930 setActiveContainerOffset:toolbarToWebContentsOffset_]; | |
| 931 } else { | |
| 932 // Instant suggestions are displayed in the main tab contents so don't | |
| 933 // push it down (keep it next to the omnibox). | |
| 934 [overlayableContentsController_ setActiveContainerOffset:0]; | |
| 935 } | |
| 936 // Floating overlay (if any) should also be at the top (next to the | |
| 937 // omnibox). | |
| 938 [overlayableContentsController_ setOverlayContentsOffset:0]; | |
| 939 | |
| 940 // Prevent the fast resize view from drawing white over the bookmark bar. | |
| 941 [[self tabContentArea] setContentOffset:toolbarToWebContentsOffset_]; | |
| 942 // Prevent the dev tools splitter from overlapping the bookmark bar. | |
| 943 if ([self currentInstantUIState] != | |
| 944 browser_window_controller::kInstantUINone) { | |
| 945 [devToolsController_ setTopContentOffset:0]; | |
| 946 } else { | |
| 947 [devToolsController_ setTopContentOffset:toolbarToWebContentsOffset_]; | |
| 948 } | |
| 949 } | |
| 950 } | |
| 951 | |
| 952 - (void)updateSubviewZOrder:(BOOL)inPresentationMode { | 845 - (void)updateSubviewZOrder:(BOOL)inPresentationMode { |
| 953 NSView* contentView = [[self window] contentView]; | 846 NSView* contentView = [[self window] contentView]; |
| 954 NSView* toolbarView = [toolbarController_ view]; | 847 NSView* toolbarView = [toolbarController_ view]; |
| 955 | 848 |
| 956 if (inPresentationMode) { | 849 if (inPresentationMode) { |
| 957 // Toolbar is above tab contents so that it can slide down from top of | 850 // Toolbar is above tab contents so that it can slide down from top of |
| 958 // screen. | 851 // screen. |
| 959 [contentView cr_ensureSubview:toolbarView | 852 [contentView cr_ensureSubview:toolbarView |
| 960 isPositioned:NSWindowAbove | 853 isPositioned:NSWindowAbove |
| 961 relativeTo:[self tabContentArea]]; | 854 relativeTo:[self tabContentArea]]; |
| 962 } else { | 855 } else { |
| 963 // Toolbar is below tab contents so that the infob ar arrow can appear above | 856 // Toolbar is below tab contents so that the info bar arrow can appear above |
| 964 // it. Unlike other views the toolbar never overlaps the actual web | 857 // it. |
| 965 // content. | |
| 966 [contentView cr_ensureSubview:toolbarView | 858 [contentView cr_ensureSubview:toolbarView |
| 967 isPositioned:NSWindowBelow | 859 isPositioned:NSWindowBelow |
| 968 relativeTo:[self tabContentArea]]; | 860 relativeTo:[self tabContentArea]]; |
| 969 } | 861 } |
| 970 | 862 |
| 971 // The bookmark bar is always below the toolbar. In normal mode this means | 863 // The bookmark bar is always below the toolbar. |
| 972 // that it is below tab contents. This allows Instant results to be above | |
| 973 // the bookmark bar. | |
| 974 [contentView cr_ensureSubview:[bookmarkBarController_ view] | 864 [contentView cr_ensureSubview:[bookmarkBarController_ view] |
| 975 isPositioned:NSWindowBelow | 865 isPositioned:NSWindowBelow |
| 976 relativeTo:toolbarView]; | 866 relativeTo:toolbarView]; |
| 977 | 867 |
| 978 if (inPresentationMode) { | 868 if (inPresentationMode) { |
| 979 // In presentation mode the info bar is below all other views. | 869 // In presentation mode the info bar is below all other views. |
| 980 [contentView cr_ensureSubview:[infoBarContainerController_ view] | 870 [contentView cr_ensureSubview:[infoBarContainerController_ view] |
| 981 isPositioned:NSWindowBelow | 871 isPositioned:NSWindowBelow |
| 982 relativeTo:[self tabContentArea]]; | 872 relativeTo:[self tabContentArea]]; |
| 983 } else { | 873 } else { |
| 984 // Above the toolbar but still below tab contents. Similar to the bookmark | 874 // Above the toolbar but still below tab contents. Similar to the bookmark |
| 985 // bar, this allows Instant results to be above the info bar. | 875 // bar, this allows Instant results to be above the info bar. |
| 986 [contentView cr_ensureSubview:[infoBarContainerController_ view] | 876 [contentView cr_ensureSubview:[infoBarContainerController_ view] |
| 987 isPositioned:NSWindowAbove | 877 isPositioned:NSWindowAbove |
| 988 relativeTo:toolbarView]; | 878 relativeTo:toolbarView]; |
| 989 } | 879 } |
| 990 | 880 |
| 991 // The find bar is above everything except Instant search results. | 881 // The find bar is above everything. |
| 992 if (findBarCocoaController_) { | 882 if (findBarCocoaController_) { |
| 993 NSView* relativeView = nil; | 883 NSView* relativeView = nil; |
| 994 if (inPresentationMode) { | 884 if (inPresentationMode) |
| 995 relativeView = toolbarView; | 885 relativeView = toolbarView; |
| 996 } else if ([self currentInstantUIState] == | 886 else |
| 997 browser_window_controller::kInstantUIOverlay) { | |
| 998 relativeView = [infoBarContainerController_ view]; | |
| 999 } else { | |
| 1000 relativeView = [self tabContentArea]; | 887 relativeView = [self tabContentArea]; |
| 1001 } | |
| 1002 [contentView cr_ensureSubview:[findBarCocoaController_ view] | 888 [contentView cr_ensureSubview:[findBarCocoaController_ view] |
| 1003 isPositioned:NSWindowAbove | 889 isPositioned:NSWindowAbove |
| 1004 relativeTo:relativeView]; | 890 relativeTo:relativeView]; |
| 1005 } | 891 } |
| 1006 | 892 |
| 1007 if (floatingBarBackingView_) { | 893 if (floatingBarBackingView_) { |
| 1008 if ([floatingBarBackingView_ cr_isBelowView:[self tabContentArea]]) | 894 if ([floatingBarBackingView_ cr_isBelowView:[self tabContentArea]]) |
| 1009 [floatingBarBackingView_ removeFromSuperview]; | 895 [floatingBarBackingView_ removeFromSuperview]; |
| 1010 if ([self placeBookmarkBarBelowInfoBar]) { | 896 if ([self placeBookmarkBarBelowInfoBar]) { |
| 1011 [contentView cr_ensureSubview:floatingBarBackingView_ | 897 [contentView cr_ensureSubview:floatingBarBackingView_ |
| (...skipping 41 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1053 | 939 |
| 1054 DevToolsWindow* devToolsWindow = | 940 DevToolsWindow* devToolsWindow = |
| 1055 DevToolsWindow::GetDockedInstanceForInspectedTab(contents); | 941 DevToolsWindow::GetDockedInstanceForInspectedTab(contents); |
| 1056 if (devToolsWindow) { | 942 if (devToolsWindow) { |
| 1057 devToolsWindow->web_contents()->GetView()-> | 943 devToolsWindow->web_contents()->GetView()-> |
| 1058 SetAllowOverlappingViews(allowOverlappingViews); | 944 SetAllowOverlappingViews(allowOverlappingViews); |
| 1059 } | 945 } |
| 1060 } | 946 } |
| 1061 | 947 |
| 1062 - (void)updateInfoBarTipVisibility { | 948 - (void)updateInfoBarTipVisibility { |
| 1063 // If the overlay is open or if there's no toolbar then hide the infobar tip. | 949 // If there's no toolbar then hide the infobar tip. |
| 1064 BOOL suppressInfoBarTip = | |
| 1065 [self currentInstantUIState] != | |
| 1066 browser_window_controller::kInstantUINone || ![self hasToolbar]; | |
| 1067 [infoBarContainerController_ | 950 [infoBarContainerController_ |
| 1068 setShouldSuppressTopInfoBarTip:suppressInfoBarTip]; | 951 setShouldSuppressTopInfoBarTip:![self hasToolbar]]; |
| 1069 } | 952 } |
| 1070 | 953 |
| 1071 - (browser_window_controller::CoreAnimationStatus)coreAnimationStatus { | 954 - (browser_window_controller::CoreAnimationStatus)coreAnimationStatus { |
| 1072 // TODO(sail) Remove this. | 955 // TODO(sail) Remove this. |
| 1073 if (!CommandLine::ForCurrentProcess()->HasSwitch( | 956 if (!CommandLine::ForCurrentProcess()->HasSwitch( |
| 1074 switches::kUseCoreAnimation)) { | 957 switches::kUseCoreAnimation)) { |
| 1075 return browser_window_controller::kCoreAnimationEnabledLazy; | 958 return browser_window_controller::kCoreAnimationEnabledLazy; |
| 1076 } | 959 } |
| 1077 if (CommandLine::ForCurrentProcess()->GetSwitchValueASCII( | 960 if (CommandLine::ForCurrentProcess()->GetSwitchValueASCII( |
| 1078 switches::kUseCoreAnimation) == "lazy") { | 961 switches::kUseCoreAnimation) == "lazy") { |
| 1079 return browser_window_controller::kCoreAnimationEnabledLazy; | 962 return browser_window_controller::kCoreAnimationEnabledLazy; |
| 1080 } | 963 } |
| 1081 if (CommandLine::ForCurrentProcess()->GetSwitchValueASCII( | 964 if (CommandLine::ForCurrentProcess()->GetSwitchValueASCII( |
| 1082 switches::kUseCoreAnimation) == "disabled") { | 965 switches::kUseCoreAnimation) == "disabled") { |
| 1083 return browser_window_controller::kCoreAnimationDisabled; | 966 return browser_window_controller::kCoreAnimationDisabled; |
| 1084 } | 967 } |
| 1085 return browser_window_controller::kCoreAnimationEnabledAlways; | 968 return browser_window_controller::kCoreAnimationEnabledAlways; |
| 1086 } | 969 } |
| 1087 | 970 |
| 1088 @end // @implementation BrowserWindowController(Private) | 971 @end // @implementation BrowserWindowController(Private) |
| OLD | NEW |