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

Unified Diff: chrome/browser/ui/views/frame/browser_view.cc

Issue 1780333006: Check for null |tabstrip_| in BrowserView::IsTabStripVisible() (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: DoesIntersectRect() implementations Created 4 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/views/frame/browser_view.cc
diff --git a/chrome/browser/ui/views/frame/browser_view.cc b/chrome/browser/ui/views/frame/browser_view.cc
index 7d583154d344ac942e7af0975acdcaa9d4ba50ab..b7fcf8d6afc4cbefeced3e97a6f28fc01b065c37 100644
--- a/chrome/browser/ui/views/frame/browser_view.cc
+++ b/chrome/browser/ui/views/frame/browser_view.cc
@@ -577,8 +577,7 @@ int BrowserView::GetTabStripHeight() const {
// 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 tabstrip_ && IsTabStripVisible() ?
- tabstrip_->GetPreferredSize().height() : 0;
+ return IsTabStripVisible() ? tabstrip_->GetPreferredSize().height() : 0;
}
gfx::Point BrowserView::OffsetPointForToolbarBackgroundImage(
@@ -594,9 +593,18 @@ gfx::Point BrowserView::OffsetPointForToolbarBackgroundImage(
bool BrowserView::IsTabStripVisible() const {
if (immersive_mode_controller_->ShouldHideTopViews() &&
- immersive_mode_controller_->ShouldHideTabIndicators())
+ immersive_mode_controller_->ShouldHideTabIndicators()) {
return false;
- return browser_->SupportsWindowFeature(Browser::FEATURE_TABSTRIP);
+ }
+
+ // Return false if this window does not normally display a tabstrip.
+ if (!browser_->SupportsWindowFeature(Browser::FEATURE_TABSTRIP))
+ return false;
+
+ // Has the tabstrip been created yet (by InitViews())? Note that we can't
Peter Kasting 2016/03/14 23:04:42 Nit: For parallel structure with the above, maybe
tdanderson 2016/03/15 15:51:42 Done.
+ // just check this alone, as the tabstrip is created unconditionally even
+ // for windows that won't display it.
+ return tabstrip_ != nullptr;
}
bool BrowserView::IsOffTheRecord() const {

Powered by Google App Engine
This is Rietveld 408576698