mirror of
https://github.com/Alex313031/thorium.git
synced 2025-01-10 03:47:44 -03:00
496 lines
20 KiB
Diff
496 lines
20 KiB
Diff
diff --git a/chrome/browser/resources/downloads/item.html b/chrome/browser/resources/downloads/item.html
|
|
index 0197942167f44..9535c3a076409 100644
|
|
--- a/chrome/browser/resources/downloads/item.html
|
|
+++ b/chrome/browser/resources/downloads/item.html
|
|
@@ -523,7 +523,7 @@
|
|
</div>
|
|
<div class="more-options">
|
|
<!-- Only show the "x" button in the old UX. -->
|
|
- <template is="dom-if" if="[[!improvedDownloadWarningsUx_]]">
|
|
+ <template is="dom-if" if="[[improvedDownloadWarningsUx_]]">
|
|
<div role="gridcell">
|
|
<cr-icon-button class="icon-clear"
|
|
style$="[[computeRemoveStyle_(isDangerous_, showCancel_)]]"
|
|
diff --git a/chrome/browser/ui/bookmarks/bookmark_utils_desktop.cc b/chrome/browser/ui/bookmarks/bookmark_utils_desktop.cc
|
|
index 64948595a4bc6..a568c893736ca 100644
|
|
--- a/chrome/browser/ui/bookmarks/bookmark_utils_desktop.cc
|
|
+++ b/chrome/browser/ui/bookmarks/bookmark_utils_desktop.cc
|
|
@@ -47,7 +47,7 @@ using bookmarks::BookmarkNode;
|
|
|
|
namespace chrome {
|
|
|
|
-size_t kNumBookmarkUrlsBeforePrompting = 15;
|
|
+size_t kNumBookmarkUrlsBeforePrompting = 50;
|
|
|
|
static BookmarkNavigationWrapper* g_nav_wrapper_test_instance = nullptr;
|
|
|
|
diff --git a/chrome/browser/ui/layout_constants.cc b/chrome/browser/ui/layout_constants.cc
|
|
index bba403a7e5068..056b405e46ec6 100644
|
|
--- a/chrome/browser/ui/layout_constants.cc
|
|
+++ b/chrome/browser/ui/layout_constants.cc
|
|
@@ -1,12 +1,14 @@
|
|
-// Copyright 2015 The Chromium Authors
|
|
+// Copyright 2024 The Chromium Authors and Alex313031
|
|
// Use of this source code is governed by a BSD-style license that can be
|
|
// found in the LICENSE file.
|
|
|
|
#include "chrome/browser/ui/layout_constants.h"
|
|
|
|
+#include "base/command_line.h"
|
|
#include "base/feature_list.h"
|
|
#include "base/notreached.h"
|
|
#include "build/build_config.h"
|
|
+#include "chrome/browser/ui/thorium_2024.h"
|
|
#include "chrome/browser/ui/ui_features.h"
|
|
#include "components/omnibox/common/omnibox_features.h"
|
|
#include "ui/base/pointer/touch_ui_controller.h"
|
|
@@ -21,21 +23,25 @@ int GetLayoutConstant(LayoutConstant constant) {
|
|
const bool touch_ui = ui::TouchUiController::Get()->touch_ui();
|
|
switch (constant) {
|
|
case APP_MENU_PROFILE_ROW_AVATAR_ICON_SIZE:
|
|
- return 24;
|
|
+ return features::IsThorium2024() ? 20 : 24;
|
|
case APP_MENU_MAXIMUM_CHARACTER_LENGTH:
|
|
return 30;
|
|
case BOOKMARK_BAR_HEIGHT: {
|
|
// The fixed margin ensures the bookmark buttons appear centered relative
|
|
// 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 = features::IsThorium2024() ? 4 : 6;
|
|
return GetLayoutConstant(BOOKMARK_BAR_BUTTON_HEIGHT) +
|
|
bookmark_bar_attached_vertical_margin;
|
|
}
|
|
- case BOOKMARK_BAR_BUTTON_HEIGHT:
|
|
- return touch_ui ? 36 : 28;
|
|
+ case BOOKMARK_BAR_BUTTON_HEIGHT: {
|
|
+ if (features::IsThorium2024()) {
|
|
+ return touch_ui ? 34 : 26;
|
|
+ } else {
|
|
+ return touch_ui ? 36 : 28;
|
|
+ }
|
|
+ }
|
|
case BOOKMARK_BAR_BUTTON_PADDING:
|
|
- return GetLayoutConstant(TOOLBAR_ELEMENT_PADDING);
|
|
+ return 4;
|
|
case BOOKMARK_BAR_BUTTON_IMAGE_LABEL_PADDING:
|
|
return features::IsChromeRefresh2023() ? 6 : 8;
|
|
case WEB_APP_MENU_BUTTON_SIZE:
|
|
@@ -97,7 +103,13 @@ int GetLayoutConstant(LayoutConstant constant) {
|
|
return GetLayoutConstant(TAB_HEIGHT) +
|
|
GetLayoutConstant(TAB_STRIP_PADDING);
|
|
case TAB_STRIP_PADDING:
|
|
- return features::IsChromeRefresh2023() ? 6 : 0;
|
|
+ return features::IsThorium2024() ? 0 : 6;
|
|
+ case TAB_MARGIN:
|
|
+ return features::IsThorium2024() ? 6 : GetLayoutConstant(TAB_STRIP_PADDING);
|
|
+ case TAB_INACTIVE_PADDING:
|
|
+ return features::IsThorium2024() ? 3 : 6;
|
|
+ case TAB_SEARCH_PADDING:
|
|
+ return features::IsThorium2024() ? 4 : 0;
|
|
case TAB_SEPARATOR_HEIGHT:
|
|
// TODO (crbug.com/1451400): ChromeRefresh2023 needs different values for
|
|
// this constant.
|
|
@@ -125,9 +137,13 @@ int GetLayoutConstant(LayoutConstant constant) {
|
|
case TOOLBAR_DIVIDER_CORNER_RADIUS:
|
|
return 1;
|
|
case TOOLBAR_DIVIDER_HEIGHT:
|
|
- return touch_ui ? 20 : 16;
|
|
+ if (features::IsThorium2024()) {
|
|
+ return 20;
|
|
+ } else {
|
|
+ return touch_ui ? 20 : 16;
|
|
+ }
|
|
case TOOLBAR_DIVIDER_SPACING:
|
|
- return 9;
|
|
+ return features::IsThorium2024() ? 8 : 9;
|
|
case TOOLBAR_DIVIDER_WIDTH:
|
|
return 2;
|
|
case TOOLBAR_ELEMENT_PADDING:
|
|
@@ -139,7 +155,7 @@ int GetLayoutConstant(LayoutConstant constant) {
|
|
return GetLayoutConstant(TOOLBAR_ELEMENT_PADDING);
|
|
}
|
|
case TOOLBAR_STANDARD_SPACING:
|
|
- if (features::IsChromeRefresh2023()) {
|
|
+ if (features::IsChromeRefresh2023() && !features::IsThorium2024()) {
|
|
return touch_ui ? 12 : 9;
|
|
} else {
|
|
return touch_ui ? 12 : 8;
|
|
@@ -149,7 +165,7 @@ int GetLayoutConstant(LayoutConstant constant) {
|
|
case DOWNLOAD_ICON_SIZE:
|
|
return features::IsChromeRefresh2023() ? 20 : 16;
|
|
case TOOLBAR_CORNER_RADIUS:
|
|
- return 8;
|
|
+ return features::IsThorium2024() ? 0 : 8;
|
|
default:
|
|
break;
|
|
}
|
|
diff --git a/chrome/browser/ui/layout_constants.h b/chrome/browser/ui/layout_constants.h
|
|
index d26bc737d3177..f453b459eb3f8 100644
|
|
--- a/chrome/browser/ui/layout_constants.h
|
|
+++ b/chrome/browser/ui/layout_constants.h
|
|
@@ -1,4 +1,4 @@
|
|
-// Copyright 2015 The Chromium Authors
|
|
+// Copyright 2024 The Chromium Authors and Alex313031
|
|
// Use of this source code is governed by a BSD-style license that can be
|
|
// found in the LICENSE file.
|
|
|
|
@@ -119,9 +119,18 @@ enum LayoutConstant {
|
|
// detached tab, and on all sides of the controls padding.
|
|
TAB_STRIP_PADDING,
|
|
|
|
+ // For the tab margins
|
|
+ TAB_MARGIN,
|
|
+
|
|
+ // For inactive tab padding
|
|
+ TAB_INACTIVE_PADDING,
|
|
+
|
|
// The height of a separator in the tabstrip.
|
|
TAB_SEPARATOR_HEIGHT,
|
|
|
|
+ // Padding for the tab search button
|
|
+ TAB_SEARCH_PADDING,
|
|
+
|
|
// Padding before the tab title.
|
|
TAB_PRE_TITLE_PADDING,
|
|
|
|
diff --git a/chrome/browser/ui/tabs/tab_menu_model.cc b/chrome/browser/ui/tabs/tab_menu_model.cc
|
|
index bec499693cd91..404316da5bcd2 100644
|
|
--- a/chrome/browser/ui/tabs/tab_menu_model.cc
|
|
+++ b/chrome/browser/ui/tabs/tab_menu_model.cc
|
|
@@ -105,6 +105,10 @@ void TabMenuModel::Build(TabStripModel* tab_strip, int index) {
|
|
AddItemWithStringId(TabStripModel::CommandNewTabToRight,
|
|
base::i18n::IsRTL() ? IDS_TAB_CXMENU_NEWTABTOLEFT
|
|
: IDS_TAB_CXMENU_NEWTABTORIGHT);
|
|
+ AddItemWithStringId(TabStripModel::CommandNewTabToLeft,
|
|
+ base::i18n::IsRTL() ? IDS_TAB_CXMENU_NEWTABTORIGHT
|
|
+ : IDS_TAB_CXMENU_NEWTABTOLEFT);
|
|
+ //AddItemWithStringId(IDC_RESTORE_TAB, IDS_RESTORE_TAB);
|
|
if (tab_strip->delegate()->SupportsReadLater()) {
|
|
AddItem(
|
|
TabStripModel::CommandAddToReadLater,
|
|
diff --git a/chrome/browser/ui/tabs/tab_style.cc b/chrome/browser/ui/tabs/tab_style.cc
|
|
index aa9cd30374311..c5d3cbd005dae 100644
|
|
--- a/chrome/browser/ui/tabs/tab_style.cc
|
|
+++ b/chrome/browser/ui/tabs/tab_style.cc
|
|
@@ -1,27 +1,32 @@
|
|
-// Copyright 2019 The Chromium Authors
|
|
+// Copyright 2024 The Chromium Authors and Alex313031
|
|
// Use of this source code is governed by a BSD-style license that can be
|
|
// found in the LICENSE file.
|
|
|
|
#include "chrome/browser/ui/tabs/tab_style.h"
|
|
|
|
#include "chrome/browser/ui/layout_constants.h"
|
|
+#include "chrome/browser/ui/thorium_2024.h"
|
|
#include "chrome/browser/ui/ui_features.h"
|
|
#include "ui/base/ui_base_features.h"
|
|
#include "ui/color/color_provider.h"
|
|
#include "ui/views/layout/layout_provider.h"
|
|
|
|
namespace {
|
|
-
|
|
// Thickness in DIPs of the separator painted on the left and right edges of
|
|
// the tab.
|
|
constexpr int kGM2SeparatorThickness = 1;
|
|
+constexpr int kThoriumSeparatorThickness = 1;
|
|
constexpr int kChromeRefreshSeparatorThickness = 2;
|
|
+constexpr int kThoriumSeparatorHorizontalMargin = 1;
|
|
constexpr int kChromeRefreshSeparatorHorizontalMargin = 2;
|
|
// TODO (crbug.com/1451400): This constant should be in LayoutConstants.
|
|
+constexpr int kThoriumSeparatorHeight = 20;
|
|
constexpr int kChromeRefreshSeparatorHeight = 16;
|
|
|
|
// The padding from the top of the tab to the content area.
|
|
+constexpr int kThoriumTabVerticalPadding = 9;
|
|
constexpr int kChromeRefreshTabVerticalPadding = 6;
|
|
+constexpr int kThoriumTabHorizontalPadding = 6;
|
|
constexpr int kChromeRefreshTabHorizontalPadding = 8;
|
|
|
|
class GM2TabStyle : public TabStyle {
|
|
@@ -197,11 +202,27 @@ float GM2TabStyle::GetSelectedTabOpacity() const {
|
|
}
|
|
|
|
int ChromeRefresh2023TabStyle::GetTopCornerRadius() const {
|
|
- return 10;
|
|
+ static const bool rectangular_tabs =
|
|
+ base::CommandLine::ForCurrentProcess()->HasSwitch("rectangular-tabs");
|
|
+ if (features::IsThorium2024() && !rectangular_tabs) {
|
|
+ return 8;
|
|
+ } else if ((rectangular_tabs && features::IsThorium2024()) || (rectangular_tabs && !features::IsThorium2024())) {
|
|
+ return 3;
|
|
+ } else {
|
|
+ return 10;
|
|
+ }
|
|
}
|
|
|
|
int ChromeRefresh2023TabStyle::GetBottomCornerRadius() const {
|
|
- return 12;
|
|
+ static const bool rectangular_tabs =
|
|
+ base::CommandLine::ForCurrentProcess()->HasSwitch("rectangular-tabs");
|
|
+ if (features::IsThorium2024() && !rectangular_tabs) {
|
|
+ return 10;
|
|
+ } else if ((rectangular_tabs && features::IsThorium2024()) || (rectangular_tabs && !features::IsThorium2024())) {
|
|
+ return 3;
|
|
+ } else {
|
|
+ return 12;
|
|
+ }
|
|
}
|
|
|
|
int ChromeRefresh2023TabStyle::GetTabOverlap() const {
|
|
@@ -213,23 +234,43 @@ int ChromeRefresh2023TabStyle::GetTabOverlap() const {
|
|
}
|
|
|
|
gfx::Size ChromeRefresh2023TabStyle::GetSeparatorSize() const {
|
|
- return gfx::Size(kChromeRefreshSeparatorThickness,
|
|
- kChromeRefreshSeparatorHeight);
|
|
+ if (features::IsThorium2024()) {
|
|
+ return gfx::Size(kThoriumSeparatorThickness,
|
|
+ kThoriumSeparatorHeight);
|
|
+ } else {
|
|
+ return gfx::Size(kChromeRefreshSeparatorThickness,
|
|
+ kChromeRefreshSeparatorHeight);
|
|
+ }
|
|
}
|
|
|
|
gfx::Insets ChromeRefresh2023TabStyle::GetContentsInsets() const {
|
|
- return gfx::Insets::TLBR(
|
|
- kChromeRefreshTabVerticalPadding + GetLayoutConstant(TAB_STRIP_PADDING),
|
|
- GetBottomCornerRadius() + kChromeRefreshTabHorizontalPadding,
|
|
- kChromeRefreshTabVerticalPadding + GetLayoutConstant(TAB_STRIP_PADDING),
|
|
- GetBottomCornerRadius() + kChromeRefreshTabHorizontalPadding);
|
|
+ if (features::IsThorium2024()) {
|
|
+ return gfx::Insets::TLBR(
|
|
+ kThoriumTabVerticalPadding + GetLayoutConstant(TAB_STRIP_PADDING),
|
|
+ GetBottomCornerRadius() + kThoriumTabHorizontalPadding,
|
|
+ kThoriumTabVerticalPadding + GetLayoutConstant(TAB_STRIP_PADDING),
|
|
+ GetBottomCornerRadius() + kThoriumTabHorizontalPadding);
|
|
+ } else {
|
|
+ return gfx::Insets::TLBR(
|
|
+ kChromeRefreshTabVerticalPadding + GetLayoutConstant(TAB_STRIP_PADDING),
|
|
+ GetBottomCornerRadius() + kChromeRefreshTabHorizontalPadding,
|
|
+ kChromeRefreshTabVerticalPadding + GetLayoutConstant(TAB_STRIP_PADDING),
|
|
+ GetBottomCornerRadius() + kChromeRefreshTabHorizontalPadding);
|
|
+ }
|
|
}
|
|
|
|
gfx::Insets ChromeRefresh2023TabStyle::GetSeparatorMargins() const {
|
|
- return gfx::Insets::TLBR(GetLayoutConstant(TAB_STRIP_PADDING),
|
|
- kChromeRefreshSeparatorHorizontalMargin,
|
|
- GetLayoutConstant(TAB_STRIP_PADDING),
|
|
- kChromeRefreshSeparatorHorizontalMargin);
|
|
+ if (features::IsThorium2024()) {
|
|
+ return gfx::Insets::TLBR(GetLayoutConstant(TAB_INACTIVE_PADDING),
|
|
+ kThoriumSeparatorHorizontalMargin,
|
|
+ GetLayoutConstant(TAB_INACTIVE_PADDING),
|
|
+ kThoriumSeparatorHorizontalMargin);
|
|
+ } else {
|
|
+ return gfx::Insets::TLBR(GetLayoutConstant(TAB_STRIP_PADDING),
|
|
+ kChromeRefreshSeparatorHorizontalMargin,
|
|
+ GetLayoutConstant(TAB_STRIP_PADDING),
|
|
+ kChromeRefreshSeparatorHorizontalMargin);
|
|
+ }
|
|
}
|
|
|
|
int ChromeRefresh2023TabStyle::GetSeparatorCornerRadius() const {
|
|
diff --git a/chrome/browser/ui/views/frame/tab_strip_region_view.cc b/chrome/browser/ui/views/frame/tab_strip_region_view.cc
|
|
index f534d7e925b86..e49eee8f0c2b4 100644
|
|
--- a/chrome/browser/ui/views/frame/tab_strip_region_view.cc
|
|
+++ b/chrome/browser/ui/views/frame/tab_strip_region_view.cc
|
|
@@ -1,4 +1,4 @@
|
|
-// Copyright 2019 The Chromium Authors
|
|
+// Copyright 2024 The Chromium Authors and Alex313031
|
|
// Use of this source code is governed by a BSD-style license that can be
|
|
// found in the LICENSE file.
|
|
|
|
@@ -222,7 +222,7 @@ TabStripRegionView::TabStripRegionView(std::unique_ptr<TabStrip> tab_strip)
|
|
if (features::IsChromeRefresh2023()) {
|
|
tab_search_container_->SetProperty(
|
|
views::kMarginsKey,
|
|
- gfx::Insets::TLBR(0, 0, 0, GetLayoutConstant(TAB_STRIP_PADDING)));
|
|
+ gfx::Insets::TLBR(0, 0, 0, GetLayoutConstant(TAB_INACTIVE_PADDING)));
|
|
} else {
|
|
const gfx::Insets control_padding = gfx::Insets::TLBR(
|
|
0, 0, 0, GetLayoutConstant(TABSTRIP_REGION_VIEW_CONTROL_PADDING));
|
|
@@ -357,7 +357,7 @@ void TabStripRegionView::Layout(PassKey) {
|
|
int product_specifications_button_width =
|
|
product_specifications_button_
|
|
? product_specifications_button_->GetPreferredSize().width()
|
|
- : 0;
|
|
+ : GetLayoutConstant(TAB_SEARCH_PADDING);
|
|
AdjustViewBoundsRect(tab_search_container_,
|
|
product_specifications_button_width);
|
|
}
|
|
@@ -372,7 +372,7 @@ void TabStripRegionView::Layout(PassKey) {
|
|
gfx::Point new_tab_button_new_position =
|
|
gfx::Point(tab_strip_container_->bounds().right() -
|
|
TabStyle::Get()->GetBottomCornerRadius() +
|
|
- GetLayoutConstant(TAB_STRIP_PADDING),
|
|
+ GetLayoutConstant(TAB_MARGIN),
|
|
0);
|
|
|
|
gfx::Rect new_tab_button_new_bounds =
|
|
@@ -502,7 +502,7 @@ void TabStripRegionView::UpdateTabStripMargin() {
|
|
new_tab_button_->SetProperty(views::kViewIgnoredByLayoutKey, true);
|
|
|
|
tab_strip_right_margin = new_tab_button_->GetPreferredSize().width() +
|
|
- GetLayoutConstant(TAB_STRIP_PADDING);
|
|
+ GetLayoutConstant(TAB_MARGIN);
|
|
}
|
|
|
|
// If the tab search button is before the tab strip, it also overlaps the
|
|
@@ -528,8 +528,8 @@ void TabStripRegionView::UpdateTabStripMargin() {
|
|
// should have 6 px of padding between it and the tab_search button (not
|
|
// including the corner radius).
|
|
tab_strip_left_margin = tab_strip_left_margin.value() +
|
|
- GetLayoutConstant(TAB_STRIP_PADDING) +
|
|
- GetLayoutConstant(TAB_STRIP_PADDING) -
|
|
+ GetLayoutConstant(TAB_INACTIVE_PADDING) +
|
|
+ GetLayoutConstant(TAB_INACTIVE_PADDING) -
|
|
TabStyle::Get()->GetBottomCornerRadius();
|
|
}
|
|
|
|
diff --git a/chrome/browser/ui/views/tabs/tab_slot_controller.h b/chrome/browser/ui/views/tabs/tab_slot_controller.h
|
|
index e928216ad00f7..4f33e232910c1 100644
|
|
--- a/chrome/browser/ui/views/tabs/tab_slot_controller.h
|
|
+++ b/chrome/browser/ui/views/tabs/tab_slot_controller.h
|
|
@@ -167,6 +167,9 @@ class TabSlotController {
|
|
// 0 if there is no stroke.
|
|
virtual int GetStrokeThickness() const = 0;
|
|
|
|
+ // Returns the inactive vertical tab offset when strokes are enabled.
|
|
+ virtual int Th24StrokeOffset() const = 0;
|
|
+
|
|
// Returns true if tab loading throbbers can be painted to a composited layer.
|
|
// This can only be done when the TabController can guarantee that nothing
|
|
// in the same window will redraw on top of the the favicon area of any tab.
|
|
diff --git a/chrome/browser/ui/views/tabs/tab_strip.h b/chrome/browser/ui/views/tabs/tab_strip.h
|
|
index ae3b649cfcdc6..3bcf134a9b744 100644
|
|
--- a/chrome/browser/ui/views/tabs/tab_strip.h
|
|
+++ b/chrome/browser/ui/views/tabs/tab_strip.h
|
|
@@ -1,4 +1,4 @@
|
|
-// Copyright 2017 The Chromium Authors
|
|
+// Copyright 2024 The Chromium Authors and Alex313031
|
|
// Use of this source code is governed by a BSD-style license that can be
|
|
// found in the LICENSE file.
|
|
|
|
@@ -291,6 +291,7 @@ class TabStrip : public views::View,
|
|
bool HoverCardIsShowingForTab(Tab* tab) override;
|
|
int GetBackgroundOffset() const override;
|
|
int GetStrokeThickness() const override;
|
|
+ int Th24StrokeOffset() const override;
|
|
bool CanPaintThrobberToLayer() const override;
|
|
bool HasVisibleBackgroundTabShapes() const override;
|
|
SkColor GetTabSeparatorColor() const override;
|
|
diff --git a/content/browser/renderer_host/render_process_host_impl.cc b/content/browser/renderer_host/render_process_host_impl.cc
|
|
index 83defaaaad55d..3c36bede863ef 100644
|
|
--- a/content/browser/renderer_host/render_process_host_impl.cc
|
|
+++ b/content/browser/renderer_host/render_process_host_impl.cc
|
|
@@ -213,6 +213,7 @@
|
|
#include "ui/gl/gl_switches.h"
|
|
#include "url/gurl.h"
|
|
#include "url/origin.h"
|
|
+#include "url/url_constants.h"
|
|
|
|
#if BUILDFLAG(IS_ANDROID)
|
|
#include "base/android/child_process_binding_types.h"
|
|
@@ -4412,6 +4413,9 @@ RenderProcessHost::FilterURLResult RenderProcessHostImpl::FilterURL(
|
|
*url = GURL(kBlockedURL);
|
|
return FilterURLResult::kBlocked;
|
|
}
|
|
+ if (url.SchemeIs(url::kFtpScheme)) {
|
|
+ return FilterURLResult::kAllowed;
|
|
+ }
|
|
return FilterURLResult::kAllowed;
|
|
}
|
|
|
|
diff --git a/ui/views/controls/menu/menu_config.cc b/ui/views/controls/menu/menu_config.cc
|
|
index 83c7f06f1b236..173b829890079 100644
|
|
--- a/ui/views/controls/menu/menu_config.cc
|
|
+++ b/ui/views/controls/menu/menu_config.cc
|
|
@@ -1,10 +1,11 @@
|
|
-// Copyright 2012 The Chromium Authors
|
|
+// Copyright 2024 The Chromium Authors and Alex313031
|
|
// Use of this source code is governed by a BSD-style license that can be
|
|
// found in the LICENSE file.
|
|
|
|
#include "ui/views/controls/menu/menu_config.h"
|
|
|
|
#include "base/no_destructor.h"
|
|
+#include "chrome/browser/ui/thorium_2024.h"
|
|
#include "ui/base/ui_base_features.h"
|
|
#include "ui/views/controls/menu/menu_controller.h"
|
|
#include "ui/views/controls/menu/menu_item_view.h"
|
|
@@ -55,12 +56,12 @@ void MenuConfig::InitCommon() {
|
|
reserve_dedicated_arrow_column = false;
|
|
menu_horizontal_border_size = 0;
|
|
submenu_horizontal_overlap = 0;
|
|
- item_vertical_margin = 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 = features::IsThorium2024() ? 11 : 17;
|
|
+ separator_spacing_height = features::IsThorium2024() ? 3 : 4;
|
|
+ use_outer_border = features::IsThorium2024() ? true : false;
|
|
}
|
|
|
|
// static
|
|
diff --git a/ui/views/layout/layout_provider.cc b/ui/views/layout/layout_provider.cc
|
|
index 3684e27766834..72f1751f64c46 100644
|
|
--- a/ui/views/layout/layout_provider.cc
|
|
+++ b/ui/views/layout/layout_provider.cc
|
|
@@ -1,4 +1,4 @@
|
|
-// Copyright 2017 The Chromium Authors
|
|
+// Copyright 2024 The Chromium Authors and Alex313031
|
|
// Use of this source code is governed by a BSD-style license that can be
|
|
// found in the LICENSE file.
|
|
|
|
@@ -8,6 +8,7 @@
|
|
|
|
#include "base/containers/fixed_flat_map.h"
|
|
#include "base/logging.h"
|
|
+#include "chrome/browser/ui/thorium_2024.h"
|
|
#include "ui/base/ui_base_features.h"
|
|
#include "ui/gfx/font_list.h"
|
|
#include "ui/views/controls/focus_ring.h"
|
|
@@ -208,6 +209,37 @@ ShapeSysTokens GetShapeSysToken(ShapeContextTokens id) {
|
|
|
|
int LayoutProvider::GetCornerRadiusMetric(ShapeContextTokens id,
|
|
const gfx::Size& size) const {
|
|
+
|
|
+ if (features::IsThorium2024()) {
|
|
+ switch (id) {
|
|
+ case ShapeContextTokens::kBadgeRadius:
|
|
+ return 4;
|
|
+ case ShapeContextTokens::kButtonRadius:
|
|
+ return std::min(size.width(), size.height()) / 2;
|
|
+ case ShapeContextTokens::kComboboxRadius:
|
|
+ return 8;
|
|
+ case ShapeContextTokens::kDialogRadius:
|
|
+ return 12;
|
|
+ case ShapeContextTokens::kFindBarViewRadius:
|
|
+ return 8;
|
|
+ case ShapeContextTokens::kMenuRadius:
|
|
+ case ShapeContextTokens::kMenuAuxRadius:
|
|
+ return 0;
|
|
+ case ShapeContextTokens::kMenuTouchRadius:
|
|
+ return 8;
|
|
+ case ShapeContextTokens::kOmniboxExpandedRadius:
|
|
+ return 16;
|
|
+ case ShapeContextTokens::kTextfieldRadius:
|
|
+ return 8;
|
|
+ case ShapeContextTokens::kSidePanelContentRadius:
|
|
+ return 16;
|
|
+ case ShapeContextTokens::kSidePanelPageContentRadius:
|
|
+ return 8;
|
|
+ default:
|
|
+ return 0;
|
|
+ }
|
|
+ }
|
|
+
|
|
if (!features::IsChromeRefresh2023()) {
|
|
switch (id) {
|
|
case ShapeContextTokens::kBadgeRadius:
|