| 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 250 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 261 CGFloat floatingBarHeight = | 261 CGFloat floatingBarHeight = |
| 262 NSHeight(floatingBarBackingRect) * [self floatingBarShownFraction]; | 262 NSHeight(floatingBarBackingRect) * [self floatingBarShownFraction]; |
| 263 // When an instant overlay is shown this is the amount it needs to be pushed | 263 // When an instant overlay is shown this is the amount it needs to be pushed |
| 264 // down so that it doesn't get covered by the floating toolbar. | 264 // down so that it doesn't get covered by the floating toolbar. |
| 265 toolbarToWebContentsOffset_ = | 265 toolbarToWebContentsOffset_ = |
| 266 floatingBarHeight - (NSMaxY(contentBounds) - maxY); | 266 floatingBarHeight - (NSMaxY(contentBounds) - maxY); |
| 267 } else { | 267 } else { |
| 268 // The tabContentArea view starts below the omnibox. | 268 // The tabContentArea view starts below the omnibox. |
| 269 CGFloat minToolbarHeight = 0; | 269 CGFloat minToolbarHeight = 0; |
| 270 if ([self hasToolbar]) { | 270 if ([self hasToolbar]) { |
| 271 minToolbarHeight = [toolbarController_ | 271 // 1 to account for the toolbar separator. |
| 272 desiredHeightForCompression:bookmarks::kBookmarkBarOverlap]; | 272 minToolbarHeight = [toolbarController_ desiredHeightForCompression:1]; |
| 273 } | 273 } |
| 274 contentAreaTop = toolbarTopY - minToolbarHeight; | 274 contentAreaTop = toolbarTopY - minToolbarHeight; |
| 275 // This is the space between the bottom of the omnibox and the bottom of the | 275 // This is the space between the bottom of the omnibox and the bottom of the |
| 276 // last bar (info bar or bookmark bar or toolbar). This is used to push the | 276 // last bar (info bar or bookmark bar or toolbar). This is used to push the |
| 277 // tab web content down when no instant overlay is shown. | 277 // tab web content down when no instant overlay is shown. |
| 278 toolbarToWebContentsOffset_ = contentAreaTop - maxY; | 278 toolbarToWebContentsOffset_ = contentAreaTop - maxY; |
| 279 } | 279 } |
| 280 [self updateContentOffsets]; | 280 [self updateContentOffsets]; |
| 281 | 281 |
| 282 NSRect contentAreaRect = NSMakeRect(minX, minY, width, contentAreaTop - minY); | 282 NSRect contentAreaRect = NSMakeRect(minX, minY, width, contentAreaTop - minY); |
| (...skipping 714 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 997 relativeTo:[bookmarkBarController_ view]]; | 997 relativeTo:[bookmarkBarController_ view]]; |
| 998 } else { | 998 } else { |
| 999 [contentView cr_ensureSubview:floatingBarBackingView_ | 999 [contentView cr_ensureSubview:floatingBarBackingView_ |
| 1000 isPositioned:NSWindowBelow | 1000 isPositioned:NSWindowBelow |
| 1001 relativeTo:[bookmarkBarController_ view]]; | 1001 relativeTo:[bookmarkBarController_ view]]; |
| 1002 } | 1002 } |
| 1003 } | 1003 } |
| 1004 } | 1004 } |
| 1005 | 1005 |
| 1006 @end // @implementation BrowserWindowController(Private) | 1006 @end // @implementation BrowserWindowController(Private) |
| OLD | NEW |