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

Unified Diff: chrome/browser/ui/cocoa/browser_window_controller_private.mm

Issue 12674019: Alternate NTP Mac: Show overlay at fixed position (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Created 7 years, 9 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 side-by-side diff with in-line comments
Download patch
Index: chrome/browser/ui/cocoa/browser_window_controller_private.mm
diff --git a/chrome/browser/ui/cocoa/browser_window_controller_private.mm b/chrome/browser/ui/cocoa/browser_window_controller_private.mm
index 5b207897275aeed3f4b8f9f62182cf8028140a52..14788abfb821fecc00c450320eb3400f0a88a90d 100644
--- a/chrome/browser/ui/cocoa/browser_window_controller_private.mm
+++ b/chrome/browser/ui/cocoa/browser_window_controller_private.mm
@@ -206,8 +206,8 @@ willPositionSheet:(NSWindow*)sheet
DCHECK_LE(maxY, NSMaxY(contentBounds) + yOffset);
// Place the toolbar at the top of the reserved area.
+ CGFloat toolbarTopY = maxY;
maxY = [self layoutToolbarAtMinX:minX maxY:maxY width:width];
- CGFloat toolbarBottomY = maxY;
// If we're not displaying the bookmark bar below the infobar, then it goes
// immediately below the toolbar.
@@ -251,8 +251,13 @@ willPositionSheet:(NSWindow*)sheet
toolbarToWebContentsOffset_ = 0;
contentAreaTop = maxY;
} else {
- toolbarToWebContentsOffset_ = toolbarBottomY - maxY;
- contentAreaTop = toolbarBottomY;
+ CGFloat minToolbarHeight = 0;
+ if ([self hasToolbar]) {
+ minToolbarHeight = [toolbarController_
+ desiredHeightForCompression:bookmarks::kBookmarkBarOverlap];
+ }
+ contentAreaTop = toolbarTopY - minToolbarHeight;
+ toolbarToWebContentsOffset_ = contentAreaTop - maxY;
}
[self updateContentOffsets];
@@ -842,8 +847,6 @@ willPositionSheet:(NSWindow*)sheet
}
- (CGFloat)toolbarDividerOpacity {
- if ([self currentInstantUIState] != browser_window_controller::kInstantUINone)
- return 1;
return [bookmarkBarController_ toolbarDividerOpacity];
}

Powered by Google App Engine
This is Rietveld 408576698