mirror of
https://github.com/imputnet/helium.git
synced 2026-08-20 00:57:32 +02:00
Compare commits
14 Commits
| Author | SHA1 | Date | |
|---|---|---|---|
| 0f9df28d13 | |||
| 060fa834e5 | |||
| be47d96c1f | |||
| f049404ad5 | |||
| 232f940dbd | |||
| b3d929f6e2 | |||
| 5f296ba37d | |||
| 3668280470 | |||
| 673aaf7698 | |||
| 9113a4cda7 | |||
| e9de843abe | |||
| 367118d103 | |||
| 8da7b370f7 | |||
| 06a3ebf3d3 |
@@ -1 +1 @@
|
||||
142.0.7444.134
|
||||
142.0.7444.162
|
||||
|
||||
@@ -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
|
||||
|
||||
@@ -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,248 @@
|
||||
--- a/chrome/browser/helium_flag_choices.h
|
||||
+++ b/chrome/browser/helium_flag_choices.h
|
||||
@@ -30,6 +30,7 @@ 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";
|
||||
|
||||
} // namespace helium
|
||||
|
||||
--- a/chrome/browser/helium_flag_entries.h
|
||||
+++ b/chrome/browser/helium_flag_entries.h
|
||||
@@ -28,4 +28,8 @@
|
||||
"Middle Click Autoscroll",
|
||||
"Enables autoscroll on middle click. Helium flag, Chromium feature.",
|
||||
kOsDesktop, FEATURE_VALUE_TYPE(blink::features::kHeliumMiddleClickAutoscroll)},
|
||||
+ {helium::kHeliumCatUiCommandLine,
|
||||
+ "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)},
|
||||
#endif /* CHROME_BROWSER_HELIUM_FLAG_ENTRIES_H_ */
|
||||
--- a/chrome/browser/ui/ui_features.cc
|
||||
+++ b/chrome/browser/ui/ui_features.cc
|
||||
@@ -17,6 +17,14 @@
|
||||
|
||||
namespace features {
|
||||
|
||||
+// Helium Compact Action Toolbar UI
|
||||
+BASE_FEATURE(kHeliumCatUi,
|
||||
+ base::FEATURE_DISABLED_BY_DEFAULT);
|
||||
+
|
||||
+bool IsHeliumCatEnabled() {
|
||||
+ return base::FeatureList::IsEnabled(kHeliumCatUi);
|
||||
+}
|
||||
+
|
||||
// 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,9 @@ 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);
|
||||
+bool IsHeliumCatEnabled();
|
||||
+
|
||||
// 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
|
||||
@@ -540,6 +540,13 @@ void BrowserViewLayout::LayoutTabStripRe
|
||||
tab_strip_region_view_->SetBounds(0, 0, 0, 0);
|
||||
return;
|
||||
}
|
||||
+
|
||||
+ // If the CAT feature is enabled, then the tab strip is in the toolbar.
|
||||
+ // We shouldn't layout it here.
|
||||
+ if (features::IsHeliumCatEnabled()) {
|
||||
+ 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 +594,12 @@ void BrowserViewLayout::LayoutToolbar(gf
|
||||
toolbar_bounds.set_width(toolbar_bounds.width() -
|
||||
BrowserView::kVerticalTabStripWidth);
|
||||
toolbar_->SetBoundsRect(toolbar_bounds);
|
||||
+ } else if (features::IsHeliumCatEnabled()) {
|
||||
+ 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,
|
||||
@@ -700,6 +723,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.
|
||||
@@ -998,6 +1039,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());
|
||||
@@ -0,0 +1,66 @@
|
||||
--- 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());
|
||||
--- a/chrome/browser/ui/views/frame/browser_frame_view_linux.cc
|
||||
+++ b/chrome/browser/ui/views/frame/browser_frame_view_linux.cc
|
||||
@@ -4,6 +4,7 @@
|
||||
|
||||
#include "chrome/browser/ui/views/frame/browser_frame_view_linux.h"
|
||||
|
||||
+#include "chrome/browser/ui/layout_constants.h"
|
||||
#include "chrome/browser/ui/views/chrome_layout_provider.h"
|
||||
#include "chrome/browser/ui/views/frame/browser_frame_view_paint_utils_linux.h"
|
||||
#include "chrome/browser/ui/views/frame/browser_native_widget_aura_linux.h"
|
||||
@@ -142,5 +143,15 @@ int BrowserFrameViewLinux::GetTranslucen
|
||||
return 0;
|
||||
}
|
||||
|
||||
+gfx::Rect BrowserFrameViewLinux::GetBoundsForTabStripRegion(
|
||||
+ const gfx::Size& tabstrip_minimum_size) const {
|
||||
+ gfx::Insets frame_insets = RestoredMirroredFrameBorderInsets();
|
||||
+ int x = frame_insets.left() + GetLayoutConstant(TOOLBAR_CORNER_RADIUS);
|
||||
+ int inset_width = width() - x - frame_insets.right();
|
||||
+
|
||||
+ return gfx::Rect(x, frame_insets.top(), inset_width,
|
||||
+ tabstrip_minimum_size.height());
|
||||
+}
|
||||
+
|
||||
BEGIN_METADATA(BrowserFrameViewLinux)
|
||||
END_METADATA
|
||||
--- a/chrome/browser/ui/views/frame/browser_frame_view_linux.h
|
||||
+++ b/chrome/browser/ui/views/frame/browser_frame_view_linux.h
|
||||
@@ -38,6 +38,8 @@ class BrowserFrameViewLinux : public Opa
|
||||
gfx::Insets GetInputInsets() const override;
|
||||
SkRRect GetRestoredClipRegion() const override;
|
||||
int GetTranslucentTopAreaHeight() const override;
|
||||
+ gfx::Rect GetBoundsForTabStripRegion(
|
||||
+ const gfx::Size& tabstrip_minimum_size) const override;
|
||||
|
||||
// Gets the shadow metrics (radius, offset, and number of shadows). This will
|
||||
// always return shadow values, even if shadows are not actually drawn.
|
||||
@@ -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,11 +71,11 @@ int GetLayoutConstant(LayoutConstant con
|
||||
// here once we decide on a permutation.
|
||||
NOTREACHED();
|
||||
case LOCATION_BAR_TRAILING_DECORATION_EDGE_PADDING:
|
||||
@@ -41,7 +50,16 @@
|
||||
case LOCATION_BAR_ICON_SIZE:
|
||||
return touch_ui ? 20 : 16;
|
||||
case LOCATION_BAR_LEADING_ICON_SIZE:
|
||||
@@ -93,12 +93,12 @@ int GetLayoutConstant(LayoutConstant con
|
||||
@@ -81,7 +83,7 @@ int GetLayoutConstant(LayoutConstant con
|
||||
case LOCATION_BAR_TRAILING_ICON_SIZE:
|
||||
return 20;
|
||||
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 +70,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 +95,31 @@
|
||||
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:
|
||||
@@ -167,7 +165,7 @@ gfx::Insets GetLayoutInsets(LayoutInset
|
||||
}
|
||||
|
||||
case TOOLBAR_BUTTON:
|
||||
@@ -101,7 +128,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 +136,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,
|
||||
|
||||
|
||||
@@ -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
@@ -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();
|
||||
|
||||
@@ -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
|
||||
@@ -255,3 +256,5 @@ 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/experiments/compact-action-toolbar.patch
|
||||
|
||||
@@ -0,0 +1,75 @@
|
||||
From 45af583888facfc9bf95ca1cbd6d6169bf5ac3e5 Mon Sep 17 00:00:00 2001
|
||||
From: Keren Zhu <kerenzhu@chromium.org>
|
||||
Date: Tue, 11 Nov 2025 21:11:07 -0800
|
||||
Subject: [PATCH] mac26: fix misplaced omnibox popup due to rect constrains
|
||||
|
||||
MacOS 26 adds new restrictions to child NSWindow positioning:
|
||||
|
||||
* in fullscreen, prevents child windows to enter the titlebar area
|
||||
and menubar area.
|
||||
* in non-fullscreen, prevents child windows from overlapping the
|
||||
window border.
|
||||
|
||||
This becomes a problem for the Omnibox popup, which due to its shadow
|
||||
area will enter the restricting area in both cases. This CL fixes that
|
||||
by overriding -constrainFrameRect: to remove the restriction. This fix
|
||||
was previously applied to only the overlay widget used in fullscreen.
|
||||
|
||||
Fixed: 459509266
|
||||
Change-Id: Ie0a6fa2c099858754b33291a6c3c06919c137a5e
|
||||
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/7142646
|
||||
Commit-Queue: Keren Zhu <kerenzhu@chromium.org>
|
||||
Reviewed-by: Avi Drissman <avi@chromium.org>
|
||||
Cr-Commit-Position: refs/heads/main@{#1543516}
|
||||
---
|
||||
|
||||
--- a/components/remote_cocoa/app_shim/native_widget_mac_nswindow.mm
|
||||
+++ b/components/remote_cocoa/app_shim/native_widget_mac_nswindow.mm
|
||||
@@ -357,6 +357,16 @@ struct NSEdgeAndCornerThicknesses {
|
||||
return frameRect;
|
||||
}
|
||||
|
||||
+ 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];
|
||||
}
|
||||
|
||||
--- 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
@@ -1 +1 @@
|
||||
4
|
||||
5
|
||||
|
||||
Reference in New Issue
Block a user