| 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 #import "base/auto_reset.h" | 9 #import "base/auto_reset.h" |
| 10 #include "base/command_line.h" | 10 #include "base/command_line.h" |
| (...skipping 35 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 46 #import "chrome/browser/ui/cocoa/tabs/tab_strip_view.h" | 46 #import "chrome/browser/ui/cocoa/tabs/tab_strip_view.h" |
| 47 #import "chrome/browser/ui/cocoa/toolbar/toolbar_controller.h" | 47 #import "chrome/browser/ui/cocoa/toolbar/toolbar_controller.h" |
| 48 #import "chrome/browser/ui/cocoa/website_settings/permission_bubble_cocoa.h" | 48 #import "chrome/browser/ui/cocoa/website_settings/permission_bubble_cocoa.h" |
| 49 #include "chrome/browser/ui/exclusive_access/fullscreen_controller.h" | 49 #include "chrome/browser/ui/exclusive_access/fullscreen_controller.h" |
| 50 #include "chrome/browser/ui/tabs/tab_strip_model.h" | 50 #include "chrome/browser/ui/tabs/tab_strip_model.h" |
| 51 #include "chrome/common/chrome_switches.h" | 51 #include "chrome/common/chrome_switches.h" |
| 52 #include "components/prefs/pref_service.h" | 52 #include "components/prefs/pref_service.h" |
| 53 #include "components/prefs/scoped_user_pref_update.h" | 53 #include "components/prefs/scoped_user_pref_update.h" |
| 54 #include "content/public/browser/render_widget_host_view.h" | 54 #include "content/public/browser/render_widget_host_view.h" |
| 55 #include "content/public/browser/web_contents.h" | 55 #include "content/public/browser/web_contents.h" |
| 56 #include "ui/base/cocoa/appkit_utils.h" |
| 56 #import "ui/base/cocoa/focus_tracker.h" | 57 #import "ui/base/cocoa/focus_tracker.h" |
| 57 #import "ui/base/cocoa/nsview_additions.h" | 58 #import "ui/base/cocoa/nsview_additions.h" |
| 58 #include "ui/base/ui_base_types.h" | 59 #include "ui/base/ui_base_types.h" |
| 59 | 60 |
| 60 using content::RenderWidgetHostView; | 61 using content::RenderWidgetHostView; |
| 61 using content::WebContents; | 62 using content::WebContents; |
| 62 | 63 |
| 63 namespace { | 64 namespace { |
| 64 | 65 |
| 65 // The screen on which the window was fullscreened, and whether the device had | 66 // The screen on which the window was fullscreened, and whether the device had |
| (...skipping 893 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 959 if ([self tabContentArea]) | 960 if ([self tabContentArea]) |
| 960 [subviews addObject:[self tabContentArea]]; | 961 [subviews addObject:[self tabContentArea]]; |
| 961 if ([findBarCocoaController_ view]) | 962 if ([findBarCocoaController_ view]) |
| 962 [subviews addObject:[findBarCocoaController_ view]]; | 963 [subviews addObject:[findBarCocoaController_ view]]; |
| 963 | 964 |
| 964 [self setContentViewSubviews:subviews]; | 965 [self setContentViewSubviews:subviews]; |
| 965 } | 966 } |
| 966 | 967 |
| 967 - (void)updateSubviewZOrderFullscreen { | 968 - (void)updateSubviewZOrderFullscreen { |
| 968 base::scoped_nsobject<NSMutableArray> subviews([[NSMutableArray alloc] init]); | 969 base::scoped_nsobject<NSMutableArray> subviews([[NSMutableArray alloc] init]); |
| 970 |
| 971 // The infobar should overlay the toolbar if the toolbar is fully shown. |
| 972 FullscreenToolbarLayout layout = [fullscreenToolbarController_ computeLayout]; |
| 973 BOOL shouldInfoBarOverlayToolbar = |
| 974 ui::IsCGFloatEqual(layout.toolbarFraction, 1.0); |
| 975 |
| 969 if ([downloadShelfController_ view]) | 976 if ([downloadShelfController_ view]) |
| 970 [subviews addObject:[downloadShelfController_ view]]; | 977 [subviews addObject:[downloadShelfController_ view]]; |
| 971 if ([self tabContentArea]) | 978 if ([self tabContentArea]) |
| 972 [subviews addObject:[self tabContentArea]]; | 979 [subviews addObject:[self tabContentArea]]; |
| 973 if ([infoBarContainerController_ view]) | 980 |
| 981 if (!shouldInfoBarOverlayToolbar && [infoBarContainerController_ view]) |
| 974 [subviews addObject:[infoBarContainerController_ view]]; | 982 [subviews addObject:[infoBarContainerController_ view]]; |
| 983 |
| 975 if ([self placeBookmarkBarBelowInfoBar]) { | 984 if ([self placeBookmarkBarBelowInfoBar]) { |
| 976 if ([bookmarkBarController_ view]) | 985 if ([bookmarkBarController_ view]) |
| 977 [subviews addObject:[bookmarkBarController_ view]]; | 986 [subviews addObject:[bookmarkBarController_ view]]; |
| 978 if (floatingBarBackingView_) | 987 if (floatingBarBackingView_) |
| 979 [subviews addObject:floatingBarBackingView_]; | 988 [subviews addObject:floatingBarBackingView_]; |
| 980 } else { | 989 } else { |
| 981 if (floatingBarBackingView_) | 990 if (floatingBarBackingView_) |
| 982 [subviews addObject:floatingBarBackingView_]; | 991 [subviews addObject:floatingBarBackingView_]; |
| 983 if ([bookmarkBarController_ view]) | 992 if ([bookmarkBarController_ view]) |
| 984 [subviews addObject:[bookmarkBarController_ view]]; | 993 [subviews addObject:[bookmarkBarController_ view]]; |
| 985 } | 994 } |
| 995 |
| 986 if ([toolbarController_ view]) | 996 if ([toolbarController_ view]) |
| 987 [subviews addObject:[toolbarController_ view]]; | 997 [subviews addObject:[toolbarController_ view]]; |
| 998 |
| 999 if (shouldInfoBarOverlayToolbar && [infoBarContainerController_ view]) |
| 1000 [subviews addObject:[infoBarContainerController_ view]]; |
| 1001 |
| 988 if ([findBarCocoaController_ view]) | 1002 if ([findBarCocoaController_ view]) |
| 989 [subviews addObject:[findBarCocoaController_ view]]; | 1003 [subviews addObject:[findBarCocoaController_ view]]; |
| 990 | 1004 |
| 991 [self setContentViewSubviews:subviews]; | 1005 [self setContentViewSubviews:subviews]; |
| 992 } | 1006 } |
| 993 | 1007 |
| 994 - (void)setContentViewSubviews:(NSArray*)subviews { | 1008 - (void)setContentViewSubviews:(NSArray*)subviews { |
| 995 // Subviews already match. | 1009 // Subviews already match. |
| 996 if ([[self.chromeContentView subviews] isEqual:subviews]) | 1010 if ([[self.chromeContentView subviews] isEqual:subviews]) |
| 997 return; | 1011 return; |
| (...skipping 180 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1178 if (fullscreenLowPowerCoordinator_) | 1192 if (fullscreenLowPowerCoordinator_) |
| 1179 fullscreenLowPowerCoordinator_->SetHasActiveSheet(false); | 1193 fullscreenLowPowerCoordinator_->SetHasActiveSheet(false); |
| 1180 } | 1194 } |
| 1181 | 1195 |
| 1182 - (void)childWindowsDidChange { | 1196 - (void)childWindowsDidChange { |
| 1183 if (fullscreenLowPowerCoordinator_) | 1197 if (fullscreenLowPowerCoordinator_) |
| 1184 fullscreenLowPowerCoordinator_->ChildWindowsChanged(); | 1198 fullscreenLowPowerCoordinator_->ChildWindowsChanged(); |
| 1185 } | 1199 } |
| 1186 | 1200 |
| 1187 @end // @implementation BrowserWindowController(Private) | 1201 @end // @implementation BrowserWindowController(Private) |
| OLD | NEW |