Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(313)

Side by Side Diff: chrome/browser/ui/cocoa/browser_window_controller_private.mm

Issue 14689007: Instant Extended: Move omnibox dropdown by 2 pixels (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Created 7 years, 7 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch | Annotate | Revision Log
OLDNEW
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 243 matching lines...) Expand 10 before | Expand all | Expand 10 after
254 CGFloat floatingBarHeight = 254 CGFloat floatingBarHeight =
255 NSHeight(floatingBarBackingRect) * [self floatingBarShownFraction]; 255 NSHeight(floatingBarBackingRect) * [self floatingBarShownFraction];
256 // When an instant overlay is shown this is the amount it needs to be pushed 256 // When an instant overlay is shown this is the amount it needs to be pushed
257 // down so that it doesn't get covered by the floating toolbar. 257 // down so that it doesn't get covered by the floating toolbar.
258 toolbarToWebContentsOffset_ = 258 toolbarToWebContentsOffset_ =
259 floatingBarHeight - (NSMaxY(contentBounds) - maxY); 259 floatingBarHeight - (NSMaxY(contentBounds) - maxY);
260 } else { 260 } else {
261 // The tabContentArea view starts below the omnibox. 261 // The tabContentArea view starts below the omnibox.
262 CGFloat minToolbarHeight = 0; 262 CGFloat minToolbarHeight = 0;
263 if ([self hasToolbar]) { 263 if ([self hasToolbar]) {
264 minToolbarHeight = [toolbarController_ 264 // -1 to account for the toolbar separator.
265 desiredHeightForCompression:bookmarks::kBookmarkBarOverlap]; 265 minToolbarHeight = [toolbarController_ desiredHeightForCompression:0] - 1;
Nico 2013/05/16 22:17:57 Why was this not needed before? This code is indep
sail 2013/05/16 22:35:30 Previously the overlay never overlapped the toolba
Nico 2013/05/16 22:55:58 Should the function just return the right value th
sail 2013/05/16 23:27:06 Only the overlay passes a constant value here. Tha
Nico 2013/05/22 22:49:21 I still don't get it. This code is laying out the
sail 2013/05/22 23:51:11 Right.
Robert Sesek 2013/05/24 18:36:23 Why is this not desiredHeightForCompresssion:1 ?
sail 2013/05/24 19:58:02 Good idea, done.
266 } 266 }
267 contentAreaTop = toolbarTopY - minToolbarHeight; 267 contentAreaTop = toolbarTopY - minToolbarHeight;
268 // This is the space between the bottom of the omnibox and the bottom of the 268 // This is the space between the bottom of the omnibox and the bottom of the
269 // last bar (info bar or bookmark bar or toolbar). This is used to push the 269 // last bar (info bar or bookmark bar or toolbar). This is used to push the
270 // tab web content down when no instant overlay is shown. 270 // tab web content down when no instant overlay is shown.
271 toolbarToWebContentsOffset_ = contentAreaTop - maxY; 271 toolbarToWebContentsOffset_ = contentAreaTop - maxY;
272 } 272 }
273 [self updateContentOffsets]; 273 [self updateContentOffsets];
274 274
275 NSRect contentAreaRect = NSMakeRect(minX, minY, width, contentAreaTop - minY); 275 NSRect contentAreaRect = NSMakeRect(minX, minY, width, contentAreaTop - minY);
(...skipping 714 matching lines...) Expand 10 before | Expand all | Expand 10 after
990 relativeTo:[bookmarkBarController_ view]]; 990 relativeTo:[bookmarkBarController_ view]];
991 } else { 991 } else {
992 [contentView cr_ensureSubview:floatingBarBackingView_ 992 [contentView cr_ensureSubview:floatingBarBackingView_
993 isPositioned:NSWindowBelow 993 isPositioned:NSWindowBelow
994 relativeTo:[bookmarkBarController_ view]]; 994 relativeTo:[bookmarkBarController_ view]];
995 } 995 }
996 } 996 }
997 } 997 }
998 998
999 @end // @implementation BrowserWindowController(Private) 999 @end // @implementation BrowserWindowController(Private)
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698