Skip to content

Commit 7705c55

Browse files
committed
helium/ui/cat: fix layout breakage when exiting fullscreen, again
fixes #590
1 parent 5354646 commit 7705c55

File tree

1 file changed

+13
-11
lines changed

1 file changed

+13
-11
lines changed

patches/helium/ui/experiments/compact-action-toolbar.patch

Lines changed: 13 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -122,21 +122,23 @@
122122
// TODO(pbos): Investigate whether the side panels should be creatable when
123123
--- a/chrome/browser/ui/views/frame/layout/browser_view_layout_impl_old.cc
124124
+++ b/chrome/browser/ui/views/frame/layout/browser_view_layout_impl_old.cc
125-
@@ -411,6 +411,13 @@ void BrowserViewLayoutImplOld::LayoutTab
126-
views().tab_strip_region_view->SetBounds(0, 0, 0, 0);
127-
return;
128-
}
125+
@@ -406,6 +406,15 @@ void BrowserViewLayoutImplOld::LayoutVer
126+
void BrowserViewLayoutImplOld::LayoutTabStripRegion(
127+
gfx::Rect& available_bounds) {
128+
TRACE_EVENT0("ui", "BrowserViewLayout::LayoutTabStripRegion");
129129
+
130-
+ // If the CAT feature is enabled, then the tab strip is in the toolbar.
131-
+ // We shouldn't layout it here.
132-
+ if (features::IsHeliumCatEnabled()) {
130+
+ // If the CAT feature is enabled and we're in a normal browser,
131+
+ // skip laying out the tab strip region. It's laid out in the toolbar.
132+
+ // In other browser types the tab strip isn't drawn, so the next
133+
+ // if statement will hide it.
134+
+ if (features::IsHeliumCatEnabled() && browser()->is_type_normal()) {
133135
+ return;
134136
+ }
135137
+
136-
// This retrieves the bounds for the tab strip based on whether or not we show
137-
// anything to the left of it, like the incognito avatar.
138-
gfx::Rect tab_strip_region_bounds(
139-
@@ -458,6 +465,15 @@ void BrowserViewLayoutImplOld::LayoutToo
138+
if (!delegate().ShouldDrawTabStrip()) {
139+
SetViewVisibility(views().tab_strip_region_view, false);
140+
views().tab_strip_region_view->SetBounds(0, 0, 0, 0);
141+
@@ -458,6 +467,15 @@ void BrowserViewLayoutImplOld::LayoutToo
140142
toolbar_bounds.set_x(available_bounds.x());
141143
toolbar_bounds.set_width(toolbar_bounds.width() - kVerticalTabStripWidth);
142144
views().toolbar->SetBoundsRect(toolbar_bounds);

0 commit comments

Comments
 (0)