helium/ui/cat: fix order of early CAT layout return (#583)

fixes #576
This commit is contained in:
wukko
2025-12-09 21:32:33 +06:00
committed by GitHub
parent 009a2e74c7
commit 8cb698e496

View File

@@ -122,20 +122,21 @@
// TODO(pbos): Investigate whether the side panels should be creatable when
--- a/chrome/browser/ui/views/frame/layout/browser_view_layout_impl_old.cc
+++ b/chrome/browser/ui/views/frame/layout/browser_view_layout_impl_old.cc
@@ -406,6 +406,12 @@ void BrowserViewLayoutImplOld::LayoutVer
void BrowserViewLayoutImplOld::LayoutTabStripRegion(
gfx::Rect& available_bounds) {
TRACE_EVENT0("ui", "BrowserViewLayout::LayoutTabStripRegion");
@@ -411,6 +411,13 @@ void BrowserViewLayoutImplOld::LayoutTab
views().tab_strip_region_view->SetBounds(0, 0, 0, 0);
return;
}
+
+ // 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(views().tab_strip_region_view, false);
views().tab_strip_region_view->SetBounds(0, 0, 0, 0);
@@ -458,6 +464,15 @@ void BrowserViewLayoutImplOld::LayoutToo
+
// 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(
@@ -458,6 +465,15 @@ void BrowserViewLayoutImplOld::LayoutToo
toolbar_bounds.set_x(available_bounds.x());
toolbar_bounds.set_width(toolbar_bounds.width() - kVerticalTabStripWidth);
views().toolbar->SetBoundsRect(toolbar_bounds);