[cr149] Fixes bookmark bar placement for vertical tabs.

The upstream change moved the top container layout calculation into an
Impl method in BrowserViewTabbedLayoutImpl and internally now calls the
Impl method instead of BrowserViewTabbedLayout which is virtual and the
one we were overriding. Made the Impl method virtual and now we are
overring it instead.

Chromium change:
https://chromium.googlesource.com/chromium/src.git/+/450301153d05f

commit 450301153d05ffd001bafa2622ba031cd6e62fc6
Author: Dana Fried <dfried@chromium.org>
Date:   Wed Apr 29 07:39:52 2026 -0700

    [Chrome Next] Ensure separator is hidden in infobar+thsp+vts

    This fixes a corner case where a separator would be drawn in the top
    container when vertical tabs + toolbar-height side panel + an infobar
    are present in the browser.

    This makes the suppression of the separator consistent regardless of
    whether the separator is drawn in the top container or multi-contents
    view area.

    Fixed: 507565700
This commit is contained in:
Max Karolinskiy
2026-05-22 16:57:38 -04:00
parent 85695e3212
commit 874cd833d9
3 changed files with 18 additions and 7 deletions
@@ -227,13 +227,15 @@ BraveBrowserViewTabbedLayoutImpl::CalculateProposedLayout(
return layout;
}
gfx::Rect BraveBrowserViewTabbedLayoutImpl::CalculateTopContainerLayout(
gfx::Rect BraveBrowserViewTabbedLayoutImpl::CalculateTopContainerLayoutImpl(
ProposedLayout& layout,
BrowserLayoutParams params,
bool needs_exclusion) const {
bool needs_exclusion,
bool suppress_top_separator) const {
// Get base layout from parent
gfx::Rect bounds = BrowserViewTabbedLayoutImpl::CalculateTopContainerLayout(
layout, params, needs_exclusion);
gfx::Rect bounds =
BrowserViewTabbedLayoutImpl::CalculateTopContainerLayoutImpl(
layout, params, needs_exclusion, suppress_top_separator);
if (!delegate().ShouldShowVerticalTabs()) {
return bounds;
@@ -54,9 +54,11 @@ class BraveBrowserViewTabbedLayoutImpl : public BrowserViewTabbedLayoutImpl {
gfx::Size GetMinimumSize(const views::View* host) const override;
ProposedLayout CalculateProposedLayout(
const BrowserLayoutParams& params) const override;
gfx::Rect CalculateTopContainerLayout(ProposedLayout& layout,
BrowserLayoutParams params,
bool needs_exclusion) const override;
gfx::Rect CalculateTopContainerLayoutImpl(
ProposedLayout& layout,
BrowserLayoutParams params,
bool needs_exclusion,
bool suppress_top_separator) const override;
void ConfigureTopContainerBackground(
const BrowserLayoutParams& params,
CustomCornersBackground* background) override;
@@ -21,8 +21,15 @@
friend class BraveBrowserViewTabbedLayoutImpl; \
virtual int GetHorizontalTabStripLeadingMargin(params)
// Make CalculateTopContainerLayoutImpl virtual to override it in
// BraveBrowserViewTabbedLayoutImpl. CalculateTopContainerLayout is virtual
// but it's only a wrapper around the Impl and internally the Impl is called
// so we need to override the Impl.
#define CalculateTopContainerLayoutImpl virtual CalculateTopContainerLayoutImpl
#include <chrome/browser/ui/views/frame/layout/browser_view_tabbed_layout_impl.h> // IWYU pragma: export
#undef CalculateTopContainerLayoutImpl
#undef GetTopSeparatorType
#undef GetHorizontalTabStripLeadingMargin