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/memory/scoped_nsobject.h" | 10 #import "base/memory/scoped_nsobject.h" |
(...skipping 248 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
259 CGFloat floatingBarHeight = | 259 CGFloat floatingBarHeight = |
260 NSHeight(floatingBarBackingRect) * [self floatingBarShownFraction]; | 260 NSHeight(floatingBarBackingRect) * [self floatingBarShownFraction]; |
261 // When an instant overlay is shown this is the amount it needs to be pushed | 261 // When an instant overlay is shown this is the amount it needs to be pushed |
262 // down so that it doesn't get covered by the floating toolbar. | 262 // down so that it doesn't get covered by the floating toolbar. |
263 toolbarToWebContentsOffset_ = | 263 toolbarToWebContentsOffset_ = |
264 floatingBarHeight - (NSMaxY(contentBounds) - maxY); | 264 floatingBarHeight - (NSMaxY(contentBounds) - maxY); |
265 } else { | 265 } else { |
266 // The tabContentArea view starts below the omnibox. | 266 // The tabContentArea view starts below the omnibox. |
267 CGFloat minToolbarHeight = 0; | 267 CGFloat minToolbarHeight = 0; |
268 if ([self hasToolbar]) { | 268 if ([self hasToolbar]) { |
269 minToolbarHeight = [toolbarController_ | 269 // 1 to account for the toolbar separator. |
270 desiredHeightForCompression:bookmarks::kBookmarkBarOverlap]; | 270 minToolbarHeight = [toolbarController_ desiredHeightForCompression:1]; |
271 } | 271 } |
272 contentAreaTop = toolbarTopY - minToolbarHeight; | 272 contentAreaTop = toolbarTopY - minToolbarHeight; |
273 // This is the space between the bottom of the omnibox and the bottom of the | 273 // This is the space between the bottom of the omnibox and the bottom of the |
274 // last bar (info bar or bookmark bar or toolbar). This is used to push the | 274 // last bar (info bar or bookmark bar or toolbar). This is used to push the |
275 // tab web content down when no instant overlay is shown. | 275 // tab web content down when no instant overlay is shown. |
276 toolbarToWebContentsOffset_ = contentAreaTop - maxY; | 276 toolbarToWebContentsOffset_ = contentAreaTop - maxY; |
277 } | 277 } |
278 [self updateContentOffsets]; | 278 [self updateContentOffsets]; |
279 | 279 |
280 // Place the find bar immediately below the toolbar/attached bookmark bar. In | 280 // Place the find bar immediately below the toolbar/attached bookmark bar. In |
(...skipping 726 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1007 relativeTo:[bookmarkBarController_ view]]; | 1007 relativeTo:[bookmarkBarController_ view]]; |
1008 } else { | 1008 } else { |
1009 [contentView cr_ensureSubview:floatingBarBackingView_ | 1009 [contentView cr_ensureSubview:floatingBarBackingView_ |
1010 isPositioned:NSWindowBelow | 1010 isPositioned:NSWindowBelow |
1011 relativeTo:[bookmarkBarController_ view]]; | 1011 relativeTo:[bookmarkBarController_ view]]; |
1012 } | 1012 } |
1013 } | 1013 } |
1014 } | 1014 } |
1015 | 1015 |
1016 @end // @implementation BrowserWindowController(Private) | 1016 @end // @implementation BrowserWindowController(Private) |
OLD | NEW |