summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--chrome/browser/views/toolbar_view.cc10
1 files changed, 8 insertions, 2 deletions
diff --git a/chrome/browser/views/toolbar_view.cc b/chrome/browser/views/toolbar_view.cc
index 18922dd..fdfd2fd 100644
--- a/chrome/browser/views/toolbar_view.cc
+++ b/chrome/browser/views/toolbar_view.cc
@@ -479,9 +479,15 @@ gfx::Size BrowserToolbarView::GetPreferredSize() {
return gfx::Size(0, normal_background.height());
}
+ // Note: We make sure to return the same value in the "no browser window" case
+ // as the "not maximized" case, so that when a popup is opened at a particular
+ // requested size, we'll report the same preferred size during the initial
+ // window size calculation (when there isn't yet a browser window) as when
+ // we're actually laying things out after setting up the browser window. This
+ // prevents the content area from being off by |kClientEdgeThickness| px.
int client_edge_height =
- (browser_->window() && !browser_->window()->IsMaximized()) ?
- BrowserView::kClientEdgeThickness : 0;
+ (browser_->window() && browser_->window()->IsMaximized()) ?
+ 0 : BrowserView::kClientEdgeThickness;
return gfx::Size(0,
location_bar_->GetPreferredSize().height() + client_edge_height);
}