thorium-mirror/other/thorium-2024-ui.patch

497 lines
20 KiB
Diff
Raw Normal View History

2024-08-29 00:18:42 -04:00
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;
2024-08-12 10:53:10 -04:00
diff --git a/chrome/browser/ui/layout_constants.cc b/chrome/browser/ui/layout_constants.cc
2024-08-29 00:18:42 -04:00
index bba403a7e5068..056b405e46ec6 100644
2024-08-12 10:53:10 -04:00
--- a/chrome/browser/ui/layout_constants.cc
+++ b/chrome/browser/ui/layout_constants.cc
2024-08-14 23:30:11 -04:00
@@ -1,12 +1,14 @@
2024-08-12 10:53:10 -04:00
-// 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"
2024-08-14 23:30:11 -04:00
+#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"
2024-08-23 18:57:48 -04:00
@@ -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;
2024-08-12 10:53:10 -04:00
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;
2024-08-23 18:57:48 -04:00
+ const int bookmark_bar_attached_vertical_margin = features::IsThorium2024() ? 4 : 6;
2024-08-12 10:53:10 -04:00
return GetLayoutConstant(BOOKMARK_BAR_BUTTON_HEIGHT) +
bookmark_bar_attached_vertical_margin;
}
2024-08-23 18:57:48 -04:00
- 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) {
2024-08-12 10:53:10 -04:00
return GetLayoutConstant(TAB_HEIGHT) +
GetLayoutConstant(TAB_STRIP_PADDING);
case TAB_STRIP_PADDING:
- return features::IsChromeRefresh2023() ? 6 : 0;
2024-08-22 11:02:48 -04:00
+ return features::IsThorium2024() ? 0 : 6;
2024-08-16 23:32:34 -04:00
+ case TAB_MARGIN:
2024-08-22 11:02:48 -04:00
+ return features::IsThorium2024() ? 6 : GetLayoutConstant(TAB_STRIP_PADDING);
2024-08-16 23:32:34 -04:00
+ case TAB_INACTIVE_PADDING:
2024-08-22 11:02:48 -04:00
+ return features::IsThorium2024() ? 3 : 6;
2024-08-17 08:28:28 -04:00
+ case TAB_SEARCH_PADDING:
2024-08-22 11:02:48 -04:00
+ return features::IsThorium2024() ? 4 : 0;
2024-08-12 10:53:10 -04:00
case TAB_SEPARATOR_HEIGHT:
// TODO (crbug.com/1451400): ChromeRefresh2023 needs different values for
// this constant.
2024-08-23 18:57:48 -04:00
@@ -125,9 +137,13 @@ int GetLayoutConstant(LayoutConstant constant) {
2024-08-20 15:26:49 -04:00
case TOOLBAR_DIVIDER_CORNER_RADIUS:
return 1;
case TOOLBAR_DIVIDER_HEIGHT:
- return touch_ui ? 20 : 16;
2024-08-22 11:02:48 -04:00
+ if (features::IsThorium2024()) {
2024-08-20 15:26:49 -04:00
+ return 20;
+ } else {
+ return touch_ui ? 20 : 16;
+ }
case TOOLBAR_DIVIDER_SPACING:
- return 9;
2024-08-22 11:02:48 -04:00
+ return features::IsThorium2024() ? 8 : 9;
2024-08-20 15:26:49 -04:00
case TOOLBAR_DIVIDER_WIDTH:
return 2;
case TOOLBAR_ELEMENT_PADDING:
2024-08-23 18:57:48 -04:00
@@ -139,7 +155,7 @@ int GetLayoutConstant(LayoutConstant constant) {
2024-08-16 23:32:34 -04:00
return GetLayoutConstant(TOOLBAR_ELEMENT_PADDING);
}
case TOOLBAR_STANDARD_SPACING:
- if (features::IsChromeRefresh2023()) {
2024-08-22 11:02:48 -04:00
+ if (features::IsChromeRefresh2023() && !features::IsThorium2024()) {
2024-08-16 23:32:34 -04:00
return touch_ui ? 12 : 9;
} else {
return touch_ui ? 12 : 8;
2024-08-23 18:57:48 -04:00
@@ -149,7 +165,7 @@ int GetLayoutConstant(LayoutConstant constant) {
2024-08-16 23:32:34 -04:00
case DOWNLOAD_ICON_SIZE:
2024-08-17 08:28:28 -04:00
return features::IsChromeRefresh2023() ? 20 : 16;
2024-08-16 23:32:34 -04:00
case TOOLBAR_CORNER_RADIUS:
2024-08-17 08:28:28 -04:00
- return 8;
2024-08-22 11:02:48 -04:00
+ return features::IsThorium2024() ? 0 : 8;
2024-08-16 23:32:34 -04:00
default:
2024-08-17 08:28:28 -04:00
break;
}
2024-08-14 23:30:11 -04:00
diff --git a/chrome/browser/ui/layout_constants.h b/chrome/browser/ui/layout_constants.h
2024-08-17 08:28:28 -04:00
index d26bc737d3177..f453b459eb3f8 100644
2024-08-14 23:30:11 -04:00
--- a/chrome/browser/ui/layout_constants.h
+++ b/chrome/browser/ui/layout_constants.h
2024-08-17 08:28:28 -04:00
@@ -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 {
2024-08-14 23:30:11 -04:00
// detached tab, and on all sides of the controls padding.
TAB_STRIP_PADDING,
2024-08-16 23:32:34 -04:00
+ // For the tab margins
+ TAB_MARGIN,
+
+ // For inactive tab padding
+ TAB_INACTIVE_PADDING,
2024-08-14 23:30:11 -04:00
+
// The height of a separator in the tabstrip.
TAB_SEPARATOR_HEIGHT,
2024-08-17 08:28:28 -04:00
+ // Padding for the tab search button
+ TAB_SEARCH_PADDING,
+
// Padding before the tab title.
TAB_PRE_TITLE_PADDING,
2024-08-22 15:23:09 -04:00
diff --git a/chrome/browser/ui/tabs/tab_menu_model.cc b/chrome/browser/ui/tabs/tab_menu_model.cc
2024-08-23 18:57:48 -04:00
index bec499693cd91..404316da5bcd2 100644
2024-08-22 15:23:09 -04:00
--- a/chrome/browser/ui/tabs/tab_menu_model.cc
+++ b/chrome/browser/ui/tabs/tab_menu_model.cc
2024-08-23 18:57:48 -04:00
@@ -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);
2024-08-22 15:23:09 -04:00
if (tab_strip->delegate()->SupportsReadLater()) {
AddItem(
TabStripModel::CommandAddToReadLater,
2024-08-12 10:53:10 -04:00
diff --git a/chrome/browser/ui/tabs/tab_style.cc b/chrome/browser/ui/tabs/tab_style.cc
2024-08-29 00:18:42 -04:00
index aa9cd30374311..c5d3cbd005dae 100644
2024-08-12 10:53:10 -04:00
--- a/chrome/browser/ui/tabs/tab_style.cc
+++ b/chrome/browser/ui/tabs/tab_style.cc
2024-08-17 08:28:28 -04:00
@@ -1,27 +1,32 @@
2024-08-12 10:53:10 -04:00
-// 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.
2024-08-14 23:30:11 -04:00
#include "chrome/browser/ui/tabs/tab_style.h"
#include "chrome/browser/ui/layout_constants.h"
2024-08-16 23:32:34 -04:00
+#include "chrome/browser/ui/thorium_2024.h"
2024-08-14 23:30:11 -04:00
#include "chrome/browser/ui/ui_features.h"
#include "ui/base/ui_base_features.h"
2024-08-16 23:32:34 -04:00
#include "ui/color/color_provider.h"
2024-08-14 23:30:11 -04:00
#include "ui/views/layout/layout_provider.h"
namespace {
-
// Thickness in DIPs of the separator painted on the left and right edges of
2024-08-12 10:53:10 -04:00
// the tab.
constexpr int kGM2SeparatorThickness = 1;
2024-08-23 18:57:48 -04:00
+constexpr int kThoriumSeparatorThickness = 1;
2024-08-12 10:53:10 -04:00
constexpr int kChromeRefreshSeparatorThickness = 2;
2024-08-14 23:30:11 -04:00
+constexpr int kThoriumSeparatorHorizontalMargin = 1;
constexpr int kChromeRefreshSeparatorHorizontalMargin = 2;
2024-08-12 10:53:10 -04:00
// TODO (crbug.com/1451400): This constant should be in LayoutConstants.
2024-08-14 23:30:11 -04:00
+constexpr int kThoriumSeparatorHeight = 20;
constexpr int kChromeRefreshSeparatorHeight = 16;
2024-08-12 10:53:10 -04:00
// The padding from the top of the tab to the content area.
2024-08-14 23:30:11 -04:00
+constexpr int kThoriumTabVerticalPadding = 9;
constexpr int kChromeRefreshTabVerticalPadding = 6;
2024-08-17 08:28:28 -04:00
+constexpr int kThoriumTabHorizontalPadding = 6;
2024-08-12 10:53:10 -04:00
constexpr int kChromeRefreshTabHorizontalPadding = 8;
2024-08-17 08:28:28 -04:00
class GM2TabStyle : public TabStyle {
@@ -197,11 +202,27 @@ float GM2TabStyle::GetSelectedTabOpacity() const {
2024-08-14 23:30:11 -04:00
}
int ChromeRefresh2023TabStyle::GetTopCornerRadius() const {
- return 10;
2024-08-17 08:28:28 -04:00
+ static const bool rectangular_tabs =
+ base::CommandLine::ForCurrentProcess()->HasSwitch("rectangular-tabs");
2024-08-22 11:02:48 -04:00
+ if (features::IsThorium2024() && !rectangular_tabs) {
2024-08-14 23:30:11 -04:00
+ return 8;
2024-08-22 11:02:48 -04:00
+ } else if ((rectangular_tabs && features::IsThorium2024()) || (rectangular_tabs && !features::IsThorium2024())) {
2024-08-17 08:57:48 -04:00
+ return 3;
2024-08-14 23:30:11 -04:00
+ } else {
+ return 10;
+ }
}
int ChromeRefresh2023TabStyle::GetBottomCornerRadius() const {
- return 12;
2024-08-17 08:28:28 -04:00
+ static const bool rectangular_tabs =
+ base::CommandLine::ForCurrentProcess()->HasSwitch("rectangular-tabs");
2024-08-22 11:02:48 -04:00
+ if (features::IsThorium2024() && !rectangular_tabs) {
2024-08-17 08:28:28 -04:00
+ return 10;
2024-08-22 11:02:48 -04:00
+ } else if ((rectangular_tabs && features::IsThorium2024()) || (rectangular_tabs && !features::IsThorium2024())) {
2024-08-17 08:57:48 -04:00
+ return 3;
2024-08-14 23:30:11 -04:00
+ } else {
+ return 12;
+ }
}
int ChromeRefresh2023TabStyle::GetTabOverlap() const {
2024-08-17 08:28:28 -04:00
@@ -213,23 +234,43 @@ int ChromeRefresh2023TabStyle::GetTabOverlap() const {
2024-08-14 23:30:11 -04:00
}
gfx::Size ChromeRefresh2023TabStyle::GetSeparatorSize() const {
- return gfx::Size(kChromeRefreshSeparatorThickness,
- kChromeRefreshSeparatorHeight);
2024-08-22 11:02:48 -04:00
+ if (features::IsThorium2024()) {
2024-08-14 23:30:11 -04:00
+ 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);
2024-08-22 11:02:48 -04:00
+ if (features::IsThorium2024()) {
2024-08-14 23:30:11 -04:00
+ return gfx::Insets::TLBR(
+ kThoriumTabVerticalPadding + GetLayoutConstant(TAB_STRIP_PADDING),
2024-08-17 08:28:28 -04:00
+ GetBottomCornerRadius() + kThoriumTabHorizontalPadding,
2024-08-14 23:30:11 -04:00
+ kThoriumTabVerticalPadding + GetLayoutConstant(TAB_STRIP_PADDING),
2024-08-17 08:28:28 -04:00
+ GetBottomCornerRadius() + kThoriumTabHorizontalPadding);
2024-08-14 23:30:11 -04:00
+ } 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);
2024-08-22 11:02:48 -04:00
+ if (features::IsThorium2024()) {
2024-08-16 23:32:34 -04:00
+ return gfx::Insets::TLBR(GetLayoutConstant(TAB_INACTIVE_PADDING),
2024-08-14 23:30:11 -04:00
+ kThoriumSeparatorHorizontalMargin,
2024-08-16 23:32:34 -04:00
+ GetLayoutConstant(TAB_INACTIVE_PADDING),
2024-08-14 23:30:11 -04:00
+ 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
2024-08-17 08:28:28 -04:00
index f534d7e925b86..e49eee8f0c2b4 100644
2024-08-14 23:30:11 -04:00
--- a/chrome/browser/ui/views/frame/tab_strip_region_view.cc
+++ b/chrome/browser/ui/views/frame/tab_strip_region_view.cc
2024-08-17 08:28:28 -04:00
@@ -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);
}
2024-08-16 23:32:34 -04:00
@@ -372,7 +372,7 @@ void TabStripRegionView::Layout(PassKey) {
2024-08-14 23:30:11 -04:00
gfx::Point new_tab_button_new_position =
gfx::Point(tab_strip_container_->bounds().right() -
TabStyle::Get()->GetBottomCornerRadius() +
- GetLayoutConstant(TAB_STRIP_PADDING),
2024-08-16 23:32:34 -04:00
+ GetLayoutConstant(TAB_MARGIN),
0);
2024-08-14 23:30:11 -04:00
gfx::Rect new_tab_button_new_bounds =
2024-08-17 08:28:28 -04:00
@@ -502,7 +502,7 @@ void TabStripRegionView::UpdateTabStripMargin() {
new_tab_button_->SetProperty(views::kViewIgnoredByLayoutKey, true);
2024-08-16 23:32:34 -04:00
2024-08-17 08:28:28 -04:00
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();
}
2024-08-16 23:32:34 -04:00
2024-08-17 08:28:28 -04:00
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;
2024-08-16 23:32:34 -04:00
2024-08-17 08:28:28 -04:00
+ // 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;
2024-08-29 00:18:42 -04:00
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;
}
2024-08-14 23:30:11 -04:00
diff --git a/ui/views/controls/menu/menu_config.cc b/ui/views/controls/menu/menu_config.cc
2024-08-29 00:18:42 -04:00
index 83c7f06f1b236..173b829890079 100644
2024-08-14 23:30:11 -04:00
--- a/ui/views/controls/menu/menu_config.cc
+++ b/ui/views/controls/menu/menu_config.cc
2024-08-16 23:32:34 -04:00
@@ -1,10 +1,11 @@
2024-08-14 23:30:11 -04:00
-// 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"
2024-08-16 23:32:34 -04:00
+#include "chrome/browser/ui/thorium_2024.h"
2024-08-14 23:30:11 -04:00
#include "ui/base/ui_base_features.h"
#include "ui/views/controls/menu/menu_controller.h"
2024-08-16 23:32:34 -04:00
#include "ui/views/controls/menu/menu_item_view.h"
@@ -55,12 +56,12 @@ void MenuConfig::InitCommon() {
2024-08-14 23:30:11 -04:00
reserve_dedicated_arrow_column = false;
menu_horizontal_border_size = 0;
submenu_horizontal_overlap = 0;
- item_vertical_margin = 6;
2024-08-22 11:02:48 -04:00
+ item_vertical_margin = features::IsThorium2024() ? 4 : 6;
2024-08-14 23:30:11 -04:00
item_horizontal_border_padding = 12;
arrow_size = 16;
- separator_height = 17;
- separator_spacing_height = 4;
- use_outer_border = false;
2024-08-22 11:02:48 -04:00
+ separator_height = features::IsThorium2024() ? 11 : 17;
+ separator_spacing_height = features::IsThorium2024() ? 3 : 4;
+ use_outer_border = features::IsThorium2024() ? true : false;
2024-08-14 23:30:11 -04:00
}
// static
2024-08-12 10:53:10 -04:00
diff --git a/ui/views/layout/layout_provider.cc b/ui/views/layout/layout_provider.cc
2024-08-29 00:18:42 -04:00
index 3684e27766834..72f1751f64c46 100644
2024-08-12 10:53:10 -04:00
--- 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.
2024-08-16 23:32:34 -04:00
@@ -8,6 +8,7 @@
2024-08-12 10:53:10 -04:00
#include "base/containers/fixed_flat_map.h"
#include "base/logging.h"
2024-08-16 23:32:34 -04:00
+#include "chrome/browser/ui/thorium_2024.h"
2024-08-12 10:53:10 -04:00
#include "ui/base/ui_base_features.h"
2024-08-16 23:32:34 -04:00
#include "ui/gfx/font_list.h"
#include "ui/views/controls/focus_ring.h"
2024-08-17 08:28:28 -04:00
@@ -208,6 +209,37 @@ ShapeSysTokens GetShapeSysToken(ShapeContextTokens id) {
2024-08-16 23:32:34 -04:00
2024-08-17 08:28:28 -04:00
int LayoutProvider::GetCornerRadiusMetric(ShapeContextTokens id,
const gfx::Size& size) const {
+
2024-08-22 11:02:48 -04:00
+ if (features::IsThorium2024()) {
2024-08-12 10:53:10 -04:00
+ switch (id) {
2024-08-16 23:32:34 -04:00
+ case ShapeContextTokens::kBadgeRadius:
2024-08-17 08:28:28 -04:00
+ return 4;
2024-08-16 23:32:34 -04:00
+ case ShapeContextTokens::kButtonRadius:
2024-08-17 08:28:28 -04:00
+ return std::min(size.width(), size.height()) / 2;
2024-08-16 23:32:34 -04:00
+ case ShapeContextTokens::kComboboxRadius:
2024-08-17 08:28:28 -04:00
+ return 8;
2024-08-16 23:32:34 -04:00
+ case ShapeContextTokens::kDialogRadius:
2024-08-17 08:28:28 -04:00
+ return 12;
2024-08-16 23:32:34 -04:00
+ case ShapeContextTokens::kFindBarViewRadius:
2024-08-17 08:28:28 -04:00
+ return 8;
2024-08-12 10:53:10 -04:00
+ case ShapeContextTokens::kMenuRadius:
2024-08-16 23:32:34 -04:00
+ case ShapeContextTokens::kMenuAuxRadius:
2024-08-17 08:28:28 -04:00
+ return 0;
2024-08-16 23:32:34 -04:00
+ case ShapeContextTokens::kMenuTouchRadius:
2024-08-17 08:28:28 -04:00
+ return 8;
2024-08-16 23:32:34 -04:00
+ case ShapeContextTokens::kOmniboxExpandedRadius:
+ return 16;
+ case ShapeContextTokens::kTextfieldRadius:
2024-08-17 08:28:28 -04:00
+ return 8;
2024-08-16 23:32:34 -04:00
+ case ShapeContextTokens::kSidePanelContentRadius:
2024-08-17 08:28:28 -04:00
+ return 16;
+ case ShapeContextTokens::kSidePanelPageContentRadius:
+ return 8;
2024-08-16 23:32:34 -04:00
+ default:
+ return 0;
2024-08-12 10:53:10 -04:00
+ }
+ }
2024-08-16 23:32:34 -04:00
+
2024-08-17 08:28:28 -04:00
if (!features::IsChromeRefresh2023()) {
switch (id) {
case ShapeContextTokens::kBadgeRadius: