From 10ca595038a6d5e8c896f71c8cdff58aeccf81f1 Mon Sep 17 00:00:00 2001 From: "pkasting@chromium.org" Date: Thu, 26 Feb 2009 23:42:00 +0000 Subject: Fix a DCHECK in certain cases when coming out of fullscreen mode. The frame gets to layout before the browser view, but it needs to know what the browser view's tabstrip layout is going to look like, or it will lay out wrong. Review URL: http://codereview.chromium.org/27231 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@10535 0039d316-1c4b-4281-b951-d872f2087c98 --- chrome/browser/views/frame/browser_view.cc | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) (limited to 'chrome') diff --git a/chrome/browser/views/frame/browser_view.cc b/chrome/browser/views/frame/browser_view.cc index 12a057c..ce2eb07 100644 --- a/chrome/browser/views/frame/browser_view.cc +++ b/chrome/browser/views/frame/browser_view.cc @@ -310,7 +310,10 @@ gfx::Rect BrowserView::GetFindBarBoundingBox() const { } int BrowserView::GetTabStripHeight() const { - return tabstrip_->height(); + // We want to return tabstrip_->height(), but we might be called in the midst + // of layout, when that hasn't yet been updated to reflect the current state. + // So return what the tabstrip height _ought_ to be right now. + return IsTabStripVisible() ? tabstrip_->GetPreferredSize().height() : 0; } bool BrowserView::IsToolbarVisible() const { -- cgit v1.1