summaryrefslogtreecommitdiffstats
path: root/chrome
diff options
context:
space:
mode:
authorben@chromium.org <ben@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2008-10-08 23:07:12 +0000
committerben@chromium.org <ben@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2008-10-08 23:07:12 +0000
commit0ae89b4bb383c7444855fe77e47c86fd022ec4b0 (patch)
treee683ae0213c2e8185a8554c699f3e69c62dd245d /chrome
parentdff2b53edba542ad4a7910e3f3310a834fa3744a (diff)
downloadchromium_src-0ae89b4bb383c7444855fe77e47c86fd022ec4b0.zip
chromium_src-0ae89b4bb383c7444855fe77e47c86fd022ec4b0.tar.gz
chromium_src-0ae89b4bb383c7444855fe77e47c86fd022ec4b0.tar.bz2
Always position and size the toolbar view, since it's used to position other elements.
Regression from changelist earlier today. Review URL: http://codereview.chromium.org/6365 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@3071 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'chrome')
-rw-r--r--chrome/browser/views/frame/browser_view2.cc35
1 files changed, 18 insertions, 17 deletions
diff --git a/chrome/browser/views/frame/browser_view2.cc b/chrome/browser/views/frame/browser_view2.cc
index 46510bd..e30ed49 100644
--- a/chrome/browser/views/frame/browser_view2.cc
+++ b/chrome/browser/views/frame/browser_view2.cc
@@ -901,25 +901,26 @@ int BrowserView2::LayoutTabStrip() {
}
int BrowserView2::LayoutToolbar(int top) {
- if (IsToolbarVisible()) {
- CSize ps;
- toolbar_->GetPreferredSize(&ps);
- int toolbar_y =
- top - (IsTabStripVisible() ? kToolbarTabStripVerticalOverlap : 0);
- // With detached popup windows with the aero glass frame, we need to offset
- // by a pixel to make things look good.
- if (!IsTabStripVisible() && win_util::ShouldUseVistaFrame())
- ps.cy -= 1;
- int browser_view_width = width();
+ CSize ps;
+ toolbar_->GetPreferredSize(&ps);
+ int toolbar_y =
+ top - (IsTabStripVisible() ? kToolbarTabStripVerticalOverlap : 0);
+ // With detached popup windows with the aero glass frame, we need to offset
+ // by a pixel to make things look good.
+ if (!IsTabStripVisible() && win_util::ShouldUseVistaFrame())
+ ps.cy -= 1;
+ int browser_view_width = width();
#ifdef CHROME_PERSONALIZATION
- if (IsPersonalizationEnabled())
- Personalization::AdjustBrowserView(personalization_, &browser_view_width);
+ if (IsPersonalizationEnabled())
+ Personalization::AdjustBrowserView(personalization_, &browser_view_width);
#endif
- toolbar_->SetBounds(0, toolbar_y, browser_view_width, ps.cy);
- return toolbar_y + ps.cy;
- }
- toolbar_->SetVisible(false);
- return top;
+ // Note that we always size the toolbar, regardless of whether or not it's
+ // visible. It's used to position other elements.
+ int toolbar_height = IsToolbarVisible() ? ps.cy : 0;
+ toolbar_->SetBounds(0, toolbar_y, browser_view_width, toolbar_height);
+ if (!IsToolbarVisible())
+ toolbar_->SetVisible(false);
+ return toolbar_->y() + toolbar_->height();
}
int BrowserView2::LayoutBookmarkAndInfoBars(int top) {