helium/cat: fix DCHECK & layout breakage when entering fullscreen (#476)

fixes #446
This commit is contained in:
wukko
2025-11-17 18:26:50 +06:00
committed by GitHub
parent a4f89dfb1c
commit 1fe645253d

View File

@@ -90,21 +90,27 @@
if (features::HasTabSearchToolbarButton()) {
--- a/chrome/browser/ui/views/frame/browser_view_layout.cc
+++ b/chrome/browser/ui/views/frame/browser_view_layout.cc
@@ -540,6 +540,13 @@ void BrowserViewLayout::LayoutTabStripRe
tab_strip_region_view_->SetBounds(0, 0, 0, 0);
return;
}
@@ -535,11 +535,19 @@ void BrowserViewLayout::LayoutVerticalTa
void BrowserViewLayout::LayoutTabStripRegion(gfx::Rect& available_bounds) {
TRACE_EVENT0("ui", "BrowserViewLayout::LayoutTabStripRegion");
+
+ // If the CAT feature is enabled, then the tab strip is in the toolbar.
+ // We shouldn't layout it here.
+ if (features::IsHeliumCatEnabled()) {
+ return;
+ }
+
if (!delegate_->ShouldDrawTabStrip()) {
SetViewVisibility(tab_strip_region_view_, false);
tab_strip_region_view_->SetBounds(0, 0, 0, 0);
return;
}
+
// This retrieves the bounds for the tab strip based on whether or not we show
// anything to the left of it, like the incognito avatar.
gfx::Rect tab_strip_region_bounds(
@@ -587,6 +594,15 @@ void BrowserViewLayout::LayoutToolbar(gf
@@ -587,6 +595,15 @@ void BrowserViewLayout::LayoutToolbar(gf
toolbar_bounds.set_width(toolbar_bounds.width() -
BrowserView::kVerticalTabStripWidth);
toolbar_->SetBoundsRect(toolbar_bounds);