Compare commits

...

3 Commits

Author SHA1 Message Date
wukko 7c45f2fcd6 revision: bump to 3 (#587) 2025-12-09 16:12:11 +00:00
wukko 8cb698e496 helium/ui/cat: fix order of early CAT layout return (#583)
fixes #576
2025-12-09 21:32:33 +06:00
wukko 009a2e74c7 helium/ui/cat: fix crash when opening the guest window (#577)
extensions container is nullptr there, so trying to set its flex property was causing a crash
2025-12-09 15:54:48 +06:00
2 changed files with 19 additions and 15 deletions
@@ -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);
@@ -197,7 +198,7 @@
show_avatar_button_.Init(
prefs::kShowAvatarButton, prefs,
base::BindRepeating(&ToolbarView::OnShowAvatarButtonChanged,
@@ -573,12 +596,27 @@ void ToolbarView::Init() {
@@ -573,12 +596,30 @@ void ToolbarView::Init() {
InitLayout();
@@ -218,14 +219,17 @@
+ if (features::IsHeliumCatEnabled()) {
+ pinned_toolbar_actions_container_->SetProperty(
+ views::kFlexBehaviorKey, flex_preferred);
+ extensions_container_->SetProperty(
+ views::kFlexBehaviorKey, flex_preferred);
+
+ if (extensions_container_) {
+ extensions_container_->SetProperty(
+ views::kFlexBehaviorKey, flex_preferred);
+ }
+ }
+
if (browser_view_->GetSupportsTabStrip()) {
browser()->GetTabStripModel()->AddObserver(this);
}
@@ -703,6 +741,24 @@ bool ToolbarView::IsRectInWindowCaption(
@@ -703,6 +744,24 @@ bool ToolbarView::IsRectInWindowCaption(
return gfx::ToEnclosingRect(rect_in_target_coords_f);
};
@@ -250,7 +254,7 @@
// Check each child view in container_view_ to see if the rect intersects with
// any clickable elements. If it does, check if the click is actually on that
// element. False if on a clickable element, true if not on a clickable element.
@@ -982,8 +1038,12 @@ void ToolbarView::InitLayout() {
@@ -982,8 +1041,12 @@ void ToolbarView::InitLayout() {
constexpr int kToolbarActionsFlexOrder = kOrderOffset + 2;
constexpr int kExtensionsFlexOrder = kOrderOffset + 3;
@@ -264,7 +268,7 @@
views::MaximumFlexSizeRule::kUnbounded)
.WithOrder(kLocationBarFlexOrder);
@@ -999,6 +1059,12 @@ void ToolbarView::InitLayout() {
@@ -999,6 +1062,12 @@ void ToolbarView::InitLayout() {
location_bar_->SetProperty(views::kMarginsKey,
gfx::Insets::VH(0, location_bar_margin));
+1 -1
View File
@@ -1 +1 @@
2
3