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 952 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
963 [subviews addObject:[self tabContentArea]]; | 963 [subviews addObject:[self tabContentArea]]; |
964 if ([findBarCocoaController_ view]) | 964 if ([findBarCocoaController_ view]) |
965 [subviews addObject:[findBarCocoaController_ view]]; | 965 [subviews addObject:[findBarCocoaController_ view]]; |
966 | 966 |
967 [self setContentViewSubviews:subviews]; | 967 [self setContentViewSubviews:subviews]; |
968 } | 968 } |
969 | 969 |
970 - (void)updateSubviewZOrderFullscreen { | 970 - (void)updateSubviewZOrderFullscreen { |
971 base::scoped_nsobject<NSMutableArray> subviews([[NSMutableArray alloc] init]); | 971 base::scoped_nsobject<NSMutableArray> subviews([[NSMutableArray alloc] init]); |
972 | 972 |
973 // The infobar should overlay the toolbar if the toolbar is fully shown. | |
974 FullscreenToolbarLayout layout = [fullscreenToolbarController_ computeLayout]; | |
975 BOOL shouldInfoBarOverlayToolbar = | |
976 ui::IsCGFloatEqual(layout.toolbarFraction, 1.0); | |
977 | |
978 if ([downloadShelfController_ view]) | 973 if ([downloadShelfController_ view]) |
979 [subviews addObject:[downloadShelfController_ view]]; | 974 [subviews addObject:[downloadShelfController_ view]]; |
980 if ([self tabContentArea]) | 975 if ([self tabContentArea]) |
981 [subviews addObject:[self tabContentArea]]; | 976 [subviews addObject:[self tabContentArea]]; |
982 | 977 |
983 if (!shouldInfoBarOverlayToolbar && [infoBarContainerController_ view]) | |
984 [subviews addObject:[infoBarContainerController_ view]]; | |
985 | |
986 if ([self placeBookmarkBarBelowInfoBar]) { | 978 if ([self placeBookmarkBarBelowInfoBar]) { |
987 if ([bookmarkBarController_ view]) | 979 if ([bookmarkBarController_ view]) |
988 [subviews addObject:[bookmarkBarController_ view]]; | 980 [subviews addObject:[bookmarkBarController_ view]]; |
989 if (floatingBarBackingView_) | 981 if (floatingBarBackingView_) |
990 [subviews addObject:floatingBarBackingView_]; | 982 [subviews addObject:floatingBarBackingView_]; |
991 } else { | 983 } else { |
992 if (floatingBarBackingView_) | 984 if (floatingBarBackingView_) |
993 [subviews addObject:floatingBarBackingView_]; | 985 [subviews addObject:floatingBarBackingView_]; |
994 if ([bookmarkBarController_ view]) | 986 if ([bookmarkBarController_ view]) |
995 [subviews addObject:[bookmarkBarController_ view]]; | 987 [subviews addObject:[bookmarkBarController_ view]]; |
996 } | 988 } |
997 | 989 |
998 if ([toolbarController_ view]) | 990 if ([toolbarController_ view]) |
999 [subviews addObject:[toolbarController_ view]]; | 991 [subviews addObject:[toolbarController_ view]]; |
1000 | 992 |
1001 if (shouldInfoBarOverlayToolbar && [infoBarContainerController_ view]) | 993 if ([infoBarContainerController_ view]) |
1002 [subviews addObject:[infoBarContainerController_ view]]; | 994 [subviews addObject:[infoBarContainerController_ view]]; |
1003 | 995 |
1004 if ([findBarCocoaController_ view]) | 996 if ([findBarCocoaController_ view]) |
1005 [subviews addObject:[findBarCocoaController_ view]]; | 997 [subviews addObject:[findBarCocoaController_ view]]; |
1006 | 998 |
1007 [self setContentViewSubviews:subviews]; | 999 [self setContentViewSubviews:subviews]; |
1008 } | 1000 } |
1009 | 1001 |
1010 - (void)setContentViewSubviews:(NSArray*)subviews { | 1002 - (void)setContentViewSubviews:(NSArray*)subviews { |
1011 // Subviews already match. | 1003 // Subviews already match. |
(...skipping 182 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1194 if (fullscreenLowPowerCoordinator_) | 1186 if (fullscreenLowPowerCoordinator_) |
1195 fullscreenLowPowerCoordinator_->SetHasActiveSheet(false); | 1187 fullscreenLowPowerCoordinator_->SetHasActiveSheet(false); |
1196 } | 1188 } |
1197 | 1189 |
1198 - (void)childWindowsDidChange { | 1190 - (void)childWindowsDidChange { |
1199 if (fullscreenLowPowerCoordinator_) | 1191 if (fullscreenLowPowerCoordinator_) |
1200 fullscreenLowPowerCoordinator_->ChildWindowsChanged(); | 1192 fullscreenLowPowerCoordinator_->ChildWindowsChanged(); |
1201 } | 1193 } |
1202 | 1194 |
1203 @end // @implementation BrowserWindowController(Private) | 1195 @end // @implementation BrowserWindowController(Private) |
OLD | NEW |