diff --git a/other/thorium-2024-ui.patch b/other/thorium-2024-ui.patch index 7218715dc..4c1dadd5f 100644 --- a/other/thorium-2024-ui.patch +++ b/other/thorium-2024-ui.patch @@ -24,7 +24,7 @@ index bba403a7e5068..e6cba4e30c0a0 100644 // to the white space above and below. - const int bookmark_bar_attached_vertical_margin = - features::IsChromeRefresh2023() ? 6 : 4; -+ const int bookmark_bar_attached_vertical_margin = IsThorium2024() ? 2 : 6; ++ const int bookmark_bar_attached_vertical_margin = features::IsThorium2024() ? 2 : 6; return GetLayoutConstant(BOOKMARK_BAR_BUTTON_HEIGHT) + bookmark_bar_attached_vertical_margin; } @@ -33,13 +33,13 @@ index bba403a7e5068..e6cba4e30c0a0 100644 GetLayoutConstant(TAB_STRIP_PADDING); case TAB_STRIP_PADDING: - return features::IsChromeRefresh2023() ? 6 : 0; -+ return IsThorium2024() ? 0 : 6; ++ return features::IsThorium2024() ? 0 : 6; + case TAB_MARGIN: -+ return IsThorium2024() ? 6 : GetLayoutConstant(TAB_STRIP_PADDING); ++ return features::IsThorium2024() ? 6 : GetLayoutConstant(TAB_STRIP_PADDING); + case TAB_INACTIVE_PADDING: -+ return IsThorium2024() ? 3 : 6; ++ return features::IsThorium2024() ? 3 : 6; + case TAB_SEARCH_PADDING: -+ return IsThorium2024() ? 4 : 0; ++ return features::IsThorium2024() ? 4 : 0; case TAB_SEPARATOR_HEIGHT: // TODO (crbug.com/1451400): ChromeRefresh2023 needs different values for // this constant. @@ -48,14 +48,14 @@ index bba403a7e5068..e6cba4e30c0a0 100644 return 1; case TOOLBAR_DIVIDER_HEIGHT: - return touch_ui ? 20 : 16; -+ if (IsThorium2024()) { ++ if (features::IsThorium2024()) { + return 20; + } else { + return touch_ui ? 20 : 16; + } case TOOLBAR_DIVIDER_SPACING: - return 9; -+ return IsThorium2024() ? 8 : 9; ++ return features::IsThorium2024() ? 8 : 9; case TOOLBAR_DIVIDER_WIDTH: return 2; case TOOLBAR_ELEMENT_PADDING: @@ -64,7 +64,7 @@ index bba403a7e5068..e6cba4e30c0a0 100644 } case TOOLBAR_STANDARD_SPACING: - if (features::IsChromeRefresh2023()) { -+ if (features::IsChromeRefresh2023() && !IsThorium2024()) { ++ if (features::IsChromeRefresh2023() && !features::IsThorium2024()) { return touch_ui ? 12 : 9; } else { return touch_ui ? 12 : 8; @@ -73,7 +73,7 @@ index bba403a7e5068..e6cba4e30c0a0 100644 return features::IsChromeRefresh2023() ? 20 : 16; case TOOLBAR_CORNER_RADIUS: - return 8; -+ return IsThorium2024() ? 0 : 8; ++ return features::IsThorium2024() ? 0 : 8; default: break; } @@ -152,9 +152,9 @@ index aa9cd30374311..5d5a40f92f922 100644 - return 10; + static const bool rectangular_tabs = + base::CommandLine::ForCurrentProcess()->HasSwitch("rectangular-tabs"); -+ if (IsThorium2024() && !rectangular_tabs) { ++ if (features::IsThorium2024() && !rectangular_tabs) { + return 8; -+ } else if ((rectangular_tabs && IsThorium2024()) || (rectangular_tabs && !IsThorium2024())) { ++ } else if ((rectangular_tabs && features::IsThorium2024()) || (rectangular_tabs && !features::IsThorium2024())) { + return 3; + } else { + return 10; @@ -165,9 +165,9 @@ index aa9cd30374311..5d5a40f92f922 100644 - return 12; + static const bool rectangular_tabs = + base::CommandLine::ForCurrentProcess()->HasSwitch("rectangular-tabs"); -+ if (IsThorium2024() && !rectangular_tabs) { ++ if (features::IsThorium2024() && !rectangular_tabs) { + return 10; -+ } else if ((rectangular_tabs && IsThorium2024()) || (rectangular_tabs && !IsThorium2024())) { ++ } else if ((rectangular_tabs && features::IsThorium2024()) || (rectangular_tabs && !features::IsThorium2024())) { + return 3; + } else { + return 12; @@ -181,7 +181,7 @@ index aa9cd30374311..5d5a40f92f922 100644 gfx::Size ChromeRefresh2023TabStyle::GetSeparatorSize() const { - return gfx::Size(kChromeRefreshSeparatorThickness, - kChromeRefreshSeparatorHeight); -+ if (IsThorium2024()) { ++ if (features::IsThorium2024()) { + return gfx::Size(kThoriumSeparatorThickness, + kThoriumSeparatorHeight); + } else { @@ -196,7 +196,7 @@ index aa9cd30374311..5d5a40f92f922 100644 - GetBottomCornerRadius() + kChromeRefreshTabHorizontalPadding, - kChromeRefreshTabVerticalPadding + GetLayoutConstant(TAB_STRIP_PADDING), - GetBottomCornerRadius() + kChromeRefreshTabHorizontalPadding); -+ if (IsThorium2024()) { ++ if (features::IsThorium2024()) { + return gfx::Insets::TLBR( + kThoriumTabVerticalPadding + GetLayoutConstant(TAB_STRIP_PADDING), + GetBottomCornerRadius() + kThoriumTabHorizontalPadding, @@ -216,7 +216,7 @@ index aa9cd30374311..5d5a40f92f922 100644 - kChromeRefreshSeparatorHorizontalMargin, - GetLayoutConstant(TAB_STRIP_PADDING), - kChromeRefreshSeparatorHorizontalMargin); -+ if (IsThorium2024()) { ++ if (features::IsThorium2024()) { + return gfx::Insets::TLBR(GetLayoutConstant(TAB_INACTIVE_PADDING), + kThoriumSeparatorHorizontalMargin, + GetLayoutConstant(TAB_INACTIVE_PADDING), @@ -341,15 +341,15 @@ index 83c7f06f1b236..576150ff56af4 100644 menu_horizontal_border_size = 0; submenu_horizontal_overlap = 0; - item_vertical_margin = 6; -+ item_vertical_margin = IsThorium2024() ? 4 : 6; ++ item_vertical_margin = features::IsThorium2024() ? 4 : 6; item_horizontal_border_padding = 12; arrow_size = 16; - separator_height = 17; - separator_spacing_height = 4; - use_outer_border = false; -+ separator_height = IsThorium2024() ? 11 : 17; -+ separator_spacing_height = IsThorium2024() ? 3 : 4; -+ use_outer_border = IsThorium2024() ? true : false; ++ separator_height = features::IsThorium2024() ? 11 : 17; ++ separator_spacing_height = features::IsThorium2024() ? 3 : 4; ++ use_outer_border = features::IsThorium2024() ? true : false; } // static @@ -376,7 +376,7 @@ index 3684e27766834..d62fe3f96ab62 100644 int LayoutProvider::GetCornerRadiusMetric(ShapeContextTokens id, const gfx::Size& size) const { + -+ if (IsThorium2024()) { ++ if (features::IsThorium2024()) { + switch (id) { + case ShapeContextTokens::kBadgeRadius: + return 4; diff --git a/src/chrome/browser/ui/views/tabs/tab_style_views.cc b/src/chrome/browser/ui/views/tabs/tab_style_views.cc index e98a3bd45..9090165ea 100644 --- a/src/chrome/browser/ui/views/tabs/tab_style_views.cc +++ b/src/chrome/browser/ui/views/tabs/tab_style_views.cc @@ -1240,7 +1240,7 @@ SkPath ChromeRefresh2023TabStyleViews::GetPath( } } - if (Th24State()) { + if (features::IsThorium2024()) { top -= tab()->controller()->Th24StrokeOffset(); // Experimental int //bottom -= tab()->controller()->Th24StrokeOffset(); diff --git a/src/ui/base/ui_base_features.cc b/src/ui/base/ui_base_features.cc index 4d067c825..e0fe5aed3 100644 --- a/src/ui/base/ui_base_features.cc +++ b/src/ui/base/ui_base_features.cc @@ -520,7 +520,7 @@ bool IsChromeWebuiRefresh2023() { base::FeatureList::IsEnabled(kChromeRefreshSecondary2023); } -BASE_FEATURE(kThorium2024 +BASE_FEATURE(kThorium2024, "Thorium2024", base::FEATURE_DISABLED_BY_DEFAULT);