Compare commits

...

36 Commits

Author SHA1 Message Date
wukko c3ba3d8999 revision: bump to 7 (#494) 2025-11-19 15:46:26 +00:00
wukko 403e3fe01d helium/ui: detach find bar from location bar, fix padding (#493)
- no longer animates from the middle of the toolbar
- no longer feels awkward in CAT layout
- just looks better
2025-11-19 16:39:31 +01:00
wukko 5ee42465ab helium/flags: drop unsupported OSes from kOsAll and kOsDesktop (#492) 2025-11-19 09:00:37 +00:00
wukko aa487a75cd helium/ui/caption-button: remove linux adjustments (#491) 2025-11-19 14:55:47 +06:00
wukko 24b594f89e helium/cat: prevent pinned collapse, fixed address bar width flag (#490)
fixes #443
2025-11-19 14:37:21 +06:00
wukko 6a1cd43391 revision: bump to 6 (#484) 2025-11-18 10:48:00 +00:00
wukko 675cf80cde helium/cat: prevent common actions from going into overflow menu (#457)
fixes #438
fixes #440
2025-11-18 16:41:07 +06:00
wukko 0008cd2cec helium/cat: remove extra empty line 2025-11-18 16:37:38 +06:00
wukko fece071fb4 Merge branch 'main' into cat-fix-burgering 2025-11-18 16:19:34 +06:00
wukko 43dfac4447 merge: update to chromium 142.0.7444.175 (#482) 2025-11-18 15:34:51 +06:00
wukko 5d33305095 patches: refresh for chromium 142.0.7444.175 2025-11-18 14:55:15 +06:00
wukko 52dc69ac18 merge: update to ungoogled-chromium 142.0.7444.175 2025-11-18 14:37:17 +06:00
Blaise 633d41748b Update to Chromium 142.0.7444.175 2025-11-17 15:20:48 -06:00
wukko c8a824ec85 upstream-fixes/macos-rect: fix on old macos too (#480)
fixes #437
2025-11-17 21:18:06 +06:00
wukko 1fe645253d helium/cat: fix DCHECK & layout breakage when entering fullscreen (#476)
fixes #446
2025-11-17 18:26:50 +06:00
wukko a4f89dfb1c helium/cat: fix mini toolbar bounds in popup windows (#472)
fixes #439
2025-11-16 15:10:20 +00:00
jj 13f49f28cc helium/location-bar: fix trailing icon size & padding, fix intent (#456)
Co-authored-by: wukko <me@wukko.me>
2025-11-16 21:06:19 +06:00
jj e9a04a2ccf patches/split-view: fix crash when opening link from pdf (#466)
essentially a backport of chromium/chromium@c992846254

fixes #465
2025-11-15 19:59:29 +00:00
jj 80dfd780db gitattributes: remap patches to c++ (#464) 2025-11-15 13:53:18 +00:00
jj c9a0eaf2c0 helium/cat: make common icons always stay unburgered 2025-11-14 22:16:56 +00:00
jj 9f7755dbd7 helium/core: fix chrome.instanceID.getID() hanging (#449) 2025-11-13 20:00:13 +01:00
Kurt Fitzner 110cab3432 Update README.md to include Ubuntu distribution (#3536) 2025-11-13 07:52:14 -06:00
wukko 0f9df28d13 merge: update to chromium 142.0.7444.162 (#433) 2025-11-13 03:07:23 +06:00
wukko 060fa834e5 revision: bump to 5 2025-11-13 03:01:27 +06:00
wukko be47d96c1f patches: refresh for 142.0.7444.162 2025-11-13 03:00:09 +06:00
wukko f049404ad5 merge: update to ungoogled-chromium 142.0.7444.162 2025-11-13 02:46:38 +06:00
jj 232f940dbd ungoogled/existing-switches: fix webrtc switch flag values (#426)
fixes #425
2025-11-12 20:41:07 +00:00
wukko b3d929f6e2 helium/ui: new experimental layout, refactor tabs & omnibox (#427)
- added new experimental one-line top container UI layout behind `#helium-cat-ui` flag
- updated tab groups ui: fixed margins, updated header colors to be less blinding, and moved the line to top to prevent visual clashing with the location bar
- fixed the tab strip alignment on windows, linux, and in fullscreen mode on macos
- reduced tabs' outer margins & width
- refactored omnibox sizing, removed the glitchy border, fixed the macos-specific positioning issue by applying a fresh upstream fix
- refactored `layout-constants` to be more flexible for new ui layouts
2025-11-13 02:36:13 +06:00
wukko 5f296ba37d helium/ui: finally align the tab strip with toolbar buttons
on windows, linux, and fullscreen on mac
2025-11-13 01:58:15 +06:00
wukko 3668280470 upstream-fixes: fix misplaced omnibox popup due to rect constrains
fixes imputnet/helium-macos/issues/67
2025-11-13 01:58:15 +06:00
wukko 673aaf7698 helium/ui/tabs: update tab group ui, fix ntp button overlap, fix padding
- tab group header is now positioned properly
- tab group header is now colored like bookmarked tab groups
- moved tab underline to top to prevent visual clashing with the location bar, made it skinnier
- new tab button no longer sits on top of tabs, caused by minified outer margins of tabs
- fixed padding inside tabs to be visually 6px everywhere
2025-11-13 01:58:15 +06:00
wukko 9113a4cda7 helium/ui/omnibox: refactor sizing, remove stroke 2025-11-13 01:58:14 +06:00
wukko e9de843abe helium/ui: add experimental compact (one-line) toolbar 2025-11-13 01:58:06 +06:00
Blaise 367118d103 Update to Chromium 142.0.7444.162 2025-11-11 13:21:42 -06:00
wukko 8da7b370f7 helium/ui/tabs: reduce outer margins & width 2025-11-08 20:17:12 +06:00
wukko 06a3ebf3d3 helium/ui/layout-constants: refactor to avoid value duplication
and simplify future maintenance
2025-11-08 20:16:42 +06:00
24 changed files with 844 additions and 86 deletions
+1
View File
@@ -0,0 +1 @@
*.patch linguist-language=C++
+1 -1
View File
@@ -1 +1 @@
142.0.7444.134
142.0.7444.175
@@ -693,7 +693,7 @@
std::vector<base::CallbackListSubscription> tab_subscriptions_;
--- a/chrome/browser/ui/views/user_education/browser_user_education_service.cc
+++ b/chrome/browser/ui/views/user_education/browser_user_education_service.cc
@@ -752,39 +752,6 @@ void MaybeRegisterChromeFeaturePromos(
@@ -786,39 +786,6 @@ void MaybeRegisterChromeFeaturePromos(
.SetBubbleIcon(kLightbulbOutlineIcon)
.SetBubbleTitleText(IDS_PASSWORD_MANAGER_IPH_CREATE_SHORTCUT_TITLE)));
@@ -9,7 +9,7 @@
#include "components/translate/core/browser/translate_download_manager.h"
#include "components/translate/core/browser/translate_manager.h"
#include "components/translate/core/browser/translate_prefs.h"
@@ -2240,6 +2241,7 @@ void RenderViewContextMenu::AppendPageIt
@@ -2239,6 +2240,7 @@ void RenderViewContextMenu::AppendPageIt
}
if (CanTranslate(/*menu_logging=*/true)) {
@@ -343,7 +343,7 @@
#include "third_party/skia/include/core/SkImage.h"
--- a/third_party/blink/renderer/platform/runtime_enabled_features.json5
+++ b/third_party/blink/renderer/platform/runtime_enabled_features.json5
@@ -2344,6 +2344,12 @@
@@ -2350,6 +2350,12 @@
status: "stable",
},
{
@@ -314,7 +314,7 @@ approach to change color components.
SkJpegEncoder::Options options;
--- a/third_party/blink/renderer/platform/runtime_enabled_features.json5
+++ b/third_party/blink/renderer/platform/runtime_enabled_features.json5
@@ -2350,6 +2350,9 @@
@@ -2356,6 +2356,9 @@
name: "FingerprintingCanvasMeasureTextNoise",
},
{
@@ -78,7 +78,7 @@
#include "third_party/blink/public/common/permissions_policy/document_policy_features.h"
#include "third_party/blink/public/common/switches.h"
#include "third_party/blink/public/mojom/fetch/fetch_api_request.mojom-blink.h"
@@ -611,6 +612,8 @@ void FrameFetchContext::ModifyRequestFor
@@ -613,6 +614,8 @@ void FrameFetchContext::ModifyRequestFor
void FrameFetchContext::AddClientHintsIfNecessary(
const std::optional<float> resource_width,
ResourceRequest& request) {
@@ -15,7 +15,7 @@
#include "build/chromeos_buildflags.h"
--- /dev/null
+++ b/chrome/browser/existing_switch_flag_choices.h
@@ -0,0 +1,19 @@
@@ -0,0 +1,21 @@
+// Copyright (c) 2023 The ungoogled-chromium Authors. All rights reserved.
+// Use of this source code is governed by a BSD-style license that can be
+// found in the LICENSE.ungoogled_chromium file.
@@ -24,15 +24,17 @@
+#define CHROME_BROWSER_EXISTING_SWITCH_FLAG_CHOICES_H_
+const FeatureEntry::Choice kWebRTCIPPolicy[] = {
+ {"Default public interface only",
+ "webrtc-ip-handling-policy",
+ "default_public_interface_only"},
+ "",
+ ""},
+ {"Default",
+ "webrtc-ip-handling-policy",
+ "default"},
+ {"Default public and private interfaces",
+ "webrtc-ip-handling-policy",
+ "default_public_and_private_interfaces"},
+ {"Disable non proxied udp", "", ""},
+ {"Disable non proxied udp",
+ "webrtc-ip-handling-policy",
+ "disable_non_proxied_udp"},
+};
+#endif // CHROME_BROWSER_EXISTING_SWITCH_FLAG_CHOICES_H_
--- /dev/null
+4 -4
View File
@@ -12,7 +12,7 @@
if (editable) {
AppendOtherEditableItems();
}
@@ -2214,7 +2209,6 @@ void RenderViewContextMenu::AppendPageIt
@@ -2213,7 +2208,6 @@ void RenderViewContextMenu::AppendPageIt
IDS_CONTENT_CONTEXT_SAVEPAGEAS);
menu_model_.AddItemWithStringId(IDC_PRINT, IDS_CONTENT_CONTEXT_PRINT);
AppendLiveCaptionItem();
@@ -20,7 +20,7 @@
if (IsRegionSearchEnabled()) {
AppendRegionSearchItem();
}
@@ -2343,8 +2337,7 @@ void RenderViewContextMenu::AppendMediaR
@@ -2342,8 +2336,7 @@ void RenderViewContextMenu::AppendMediaR
void RenderViewContextMenu::AppendReadAnythingItem() {
// Show Read Anything option if it's not already open in the side panel.
@@ -30,7 +30,7 @@
menu_model_.AddItemWithStringId(IDC_CONTENT_CONTEXT_OPEN_IN_READING_MODE,
IDS_CONTENT_CONTEXT_READING_MODE);
}
@@ -3620,10 +3613,12 @@ void RenderViewContextMenu::ExecuteComma
@@ -3619,10 +3612,12 @@ void RenderViewContextMenu::ExecuteComma
}
void RenderViewContextMenu::AddSpellCheckServiceItem(bool is_checked) {
@@ -43,7 +43,7 @@
if (is_checked) {
menu_model_.AddCheckItemWithStringId(
IDC_CONTENT_CONTEXT_ACCESSIBILITY_LABELS_TOGGLE,
@@ -4000,6 +3995,8 @@ bool RenderViewContextMenu::IsVideoFrame
@@ -3999,6 +3994,8 @@ bool RenderViewContextMenu::IsVideoFrame
bool RenderViewContextMenu::AppendQRCodeGeneratorItem(bool for_image,
bool draw_icon,
bool add_separator) {
@@ -0,0 +1,12 @@
--- a/components/gcm_driver/instance_id/instance_id_impl.cc
+++ b/components/gcm_driver/instance_id/instance_id_impl.cc
@@ -263,9 +263,6 @@ gcm::InstanceIDHandler* InstanceIDImpl::
}
void InstanceIDImpl::RunWhenReady(base::OnceClosure task) {
- if (!delayed_task_controller_.CanRunTaskWithoutDelay())
- delayed_task_controller_.AddTask(std::move(task));
- else
base::SingleThreadTaskRunner::GetCurrentDefault()->PostTask(
FROM_HERE, std::move(task));
}
+15
View File
@@ -1,5 +1,20 @@
--- a/chrome/browser/about_flags.cc
+++ b/chrome/browser/about_flags.cc
@@ -392,11 +392,11 @@ namespace about_flags {
namespace {
-const unsigned kOsAll = kOsMac | kOsWin | kOsLinux | kOsCrOS | kOsAndroid;
-const unsigned kOsDesktop = kOsMac | kOsWin | kOsLinux | kOsCrOS;
+const unsigned kOsAll = kOsMac | kOsWin | kOsLinux;
+const unsigned kOsDesktop = kOsMac | kOsWin | kOsLinux;
#if defined(USE_AURA)
-const unsigned kOsAura = kOsWin | kOsLinux | kOsCrOS;
+const unsigned kOsAura = kOsWin | kOsLinux;
#endif // USE_AURA
#if defined(USE_AURA)
@@ -5001,11 +5001,13 @@ const FeatureEntry::FeatureVariation kSe
// calculate and verify checksum.
//
@@ -1,6 +1,6 @@
--- a/chrome/common/chrome_features.cc
+++ b/chrome/common/chrome_features.cc
@@ -969,7 +969,7 @@ BASE_FEATURE(kHttpsFirstBalancedMode, ba
@@ -967,7 +967,7 @@ BASE_FEATURE(kHttpsFirstBalancedMode, ba
// Automatically enables HTTPS-First Mode in a balanced configuration when
// possible.
BASE_FEATURE(kHttpsFirstBalancedModeAutoEnable,
+13
View File
@@ -639,3 +639,16 @@
tabs_to_reload.push_back(active_contents);
} else {
// Reloading a tab may change the selection (see crbug.com/339061099), so
--- a/chrome/browser/renderer_context_menu/render_view_context_menu.cc
+++ b/chrome/browser/renderer_context_menu/render_view_context_menu.cc
@@ -4944,8 +4944,8 @@ void RenderViewContextMenu::OpenLinkInSp
TabStripModel* const tab_strip_model = browser->tab_strip_model();
tabs::TabInterface* const source_tab =
- tabs::TabInterface::GetFromContents(source_web_contents_);
- if (source_tab->IsSplit()) {
+ tabs::TabInterface::MaybeGetFromContents(source_web_contents_);
+ if (source_tab && source_tab->IsSplit()) {
// Navigate the inactive tab to the URL
const split_tabs::SplitTabId split_id = source_tab->GetSplit().value();
for (tabs::TabInterface* tab :
@@ -0,0 +1,312 @@
--- a/chrome/browser/helium_flag_choices.h
+++ b/chrome/browser/helium_flag_choices.h
@@ -30,6 +30,9 @@ namespace helium {
constexpr const char kCanvasNoiseCommandLine[] = "fingerprinting-canvas-noise";
constexpr const char kAudioContextJitterCommandLine[] = "fingerprinting-audio-context-jitter";
constexpr const char kMiddleClickAutoscrollCommandLine[] = "middle-click-autoscroll";
+ constexpr const char kHeliumCatUiCommandLine[] = "helium-cat-ui";
+ constexpr const char kHeliumCatFixedAddressBarCommandLine[] =
+ "helium-cat-fixed-address-bar";
} // namespace helium
--- a/chrome/browser/helium_flag_entries.h
+++ b/chrome/browser/helium_flag_entries.h
@@ -28,4 +28,12 @@
"Middle Click Autoscroll",
"Enables autoscroll on middle click. Helium flag, Chromium feature.",
kOsDesktop, FEATURE_VALUE_TYPE(blink::features::kHeliumMiddleClickAutoscroll)},
+ {helium::kHeliumCatUiCommandLine,
+ "[CAT] Helium Compact Action Toolbar UI",
+ "Enables the new experimental UI that merges the tab strip and toolbar into one UI component to save vertical screen estate. Early and buggy, stuff will break and/or look weird. Helium flag.",
+ kOsDesktop, FEATURE_VALUE_TYPE(features::kHeliumCatUi)},
+ {helium::kHeliumCatFixedAddressBarCommandLine,
+ "[CAT] Fixed address bar width",
+ "Prevents the address bar from shrinking in the CAT layout. Will push toolbar actions outside of bounds on small window sizes, beware. Works only when the main CAT flag is enabled. Early and buggy, stuff will break and/or look weird. Helium flag.",
+ kOsDesktop, FEATURE_VALUE_TYPE(features::kHeliumCatFixedAddressBar)},
#endif /* CHROME_BROWSER_HELIUM_FLAG_ENTRIES_H_ */
--- a/chrome/browser/ui/ui_features.cc
+++ b/chrome/browser/ui/ui_features.cc
@@ -17,6 +17,22 @@
namespace features {
+// Helium Compact Action Toolbar UI
+BASE_FEATURE(kHeliumCatUi,
+ base::FEATURE_DISABLED_BY_DEFAULT);
+
+BASE_FEATURE(kHeliumCatFixedAddressBar,
+ base::FEATURE_DISABLED_BY_DEFAULT);
+
+bool IsHeliumCatEnabled() {
+ return base::FeatureList::IsEnabled(kHeliumCatUi);
+}
+
+bool IsHeliumCatFixedAddressBar() {
+ return IsHeliumCatEnabled() && base::FeatureList::IsEnabled(
+ kHeliumCatFixedAddressBar);
+}
+
// Enables the tab dragging fallback when full window dragging is not supported
// by the platform (e.g. Wayland). See https://crbug.com/896640
BASE_FEATURE(kAllowWindowDragUsingSystemDragDrop,
--- a/chrome/browser/ui/ui_features.h
+++ b/chrome/browser/ui/ui_features.h
@@ -20,6 +20,11 @@ namespace features {
// All features in alphabetical order. The features should be documented
// alongside the definition of their values in the .cc file.
+BASE_DECLARE_FEATURE(kHeliumCatUi);
+BASE_DECLARE_FEATURE(kHeliumCatFixedAddressBar);
+bool IsHeliumCatEnabled();
+bool IsHeliumCatFixedAddressBar();
+
// TODO(crbug.com/40598679): Remove this when the tab dragging
// interactive_ui_tests pass on Wayland.
BASE_DECLARE_FEATURE(kAllowWindowDragUsingSystemDragDrop);
--- a/chrome/browser/ui/views/frame/browser_view.cc
+++ b/chrome/browser/ui/views/frame/browser_view.cc
@@ -792,8 +792,12 @@ BrowserView::BrowserView(Browser* browse
top_container_ = AddChildView(std::make_unique<TopContainerView>(this));
- tab_strip_region_view_ =
- top_container_->AddChildView(std::make_unique<TabStripRegionView>(this));
+ // When the CAT feature is enabled, tab strip is in the toolbar.
+ // We shouldn't create a duplicate tab strip.
+ if (!features::IsHeliumCatEnabled() || !GetIsNormalType()) {
+ tab_strip_region_view_ =
+ top_container_->AddChildView(std::make_unique<TabStripRegionView>(this));
+ }
if (tabs::IsVerticalTabsFeatureEnabled()) {
auto vertical_tab_strip_container =
@@ -1155,7 +1159,8 @@ bool BrowserView::ShouldDrawTabStrip() c
// since callers may otherwise try to access it. Note that we can't just check
// this alone, as the tabstrip is created unconditionally even for windows
// that won't display it.
- return tab_strip_region_view_->tab_strip() != nullptr;
+ return tab_strip_region_view_ != nullptr &&
+ tab_strip_region_view_->tab_strip() != nullptr;
}
bool BrowserView::GetIncognito() const {
@@ -5097,6 +5102,12 @@ void BrowserView::AddedToWidget() {
toolbar_->Init();
+ // When the CAT feature is enabled, the tab strip is owned by the toolbar.
+ if (features::IsHeliumCatEnabled() && GetIsNormalType()) {
+ tab_strip_region_view_ =
+ static_cast<TabStripRegionView*>(toolbar_->GetTabStripRegionView());
+ }
+
if (!base::CommandLine::ForCurrentProcess()->HasSwitch("remove-tabsearch-button"))
if (GetIsNormalType()) {
if (features::HasTabSearchToolbarButton()) {
--- a/chrome/browser/ui/views/frame/browser_view_layout.cc
+++ b/chrome/browser/ui/views/frame/browser_view_layout.cc
@@ -535,11 +535,19 @@ void BrowserViewLayout::LayoutVerticalTa
void BrowserViewLayout::LayoutTabStripRegion(gfx::Rect& available_bounds) {
TRACE_EVENT0("ui", "BrowserViewLayout::LayoutTabStripRegion");
+
+ // If the CAT feature is enabled, then the tab strip is in the toolbar.
+ // We shouldn't layout it here.
+ if (features::IsHeliumCatEnabled()) {
+ return;
+ }
+
if (!delegate_->ShouldDrawTabStrip()) {
SetViewVisibility(tab_strip_region_view_, false);
tab_strip_region_view_->SetBounds(0, 0, 0, 0);
return;
}
+
// This retrieves the bounds for the tab strip based on whether or not we show
// anything to the left of it, like the incognito avatar.
gfx::Rect tab_strip_region_bounds(
@@ -587,6 +595,15 @@ void BrowserViewLayout::LayoutToolbar(gf
toolbar_bounds.set_width(toolbar_bounds.width() -
BrowserView::kVerticalTabStripWidth);
toolbar_->SetBoundsRect(toolbar_bounds);
+ } else if (features::IsHeliumCatEnabled() && delegate_->ShouldDrawTabStrip()) {
+ // If CAT is enabled and the tab strip should be drawn, then we're most
+ // likely layered under window controls, so we accommodate space for
+ // them like a tab strip would.
+ gfx::Rect tab_strip_region_bounds(
+ delegate_->GetBoundsForToolbarInVerticalTabBrowserView());
+ int height = toolbar_visible ? toolbar_->GetPreferredSize().height() : 0;
+ toolbar_->SetBounds(tab_strip_region_bounds.x(), available_bounds.y(),
+ tab_strip_region_bounds.width(), height);
} else {
int height = toolbar_visible ? toolbar_->GetPreferredSize().height() : 0;
int width = available_bounds.width();
--- a/chrome/browser/ui/views/toolbar/toolbar_view.cc
+++ b/chrome/browser/ui/views/toolbar/toolbar_view.cc
@@ -57,6 +57,7 @@
#include "chrome/browser/ui/views/extensions/extensions_toolbar_coordinator.h"
#include "chrome/browser/ui/views/frame/browser_frame_view.h"
#include "chrome/browser/ui/views/frame/browser_view.h"
+#include "chrome/browser/ui/views/frame/tab_strip_region_view.h"
#include "chrome/browser/ui/views/frame/top_container_background.h"
#include "chrome/browser/ui/views/global_media_controls/media_toolbar_button_contextual_menu.h"
#include "chrome/browser/ui/views/global_media_controls/media_toolbar_button_view.h"
@@ -144,6 +145,8 @@ DEFINE_UI_CLASS_PROPERTY_KEY(bool, kActi
namespace {
+constexpr int kPreferredCompactWidth = 350;
+
// Gets the display mode for a given browser.
ToolbarView::DisplayMode GetDisplayMode(Browser* browser) {
#if BUILDFLAG(IS_CHROMEOS)
@@ -534,6 +537,26 @@ void ToolbarView::Init() {
reload_->SetVisible(show_reload_button_.GetValue());
+ // Tab strip should be in the toolbar only when the CAT feature is enabled.
+ if (features::IsHeliumCatEnabled()) {
+ auto tab_strip_region_view =
+ std::make_unique<TabStripRegionView>(browser_view_);
+ tab_strip_region_view_ = tab_strip_region_view.get();
+
+ // Add the tab strip region view to the container view right after
+ // the location bar if it's present.
+ auto location_bar_index = location_bar_ ?
+ container_view_->GetIndexOf(location_bar_) :
+ std::nullopt;
+
+ if (location_bar_index) {
+ container_view_->AddChildViewAt(std::move(tab_strip_region_view),
+ *location_bar_index + 1);
+ } else {
+ container_view_->AddChildView(std::move(tab_strip_region_view));
+ }
+ }
+
show_avatar_button_.Init(
prefs::kShowAvatarButton, prefs,
base::BindRepeating(&ToolbarView::OnShowAvatarButtonChanged,
@@ -564,12 +587,24 @@ void ToolbarView::Init() {
InitLayout();
+ auto flex_preferred = views::FlexSpecification(
+ views::MinimumFlexSizeRule::kPreferred,
+ views::MaximumFlexSizeRule::kPreferred);
+
for (auto* button : std::array<views::Button*, 5>{back_, forward_, reload_,
home_, avatar_}) {
if (button) {
button->set_tag(GetViewCommandMap().at(button->GetID()));
+ button->SetProperty(views::kFlexBehaviorKey, flex_preferred);
}
}
+
+ // Pinned actions (including downloads) should not shrink in CAT layout.
+ if (features::IsHeliumCatEnabled()) {
+ pinned_toolbar_actions_container_->SetProperty(
+ views::kFlexBehaviorKey, flex_preferred);
+ }
+
if (browser_view_->GetSupportsTabStrip()) {
browser()->GetTabStripModel()->AddObserver(this);
}
@@ -700,6 +735,24 @@ bool ToolbarView::IsRectInWindowCaption(
return gfx::ToEnclosingRect(rect_in_target_coords_f);
};
+ // Check the tab strip region first if CAT is enabled.
+ if (features::IsHeliumCatEnabled() && tab_strip_region_view_) {
+ const gfx::Rect tab_strip_rect = get_target_rect(tab_strip_region_view_);
+ if (tab_strip_region_view_->GetLocalBounds().Intersects(tab_strip_rect)) {
+ // Check if the rect is actually on the tab strip region view.
+ if (tab_strip_region_view_->HitTestRect(tab_strip_rect)) {
+ auto* tab_strip_region =
+ static_cast<TabStripRegionView*>(tab_strip_region_view_);
+
+ if (tab_strip_region->IsPositionInWindowCaption(tab_strip_rect.origin())) {
+ return true;
+ }
+
+ return false;
+ }
+ }
+ }
+
// Check each child view in container_view_ to see if the rect intersects with
// any clickable elements. If it does, check if the click is actually on that
// element. False if on a clickable element, true if not on a clickable element.
@@ -981,8 +1034,12 @@ void ToolbarView::InitLayout() {
constexpr int kToolbarActionsFlexOrder = kOrderOffset + 2;
constexpr int kExtensionsFlexOrder = kOrderOffset + 3;
+ auto min_location_bar_flex = features::IsHeliumCatFixedAddressBar() ?
+ views::MinimumFlexSizeRule::kPreferred :
+ views::MinimumFlexSizeRule::kScaleToMinimum;
+
const views::FlexSpecification location_bar_flex_rule =
- views::FlexSpecification(views::MinimumFlexSizeRule::kScaleToMinimum,
+ views::FlexSpecification(min_location_bar_flex,
views::MaximumFlexSizeRule::kUnbounded)
.WithOrder(kLocationBarFlexOrder);
@@ -998,6 +1055,12 @@ void ToolbarView::InitLayout() {
location_bar_->SetProperty(views::kMarginsKey,
gfx::Insets::VH(0, location_bar_margin));
+ if (features::IsHeliumCatEnabled()) {
+ location_bar_->SetPreferredSize(gfx::Size(kPreferredCompactWidth, 0));
+ location_bar_->SetProperty(views::kMarginsKey,
+ gfx::Insets::TLBR(0, location_bar_margin, 0, 0));
+ }
+
if (extensions_container_) {
const views::FlexSpecification extensions_flex_rule =
views::FlexSpecification(
--- a/chrome/browser/ui/views/toolbar/toolbar_view.h
+++ b/chrome/browser/ui/views/toolbar/toolbar_view.h
@@ -146,6 +146,9 @@ class ToolbarView : public views::Access
// Shows a bookmark bubble and anchors it appropriately.
void ShowBookmarkBubble(const GURL& url, bool already_bookmarked);
+ // Returns the tab strip region view if CAT feature is enabled, nullptr otherwise.
+ views::View* GetTabStripRegionView() const { return tab_strip_region_view_.get(); }
+
// Accessors.
Browser* browser() const { return browser_; }
views::Button* GetChromeLabsButton() const;
@@ -322,6 +325,7 @@ class ToolbarView : public views::Access
raw_ptr<BrowserAppMenuButton> app_menu_button_ = nullptr;
raw_ptr<views::View> new_tab_button_ = nullptr;
raw_ptr<PinnedActionToolbarButton> tab_search_button_ = nullptr;
+ raw_ptr<views::View> tab_strip_region_view_ = nullptr;
const raw_ptr<Browser> browser_;
const raw_ptr<BrowserView> browser_view_;
--- a/chrome/browser/ui/layout_constants.cc
+++ b/chrome/browser/ui/layout_constants.cc
@@ -187,6 +187,11 @@ gfx::Insets GetLayoutInsets(LayoutInset
case TOOLBAR_INTERIOR_MARGIN: {
const int vert = GetLayoutConstant(TOP_BAR_VERTICAL_PADDING);
const int horiz = vert * 2;
+
+ if (features::IsHeliumCatEnabled()) {
+ return gfx::Insets::VH(vert, horiz + vert);
+ }
+
return touch_ui ? gfx::Insets() :
gfx::Insets::TLBR(0, horiz, vert, horiz);
}
--- a/chrome/browser/ui/views/omnibox/omnibox_view_views.cc
+++ b/chrome/browser/ui/views/omnibox/omnibox_view_views.cc
@@ -616,7 +616,7 @@ int OmniboxViewViews::GetUnelidedTextWid
}
gfx::Size OmniboxViewViews::GetMinimumSize() const {
- constexpr int kMinCharacters = 20;
+ constexpr int kMinCharacters = 32;
return gfx::Size(
GetFontList().GetExpectedTextWidth(kMinCharacters) + GetInsets().width(),
GetPreferredSize().height());
+132
View File
@@ -0,0 +1,132 @@
--- a/chrome/browser/ui/views/toolbar/toolbar_view.cc
+++ b/chrome/browser/ui/views/toolbar/toolbar_view.cc
@@ -1162,18 +1162,7 @@ AppMenuButton* ToolbarView::GetAppMenuBu
}
gfx::Rect ToolbarView::GetFindBarBoundingBox(int contents_bottom) {
- if (!browser_->SupportsWindowFeature(Browser::FEATURE_LOCATIONBAR)) {
- return gfx::Rect();
- }
-
- if (!location_bar_->IsDrawn()) {
- return gfx::Rect();
- }
-
- gfx::Rect bounds =
- location_bar_->ConvertRectToWidget(location_bar_->GetLocalBounds());
- return gfx::Rect(bounds.x(), bounds.bottom(), bounds.width(),
- contents_bottom - bounds.bottom());
+ return gfx::Rect();
}
void ToolbarView::FocusToolbar() {
--- a/chrome/browser/ui/views/location_bar/location_bar_view.cc
+++ b/chrome/browser/ui/views/location_bar/location_bar_view.cc
@@ -428,7 +428,6 @@ void LocationBarView::Init() {
params.types_enabled.push_back(PageActionIconType::kIntentPicker);
}
params.types_enabled.push_back(PageActionIconType::kPwaInstall);
- params.types_enabled.push_back(PageActionIconType::kFind);
params.types_enabled.push_back(PageActionIconType::kTranslate);
params.types_enabled.push_back(PageActionIconType::kZoom);
params.types_enabled.push_back(PageActionIconType::kFileSystemAccess);
--- a/chrome/browser/ui/find_bar/find_bar_controller.cc
+++ b/chrome/browser/ui/find_bar/find_bar_controller.cc
@@ -323,25 +323,4 @@ std::u16string FindBarController::GetSel
return selected_text;
}
-void FindBarController::UpdatePageAction() {
- CHECK(IsPageActionMigrated(PageActionIconType::kFind));
- tabs::TabInterface* tab = tabs::TabInterface::GetFromContents(web_contents());
- tabs::TabFeatures* tab_features = tab->GetTabFeatures();
- if (!tab_features) {
- return;
- }
- // Page actions don't exist for non-normal windows.
- page_actions::PageActionController* controller =
- tab_features->page_action_controller();
- if (!controller) {
- return;
- }
-
- if (!find_bar_->IsFindBarVisible()) {
- find_bar_page_action_activity_.reset();
- controller->Hide(kActionFind);
- } else {
- controller->Show(kActionFind);
- find_bar_page_action_activity_ = controller->AddActivity(kActionFind);
- }
-}
+void FindBarController::UpdatePageAction() {}
--- a/chrome/browser/ui/views/find_bar_host.cc
+++ b/chrome/browser/ui/views/find_bar_host.cc
@@ -627,11 +627,11 @@ gfx::Rect FindBarHost::GetDialogPosition
// Place the view in the top right corner of the widget boundaries (top left
// for RTL languages). Adjust for the view insets to ensure the border lines
// up with the location bar.
- int x = find_bar_bounds.x() - insets.left();
+ int x = find_bar_bounds.x();
if (!base::i18n::IsRTL()) {
x += find_bar_bounds.width() - prefsize.width() + insets.width();
}
- int y = find_bar_bounds.y() - insets.top();
+ int y = find_bar_bounds.y();
const gfx::Rect view_location(x, y, prefsize.width(), prefsize.height());
// When we get Find results back, we specify a selection rect, which we
--- a/chrome/browser/ui/views/find_bar_view.cc
+++ b/chrome/browser/ui/views/find_bar_view.cc
@@ -65,6 +65,10 @@ void SetCommonButtonAttributes(views::Im
views::ConfigureVectorImageButton(button);
views::InstallCircleHighlightPathGenerator(button);
}
+
+constexpr int kBasePadding = 4;
+constexpr int kHorizontalGap = 6;
+
} // namespace
DEFINE_CLASS_ELEMENT_IDENTIFIER_VALUE(FindBarView, kElementId);
@@ -164,18 +168,14 @@ FindBarView::FindBarView(FindBarHost* ho
ChromeLayoutProvider* layout_provider = ChromeLayoutProvider::Get();
const auto horizontal_margin =
- gfx::Insets::VH(0, layout_provider->GetDistanceMetric(
- views::DISTANCE_UNRELATED_CONTROL_HORIZONTAL) /
- 2);
+ gfx::Insets::VH(0, kHorizontalGap);
const gfx::Insets vector_button =
layout_provider->GetInsetsMetric(views::INSETS_VECTOR_IMAGE_BUTTON);
const auto vector_button_horizontal_margin =
gfx::Insets::TLBR(0, horizontal_margin.left() - vector_button.left(), 0,
horizontal_margin.right() - vector_button.right());
- const auto toast_control_vertical_margin = gfx::Insets::VH(
- layout_provider->GetDistanceMetric(DISTANCE_TOAST_CONTROL_VERTICAL), 0);
- const auto toast_label_vertical_margin = gfx::Insets::VH(
- layout_provider->GetDistanceMetric(DISTANCE_TOAST_LABEL_VERTICAL), 0);
+ const auto toast_control_vertical_margin = gfx::Insets::VH(kBasePadding, 0);
+ const auto toast_label_vertical_margin = gfx::Insets::VH(kBasePadding, 0);
const auto image_button_margins =
toast_control_vertical_margin + vector_button_horizontal_margin;
@@ -197,8 +197,7 @@ FindBarView::FindBarView(FindBarHost* ho
views::Builder<views::BoxLayoutView>()
.SetOrientation(views::BoxLayout::Orientation::kHorizontal)
.SetInsideBorderInsets(
- gfx::Insets(layout_provider->GetInsetsMetric(INSETS_TOAST) -
- horizontal_margin))
+ gfx::Insets::VH(0, kBasePadding * 2))
.AddChildren(
views::Builder<views::Textfield>()
.CopyAddressTo(&find_text_)
@@ -292,8 +291,7 @@ FindBarView::FindBarView(FindBarHost* ho
auto border = std::make_unique<views::BubbleBorder>(
views::BubbleBorder::NONE, views::BubbleBorder::STANDARD_SHADOW);
border->SetColor(kColorFindBarBackground);
- border->set_md_shadow_elevation(
- layout_provider->GetCornerRadiusMetric(views::Emphasis::kHigh));
+ border->set_md_shadow_elevation(kBasePadding);
border->set_rounded_corners(gfx::RoundedCornersF(corner_radius));
SetBackground(std::make_unique<views::BubbleBackground>(border.get()));
@@ -0,0 +1,29 @@
--- a/chrome/browser/ui/views/frame/browser_frame_view_mac.mm
+++ b/chrome/browser/ui/views/frame/browser_frame_view_mac.mm
@@ -186,7 +186,7 @@ gfx::Rect BrowserFrameViewMac::GetBounds
// The bottom curve of the first/last tab swoops into the caption button
// region, so account for this when calculating insets.
const gfx::Insets insets = GetCaptionButtonInsets(
- /*visual_overlap=*/TabStyle::Get()->GetBottomCornerRadius());
+ /*visual_overlap=*/TabStyle::Get()->GetBottomCornerRadius() / 2);
bounds.Inset(insets);
}
--- a/chrome/browser/ui/views/frame/browser_frame_view_win.cc
+++ b/chrome/browser/ui/views/frame/browser_frame_view_win.cc
@@ -234,10 +234,13 @@ bool BrowserFrameViewWin::CaptionButtons
gfx::Rect BrowserFrameViewWin::GetBoundsForTabStripRegion(
const gfx::Size& tabstrip_minimum_size) const {
- const int x = CaptionButtonsOnLeadingEdge() ? CaptionButtonsRegionWidth() : 0;
+ const int x = CaptionButtonsOnLeadingEdge() ?
+ CaptionButtonsRegionWidth() :
+ GetLayoutConstant(TOOLBAR_CORNER_RADIUS);
int end_x = width();
if (!CaptionButtonsOnLeadingEdge()) {
- end_x = std::min(width() - CaptionButtonsRegionWidth(), end_x);
+ end_x = std::min(width() - CaptionButtonsRegionWidth() -
+ GetLayoutConstant(TOOLBAR_CORNER_RADIUS), end_x);
}
return gfx::Rect(x, TopAreaHeight(false), std::max(0, end_x - x),
tabstrip_minimum_size.height());
+76 -16
View File
@@ -1,15 +1,24 @@
--- a/chrome/browser/ui/layout_constants.cc
+++ b/chrome/browser/ui/layout_constants.cc
@@ -29,7 +29,7 @@ int GetLayoutConstant(LayoutConstant con
@@ -22,6 +22,8 @@
int GetLayoutConstant(LayoutConstant constant) {
const bool touch_ui = ui::TouchUiController::Get()->touch_ui();
switch (constant) {
+ case TOP_BAR_VERTICAL_PADDING:
+ return 3;
case APP_MENU_PROFILE_ROW_AVATAR_ICON_SIZE:
return 24;
case APP_MENU_MAXIMUM_CHARACTER_LENGTH:
@@ -29,7 +31,7 @@ int GetLayoutConstant(LayoutConstant con
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 = 6;
+ const int bookmark_bar_attached_vertical_margin = 3;
+ const int bookmark_bar_attached_vertical_margin = GetLayoutConstant(TOP_BAR_VERTICAL_PADDING);
return GetLayoutConstant(BOOKMARK_BAR_BUTTON_HEIGHT) +
bookmark_bar_attached_vertical_margin;
}
@@ -52,7 +52,7 @@ int GetLayoutConstant(LayoutConstant con
@@ -52,7 +54,7 @@ int GetLayoutConstant(LayoutConstant con
case LOCATION_BAR_CHILD_INTERIOR_PADDING:
return 3;
case LOCATION_BAR_CHILD_CORNER_RADIUS:
@@ -18,7 +27,7 @@
case LOCATION_BAR_CHIP_ICON_SIZE:
return 16;
case LOCATION_BAR_CHIP_PADDING:
@@ -60,7 +60,7 @@ int GetLayoutConstant(LayoutConstant con
@@ -60,7 +62,7 @@ int GetLayoutConstant(LayoutConstant con
case LOCATION_BAR_ELEMENT_PADDING:
return touch_ui ? 3 : 2;
case LOCATION_BAR_PAGE_INFO_ICON_VERTICAL_PADDING:
@@ -27,7 +36,7 @@
case LOCATION_BAR_LEADING_DECORATION_EDGE_PADDING:
// TODO(manukh): See comment in `LocationBarView::Layout()`. We have too
// many feature permutations that would affect this and other layout
@@ -69,11 +69,11 @@ int GetLayoutConstant(LayoutConstant con
@@ -69,19 +71,19 @@ int GetLayoutConstant(LayoutConstant con
// here once we decide on a permutation.
NOTREACHED();
case LOCATION_BAR_TRAILING_DECORATION_EDGE_PADDING:
@@ -41,7 +50,17 @@
case LOCATION_BAR_ICON_SIZE:
return touch_ui ? 20 : 16;
case LOCATION_BAR_LEADING_ICON_SIZE:
@@ -93,12 +93,12 @@ int GetLayoutConstant(LayoutConstant con
return GetLayoutConstant(LOCATION_BAR_ICON_SIZE);
case LOCATION_BAR_TRAILING_ICON_SIZE:
- return 20;
+ return 18;
case NEW_TAB_BUTTON_LEADING_MARGIN:
- return 0;
+ return 4;
case STAR_RATING_ICON_SIZE:
return 14;
case TAB_AFTER_TITLE_PADDING:
@@ -93,47 +95,43 @@ int GetLayoutConstant(LayoutConstant con
case TAB_CLOSE_BUTTON_SIZE:
return touch_ui ? 24 : 16;
case TAB_HEIGHT:
@@ -52,11 +71,12 @@
GetLayoutConstant(TAB_STRIP_PADDING);
case TAB_STRIP_PADDING:
- return 6;
+ return 3;
+ return GetLayoutConstant(TOP_BAR_VERTICAL_PADDING);
case TAB_SEPARATOR_HEIGHT:
return touch_ui ? 24 : 20;
case TAB_PRE_TITLE_PADDING:
@@ -106,28 +106,23 @@ int GetLayoutConstant(LayoutConstant con
- return 8;
+ return 6;
case TAB_STACK_DISTANCE:
return touch_ui ? 4 : 6;
case TABSTRIP_TOOLBAR_OVERLAP:
@@ -76,23 +96,47 @@
return touch_ui ? 20 : 16;
case TOOLBAR_DIVIDER_SPACING:
- return 9;
+ return 6;
+ return GetLayoutConstant(TOP_BAR_VERTICAL_PADDING) * 2;
case TOOLBAR_DIVIDER_WIDTH:
- return 2;
+ return 1;
case TOOLBAR_ELEMENT_PADDING:
- return touch_ui ? 0 : 4;
+ return touch_ui ? 0 : 3;
+ return touch_ui ? 0 : GetLayoutConstant(TOP_BAR_VERTICAL_PADDING);
case TOOLBAR_ICON_DEFAULT_MARGIN:
- return touch_ui ? 0 : 2;
+ return touch_ui ? 0 : 3;
+ return touch_ui ? 0 : GetLayoutConstant(TOP_BAR_VERTICAL_PADDING);
case TOOLBAR_STANDARD_SPACING:
- return touch_ui ? 12 : 9;
+ return touch_ui ? 12 : 6;
+ return touch_ui ? 12 : GetLayoutConstant(TOP_BAR_VERTICAL_PADDING) * 2;
case PAGE_INFO_ICON_SIZE:
return 20;
case DOWNLOAD_ICON_SIZE:
@@ -167,7 +162,7 @@ gfx::Insets GetLayoutInsets(LayoutInset
return 20;
+ // Used for the tab strip offset.
case TOOLBAR_CORNER_RADIUS:
- return 8;
+ return 2;
case VERTICAL_TAB_STRIP_HORIZONTAL_PADDING:
return 12;
default:
@@ -152,13 +150,13 @@ gfx::Insets GetLayoutInsets(LayoutInset
return gfx::Insets::VH(8, 20);
case LOCATION_BAR_ICON_INTERIOR_PADDING:
- return gfx::Insets::VH(2, 2);
+ return gfx::Insets::VH(2, 3);
case LOCATION_BAR_PAGE_INFO_ICON_PADDING:
return touch_ui ? gfx::Insets::VH(5, 10) : gfx::Insets::VH(4, 4);
case LOCATION_BAR_PAGE_ACTION_ICON_PADDING:
- return touch_ui ? gfx::Insets::VH(5, 10) : gfx::Insets::VH(2, 2);
+ return GetLayoutInsets(LOCATION_BAR_ICON_INTERIOR_PADDING);
case TOOLBAR_ACTION_VIEW: {
// TODO(afakhry): Unify all toolbar button sizes on all platforms.
@@ -167,7 +165,7 @@ gfx::Insets GetLayoutInsets(LayoutInset
}
case TOOLBAR_BUTTON:
@@ -101,7 +145,7 @@
case BROWSER_APP_MENU_CHIP_PADDING:
if (touch_ui) {
@@ -183,11 +178,11 @@ gfx::Insets GetLayoutInsets(LayoutInset
@@ -183,11 +181,15 @@ gfx::Insets GetLayoutInsets(LayoutInset
if (touch_ui) {
return GetLayoutInsets(TOOLBAR_BUTTON);
} else {
@@ -109,9 +153,25 @@
+ return gfx::Insets::TLBR(4, 5, 4, 4);
}
case TOOLBAR_INTERIOR_MARGIN:
- case TOOLBAR_INTERIOR_MARGIN:
- return touch_ui ? gfx::Insets::VH(4, 0) : gfx::Insets::VH(6, 5);
+ return touch_ui ? gfx::Insets() : gfx::Insets::TLBR(0, 6, 3, 6);
+ case TOOLBAR_INTERIOR_MARGIN: {
+ const int vert = GetLayoutConstant(TOP_BAR_VERTICAL_PADDING);
+ const int horiz = vert * 2;
+ return touch_ui ? gfx::Insets() :
+ gfx::Insets::TLBR(0, horiz, vert, horiz);
+ }
case WEBUI_TAB_STRIP_TOOLBAR_INTERIOR_MARGIN:
return gfx::Insets::VH(4, 0);
--- a/chrome/browser/ui/layout_constants.h
+++ b/chrome/browser/ui/layout_constants.h
@@ -10,6 +10,8 @@
#include "ui/gfx/geometry/size.h"
enum LayoutConstant {
+ // The vertical padding of the tab strip and the toolbar.
+ TOP_BAR_VERTICAL_PADDING,
// The size of the avatar icon in the profile row of the app menu.
APP_MENU_PROFILE_ROW_AVATAR_ICON_SIZE,
@@ -0,0 +1,30 @@
--- a/chrome/browser/ui/views/location_bar/intent_chip_button.cc
+++ b/chrome/browser/ui/views/location_bar/intent_chip_button.cc
@@ -87,14 +87,10 @@ bool IntentChipButton::GetShowChip() con
}
bool IntentChipButton::GetChipExpanded() const {
- auto* tab_helper = GetTabHelper();
- return tab_helper && tab_helper->ShouldShowExpandedChip();
+ return false;
}
ui::ImageModel IntentChipButton::GetAppIcon() const {
- if (auto* tab_helper = GetTabHelper()) {
- return tab_helper->app_icon();
- }
return ui::ImageModel();
}
--- a/chrome/browser/ui/views/location_bar/omnibox_chip_button.cc
+++ b/chrome/browser/ui/views/location_bar/omnibox_chip_button.cc
@@ -56,8 +56,7 @@ OmniboxChipButton::OmniboxChipButton(Pre
SetFocusBehavior(views::View::FocusBehavior::ALWAYS);
// Equalizing padding on the left, right and between icon and label.
SetImageLabelSpacing(kChipImagePadding);
- SetCustomPadding(
- gfx::Insets::VH(kChipVerticalPadding, kChipHorizontalPadding));
+ SetCustomPadding(GetLayoutInsets(LOCATION_BAR_PAGE_ACTION_ICON_PADDING));
label()->SetTextStyle(views::style::STYLE_BODY_4_EMPHASIS);
SetCornerRadius(GetLayoutConstant(LOCATION_BAR_CHILD_CORNER_RADIUS));
animation_ = std::make_unique<gfx::SlideAnimation>(this);
+22
View File
@@ -76,6 +76,19 @@
--- a/chrome/browser/ui/views/location_bar/location_bar_view.cc
+++ b/chrome/browser/ui/views/location_bar/location_bar_view.cc
@@ -194,10 +194,10 @@ int IncrementalMinimumWidth(const views:
}
// The padding between the intent chip and the other trailing decorations.
-constexpr int kIntentChipIntraItemPadding = 12;
+constexpr int kIntentChipIntraItemPadding = 4;
// The padding between the content setting icons and other trailing decorations.
-constexpr int kContentSettingIntraItemPadding = 8;
+constexpr int kContentSettingIntraItemPadding = kIntentChipIntraItemPadding;
} // namespace
@@ -231,7 +231,10 @@ LocationBarView::LocationBarView(Browser
!v->GetOmniboxPopupView()->IsOpen();
}));
@@ -100,6 +113,15 @@
auto location_icon_view =
std::make_unique<LocationIconView>(omnibox_chip_font_list, this, this);
@@ -395,7 +398,7 @@ void LocationBarView::Init() {
}
}
- static constexpr int kBetweenIconSpacing = 8;
+ static constexpr int kBetweenIconSpacing = kIntentChipIntraItemPadding;
const page_actions::PageActionViewParams page_action_params{
.icon_size = GetLayoutConstant(LOCATION_BAR_TRAILING_ICON_SIZE),
.icon_insets = GetLayoutInsets(LOCATION_BAR_PAGE_ACTION_ICON_PADDING),
@@ -416,21 +419,11 @@ void LocationBarView::Init() {
// first so that they appear on the left side of the icon container.
// TODO(crbug.com/40835681): Improve the ordering heuristics for page action
+9 -35
View File
@@ -9,18 +9,7 @@
#if !defined(USE_AURA)
@@ -168,7 +168,9 @@ class TopBackgroundView : public views::
// not antialiased, since the goal is to completely cover the underlying
// pixels, and AA would let those on the edge partly bleed through.
SetBackground(location_bar_->CreateRoundRectBackground(
- SK_ColorTRANSPARENT, background_color, SkBlendMode::kSrc, false));
+ SK_ColorTRANSPARENT, background_color, SkBlendMode::kSrc,
+ /*antialias=*/false,
+ /*should_border_scale=*/true));
}
#if !defined(USE_AURA)
@@ -230,8 +232,7 @@ RoundedOmniboxResultsFrame::RoundedOmnib
@@ -230,8 +230,7 @@ RoundedOmniboxResultsFrame::RoundedOmnib
LocationBarView* location_bar,
bool include_cutout)
: contents_(contents), include_cutout_(include_cutout) {
@@ -30,15 +19,7 @@
// Host the contents in its own View to simplify layout and customization.
auto contents_host_builder =
views::Builder<views::View>()
@@ -263,6 +264,7 @@ RoundedOmniboxResultsFrame::RoundedOmnib
views::BubbleBorder::Shadow::STANDARD_SHADOW);
border->set_rounded_corners(gfx::RoundedCornersF(corner_radius));
border->set_md_shadow_elevation(kElevation);
+ border->set_draw_border_stroke(true);
SetBorder(std::move(border));
AddChildView(std::move(contents_host));
@@ -300,10 +302,10 @@ int RoundedOmniboxResultsFrame::GetNonRe
@@ -300,10 +299,10 @@ int RoundedOmniboxResultsFrame::GetNonRe
// static
gfx::Insets RoundedOmniboxResultsFrame::GetLocationBarAlignmentInsets() {
@@ -47,19 +28,10 @@
return gfx::Insets::TLBR(6, 1, 5, 1);
}
- return gfx::Insets::VH(5, 6);
+ return gfx::Insets::VH(3, 8);
+ return gfx::Insets::TLBR(3, 7, 0, 7);
}
// static
@@ -378,7 +380,7 @@ void RoundedOmniboxResultsFrame::OnMouse
// Insets used to position |contents_| within |contents_host_|.
gfx::Insets RoundedOmniboxResultsFrame::GetContentInsets() {
- return gfx::Insets::TLBR(GetNonResultSectionHeight(include_cutout_), 0, 0, 0);
+ return gfx::Insets::TLBR(GetNonResultSectionHeight(include_cutout_) - 4, 0, 0, 0);
}
BEGIN_METADATA(RoundedOmniboxResultsFrame)
--- a/chrome/browser/ui/views/omnibox/omnibox_result_view.cc
+++ b/chrome/browser/ui/views/omnibox/omnibox_result_view.cc
@@ -198,9 +198,6 @@ OmniboxResultView::OmniboxResultView(Omn
@@ -93,7 +65,7 @@
return views::CreateRoundedRectBackground(
- GetOmniboxBackgroundColorId(part_state), radii);
+ GetOmniboxBackgroundColorId(part_state),
+ kIPHBackgroundBorderRadius);
+ kIPHBackgroundBorderRadius);
}
void OmniboxResultView::SetMatch(const AutocompleteMatch& match) {
@@ -195,7 +167,7 @@
- int extra_bottom_padding =
- GetMatchAtIndex(last_result_index).IsToolbelt() ? 2 : 8;
- popup_height += extra_bottom_padding;
+ popup_height += 2;
+ popup_height += 4;
}
// Add enough space on the top and bottom so it looks like there is the same
@@ -219,18 +191,20 @@
gfx::Insets button_insets_ =
gfx::Insets::TLBR(0, 0, 0,
ChromeLayoutProvider::Get()->GetDistanceMetric(
@@ -299,9 +299,8 @@ class OmniboxSuggestionRowButton : publi
@@ -299,10 +299,9 @@ class OmniboxSuggestionRowButton : publi
ui::EF_MIDDLE_MOUSE_BUTTON);
views::InstallPillHighlightPathGenerator(this);
- SetImageLabelSpacing(8);
- SetCustomPadding(ChromeLayoutProvider::Get()->GetInsetsMetric(
- INSETS_OMNIBOX_PILL_BUTTON));
- SetCornerRadius(GetLayoutConstant(TOOLBAR_CORNER_RADIUS));
+ SetImageLabelSpacing(6);
+ SetCustomPadding(gfx::Insets::VH(3, 8));
SetCornerRadius(GetLayoutConstant(TOOLBAR_CORNER_RADIUS));
+ SetCornerRadius(8);
auto* const ink_drop = views::InkDrop::Get(this);
SetAnimationDuration(base::TimeDelta());
@@ -314,6 +313,7 @@ class OmniboxSuggestionRowButton : publi
CHECK(v);
return v->GetVisible() && v->popup_view_->GetSelection() == v->selection_;
+115 -17
View File
@@ -7,18 +7,18 @@
-constexpr int kChromeRefreshSeparatorThickness = 2;
-constexpr int kChromeRefreshSeparatorHorizontalMargin = 2;
+constexpr int kChromeRefreshSeparatorThickness = 1;
+constexpr int kChromeRefreshSeparatorHorizontalMargin = 1;
+constexpr int kChromeRefreshSeparatorHorizontalMargin = 5;
// TODO (crbug.com/1451400): This constant should be in LayoutConstants.
constexpr int kChromeRefreshSeparatorHeight = 16;
// The padding from the top of the tab to the content area.
constexpr int kChromeRefreshTabVerticalPadding = 6;
-constexpr int kChromeRefreshTabHorizontalPadding = 8;
+constexpr int kChromeRefreshTabHorizontalPadding = 7;
+constexpr int kChromeRefreshTabHorizontalPadding = 2;
// The standard tab width is 232 DIP, excluding separators and overlap.
-constexpr int kTabWidth = 232;
+constexpr int kTabWidth = 200;
+constexpr int kTabWidth = 190;
+
+// Split tabs need more space to be readable
+constexpr int kSplitTabWidth = 250;
@@ -59,7 +59,15 @@
// We'll do the entire path calculation in aligned pixels.
// TODO(dfried): determine if we actually want to use `stroke_thickness` as
// the inset in this case.
@@ -224,11 +222,7 @@ SkPath TabStyleViewsImpl::GetPath(TabSty
@@ -217,18 +215,14 @@ SkPath TabStyleViewsImpl::GetPath(TabSty
// tab width (in DIP), not our new, scaled-and-aligned bounds.
float content_corner_radius =
GetTopCornerRadiusForWidth(tab()->width()) * scale;
- float extension_corner_radius = tab_style()->GetBottomCornerRadius() * scale;
+ float extension_corner_radius = 4 * scale;
const float separator_overlap = (tab_style()->GetSeparatorMargins().width() +
tab_style()->GetSeparatorSize().width()) *
scale;
// Selected, hover, and inactive tab fills are a detached squarcle tab.
@@ -188,28 +196,41 @@
--- a/chrome/browser/ui/views/tabs/tab_group_style.cc
+++ b/chrome/browser/ui/views/tabs/tab_group_style.cc
@@ -32,7 +32,7 @@ constexpr int kAttentionIndicatorWidth =
// The size of the empty chip.
constexpr int kEmptyChipSize = 20;
constexpr int kCornerRadius = 6;
-constexpr int kTabGroupOverlapAdjustment = 2;
+constexpr int kTabGroupOverlapAdjustment = 3;
} // namespace
@@ -91,7 +91,7 @@ gfx::Point TabGroupStyle::GetTitleChipOf
const int total_space = GetLayoutConstant(TAB_STRIP_HEIGHT) -
GetEmptyChipSize() -
GetLayoutConstant(TABSTRIP_TOOLBAR_OVERLAP);
- return gfx::Point(TabStyle::Get()->GetTabOverlap() - 2, total_space / 2);
+ return gfx::Point(TabStyle::Get()->GetTabOverlap() + 2, total_space / 2);
}
std::unique_ptr<views::Background> TabGroupStyle::GetEmptyTitleChipBackground(
--- a/chrome/browser/ui/views/tabs/tab_group_underline.cc
+++ b/chrome/browser/ui/views/tabs/tab_group_underline.cc
@@ -93,21 +93,17 @@ gfx::Insets TabGroupUnderline::GetInsets
@@ -80,10 +80,7 @@ gfx::Rect TabGroupUnderline::CalculateTa
gfx::Rect group_bounds = ToEnclosingRect(leading_bounds);
group_bounds.UnionEvenIfEmpty(ToEnclosingRect(trailing_bounds));
- const int y =
- group_bounds.bottom() - GetLayoutConstant(TABSTRIP_TOOLBAR_OVERLAP);
-
- return gfx::Rect(group_bounds.x(), y - kStrokeThickness, group_bounds.width(),
+ return gfx::Rect(group_bounds.x(), 0, group_bounds.width(),
kStrokeThickness);
}
@@ -93,22 +90,19 @@ gfx::Insets TabGroupUnderline::GetInsets
// the group, and may be the right boundary if the group is collapsed.
const TabGroupHeader* const header =
views::AsViewClass<TabGroupHeader>(sibling_view);
+
+ const int left_offset = 3;
+ const int left_offset = 8;
+ const int right_offset = left_offset - 3;
if (header) {
- return gfx::Insets::TLBR(0, TabGroupUnderline::GetStrokeInset(), 0,
- TabGroupUnderline::GetStrokeInset());
+ return gfx::Insets::TLBR(0, TabGroupUnderline::GetStrokeInset() + left_offset,
+ 0, TabGroupUnderline::GetStrokeInset());
+ 0, TabGroupUnderline::GetStrokeInset() + right_offset);
}
const Tab* const tab = views::AsViewClass<Tab>(sibling_view);
@@ -222,11 +243,13 @@
-
- // Inactive tabs are inset like group headers.
- const int left_inset = TabGroupUnderline::GetStrokeInset();
- const int right_inset = TabGroupUnderline::GetStrokeInset();
+ const int left_inset = TabGroupUnderline::GetStrokeInset() + left_offset;
const int right_inset = TabGroupUnderline::GetStrokeInset();
+ const int right_inset = TabGroupUnderline::GetStrokeInset() + right_offset;
return gfx::Insets::TLBR(0, left_inset, 0, right_inset);
@@ -119,8 +115,7 @@ void TabGroupUnderline::MaybeSetVisible(
}
@@ -119,8 +113,7 @@ void TabGroupUnderline::MaybeSetVisible(
// static
int TabGroupUnderline::GetStrokeInset() {
@@ -236,3 +259,78 @@
}
BEGIN_METADATA(TabGroupUnderline)
--- a/chrome/browser/ui/views/tabs/tab_group_underline.h
+++ b/chrome/browser/ui/views/tabs/tab_group_underline.h
@@ -25,8 +25,7 @@ class TabGroupUnderline : public views::
METADATA_HEADER(TabGroupUnderline, views::View)
public:
- static constexpr int kStrokeThickness =
- views::FocusRing::kDefaultHaloThickness;
+ static constexpr int kStrokeThickness = 1;
static int GetStrokeInset();
--- a/chrome/browser/ui/views/tabs/tab_group_header.cc
+++ b/chrome/browser/ui/views/tabs/tab_group_header.cc
@@ -22,6 +22,7 @@
#include "chrome/browser/ui/color/chrome_color_id.h"
#include "chrome/browser/ui/layout_constants.h"
#include "chrome/browser/ui/tabs/saved_tab_groups/saved_tab_group_utils.h"
+#include "chrome/browser/ui/tabs/tab_group_theme.h"
#include "chrome/browser/ui/tabs/tab_style.h"
#include "chrome/browser/ui/ui_features.h"
#include "chrome/browser/ui/views/tabs/tab_group_editor_bubble_view.h"
@@ -78,6 +79,8 @@ namespace {
// The amount of padding between the label and the sync icon.
constexpr int kSyncIconPaddingFromLabel = 2;
+constexpr int kTabGroupStrokeThickness = 1;
+
bool SupportsDataSharing() {
return data_sharing::features::IsDataSharingFunctionalityEnabled();
}
@@ -419,7 +422,8 @@ bool TabGroupHeader::DoesIntersectRect(c
int TabGroupHeader::GetDesiredWidth() const {
const int overlap_margin = group_style_->GetTabGroupViewOverlap() * 2;
- return overlap_margin + title_chip_->width();
+ const int extra_padding = 8;
+ return overlap_margin + extra_padding + title_chip_->width();
}
void TabGroupHeader::SetCollapsedState() {
@@ -559,7 +563,11 @@ void TabGroupHeader::UpdateTitleView() {
title_->SetText(group_title_);
if (!group_title_.empty()) {
- title_->SetEnabledColor(color_utils::GetColorWithMaxContrast(color_));
+ const SkColor text_color = GetColorProvider()->GetColor(
+ GetSavedTabGroupForegroundColorId(
+ tab_slot_controller_->GetGroupColorId(group().value())));
+
+ title_->SetEnabledColor(text_color);
}
}
@@ -690,8 +698,19 @@ void TabGroupHeader::CreateHeaderWithTit
const int corner_radius = group_style_->GetChipCornerRadius();
title_chip_->SetBounds(title_chip_origin.x(), title_chip_origin.y(),
title_chip_width, text_height);
+
+ const tab_groups::TabGroupColorId group_color_id =
+ tab_slot_controller_->GetGroupColorId(group().value());
+
+ const SkColor background_color =
+ GetColorProvider()->GetColor(GetTabGroupBookmarkColorId(group_color_id));
+ const SkColor stroke_color =
+ GetColorProvider()->GetColor(GetSavedTabGroupOutlineColorId(group_color_id));
+
title_chip_->SetBackground(
- views::CreateRoundedRectBackground(color_, corner_radius));
+ views::CreateRoundedRectBackground(background_color, corner_radius));
+ title_chip_->SetBorder(views::CreateRoundedRectBorder(
+ kTabGroupStrokeThickness, corner_radius, stroke_color));
// Set the bounds of the sync icon first, followed by the title.
const int start_of_sync_icon = title_chip_insets.left();
+8 -2
View File
@@ -3,6 +3,7 @@ upstream-fixes/hardware_destructive_interference_size.patch
upstream-fixes/missing-dependencies.patch
upstream-fixes/fix-crash-without-enterprise-cloud-content-analysis.patch
upstream-fixes/fix-python-codecs-deprecation.patch
upstream-fixes/fix-macos-widget-rect.patch
core/inox-patchset/0001-fix-building-without-safebrowsing.patch
core/inox-patchset/0003-disable-autofill-download-manager.patch
@@ -148,6 +149,7 @@ helium/core/enable-tab-search-toolbar-button.patch
helium/core/clean-context-menu.patch
helium/core/split-view.patch
helium/core/fix-tab-sync-unreached-error.patch
helium/core/fix-instance-id-stuck.patch
helium/core/flags-setup.patch
helium/core/add-low-power-framerate-flag.patch
@@ -202,12 +204,14 @@ helium/settings/enable-quad9-doh-option.patch
helium/hop/setup.patch
helium/hop/disable-password-manager.patch
helium/ui/layout-constants.patch
helium/ui/layout-provider.patch
helium/ui/update-cr-components.patch
helium/ui/always-use-better-ntp.patch
helium/ui/clean-new-tab-page.patch
helium/ui/remove-toolbar-corners.patch
helium/ui/location-bar.patch
helium/ui/layout-constants.patch
helium/ui/location-bar-intent-chip.patch
helium/ui/tabs.patch
helium/ui/tab-strip-controls.patch
helium/ui/toolbar.patch
@@ -220,7 +224,6 @@ helium/ui/app-menu-button.patch
helium/ui/remove-reading-list-from-app-menu.patch
helium/ui/fix-customize-side-panel.patch
helium/ui/side-panel.patch
helium/ui/layout-provider.patch
helium/ui/remove-dead-toolbar-actions.patch
helium/ui/remove-dead-profile-actions.patch
helium/ui/clean-up-installed-extension-bubble.patch
@@ -255,3 +258,6 @@ helium/ui/improve-flags-webui.patch
helium/ui/ublock-show-in-settings.patch
helium/ui/licenses-in-credits.patch
helium/ui/remove-autofill-link-to-password-manager.patch
helium/ui/fix-caption-button-tab-strip-align.patch
helium/ui/find-bar.patch
helium/ui/experiments/compact-action-toolbar.patch
@@ -0,0 +1,52 @@
--- a/components/remote_cocoa/app_shim/native_widget_mac_nswindow.mm
+++ b/components/remote_cocoa/app_shim/native_widget_mac_nswindow.mm
@@ -352,12 +352,12 @@ struct NSEdgeAndCornerThicknesses {
}
- (NSRect)constrainFrameRect:(NSRect)frameRect toScreen:(NSScreen*)screen {
- // Headless windows should not be constrained within the physical screen.
- if (_isHeadless) {
- return frameRect;
- }
-
- return [super constrainFrameRect:frameRect toScreen:screen];
+ // AppKit's default implementation moves child windows down to avoid
+ // the menu bar. We don't want that behavior, because widgets like the
+ // Omnibox may have a big shadow that could cause invisible menu bar collision
+ // in fullscreen/maximized state. We override it here to return the original
+ // frameRect before the adjustment.
+ return frameRect;
}
// Private methods.
--- a/components/remote_cocoa/app_shim/native_widget_mac_overlay_nswindow.mm
+++ b/components/remote_cocoa/app_shim/native_widget_mac_overlay_nswindow.mm
@@ -6,8 +6,6 @@
#include <AppKit/AppKit.h>
-#include "base/mac/mac_util.h"
-
// Overlay windows are used to render top chrome components while in immersive
// fullscreen. Those rendered views are hosted in a separate AppKit controlled
// window. The overlay windows are a transparent overlay on top of the AppKit
@@ -28,19 +26,6 @@ constexpr unsigned long kAllowedCollecti
kAllowedCollectionBehaviorMask];
}
-- (NSRect)constrainFrameRect:(NSRect)frameRect toScreen:(NSScreen*)screen {
- if (base::mac::MacOSVersion() >= 26'00'00) {
- // Since macOS 26.0, when the main window enters full screen, the
- // overlay child window’s position is automatically adjusted by the system
- // to just below the menu bar location (even though the menu bar is hidden
- // at that time). During this process, [NSWindow constrainFrameRect] is
- // called and returns the system-adjusted position. Override this
- // function to return the original value frameRect before the adjustment.
- return frameRect;
- }
- return [super constrainFrameRect:frameRect toScreen:screen];
-}
-
// Paint the window a mostly opaque color.
- (void)debugWithColor:(NSColor*)color {
self.backgroundColor = color;
+1 -1
View File
@@ -1 +1 @@
4
7