Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[WIP] Enable updated horizontal tabs by default (1.62) #21712

Closed
wants to merge 1 commit into from
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion browser/ui/tabs/features.cc
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ BASE_FEATURE(kBraveSharedPinnedTabs,

BASE_FEATURE(kBraveHorizontalTabsUpdate,
"BraveHorizontalTabsUpdate",
base::FEATURE_DISABLED_BY_DEFAULT);
base::FEATURE_ENABLED_BY_DEFAULT);

bool HorizontalTabsUpdateEnabled() {
return base::FeatureList::IsEnabled(kBraveHorizontalTabsUpdate);
Expand Down
9 changes: 1 addition & 8 deletions browser/ui/views/tabs/brave_new_tab_button.cc
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,6 @@
#include "ui/gfx/geometry/skia_conversions.h"
#include "ui/gfx/paint_vector_icon.h"
#include "ui/gfx/scoped_canvas.h"
#include "ui/views/view_class_properties.h"

using tabs::features::HorizontalTabsUpdateEnabled;

Expand Down Expand Up @@ -67,13 +66,7 @@ SkPath BraveNewTabButton::GetBorderPath(const gfx::Point& origin,

BraveNewTabButton::BraveNewTabButton(TabStrip* tab_strip,
PressedCallback callback)
: NewTabButton(tab_strip, std::move(callback)) {
if (HorizontalTabsUpdateEnabled()) {
// Ensure that the new tab button is vertically centered within its flex
// layout container.
SetProperty(views::kCrossAxisAlignmentKey, views::LayoutAlignment::kCenter);
}
}
: NewTabButton(tab_strip, std::move(callback)) {}

BraveNewTabButton::~BraveNewTabButton() = default;

Expand Down
15 changes: 10 additions & 5 deletions browser/ui/views/tabs/brave_tab_group_header.cc
Original file line number Diff line number Diff line change
Expand Up @@ -104,11 +104,16 @@ void BraveTabGroupHeader::LayoutTitleChipForVerticalTabs() {
SkColor BraveTabGroupHeader::GetGroupColor() const {
auto group_id = group().value();

if (!tab_slot_controller_->GetBrowser()
->tab_strip_model()
->group_model()
->ContainsTabGroup(group_id)) {
// Can happen in tear-down.
auto model_contains_group = [&]() {
if (auto* browser = tab_slot_controller_->GetBrowser()) {
return browser->tab_strip_model()->group_model()->ContainsTabGroup(
group_id);
}
return false;
};

if (!model_contains_group()) {
// Can happen in unit tests or in tear-down.
return gfx::kPlaceholderColor;
}

Expand Down
6 changes: 5 additions & 1 deletion test/filters/unit_tests.filter
Original file line number Diff line number Diff line change
Expand Up @@ -222,6 +222,10 @@
# https://github.com/brave/brave-browser/issues/25729
-TabContainerTest.RemoveTabInGroupWithTabClosingMode

# This test fails because the bounds of the tab group underline are slightly
# different from upstream.
-TabContainerTest.GroupUnderlineBasics

# Tests below are disabled for attempting to read unregistered pref
# kDefaultSearchProviderByExtension, and crashing. This pref seems to be
# registered only by SearchEngineProviderServiceFactory::RegisterProfilePrefs.
Expand Down Expand Up @@ -391,7 +395,7 @@
# See ChromeBrowserFieldTrials.
-ChromeBrowserFieldTrialsTest.SamplingTrials

# These tests crash because we disable
# These tests crash because we disable
# enterprise_connectors::kLocalContentAnalysisEnabled feature
-FilesRequestHandlerTest.FileIsEncrypted_LocalAnalysis
-FilesRequestHandlerTest.FileIsLarge_LocalAnalysis
Expand Down