Compare commits

..

13 Commits

Author SHA1 Message Date
wukko be4a06e409 revision: bump to 5 (#1446) 2026-04-25 18:16:25 +00:00
jj 229dab0102 helium/settings: un-title case custom avatar tooltip (#1447) 2026-04-25 18:04:26 +00:00
jj be9a33279d helium/zen: add option to pin top bar, add toggles to settings (#1443)
top toolbar can now be pinned in zen mode using Ctrl/Cmd+Shift+L, or toggled via settings

fixes #1364
2026-04-25 17:53:49 +00:00
jj 5a10a373ae helium/zen: add toggles for pinning top/side chrome to settings
+ format
2026-04-25 17:29:56 +00:00
jj a2193d7fd3 helium/zen: add shortcut for pinning top toolbar
top toolbar can now be pinned in zen mode using Ctrl/Cmd+Shift+L

fixes #1364
2026-04-25 17:28:17 +00:00
wukko bff736c0e6 helium/ui: various fixes for improving UI on windows (#1445)
- tabs no longer have weird vertical text alignment
- the toolbar is no longer inflated in vertical layout
- and the top of UI is no longer cropped
2026-04-25 20:30:25 +06:00
wukko 8de63a4faf helium/ui: fix 2px ui crop on top on windows 2026-04-25 20:19:50 +06:00
wukko d86fdf1798 helium/ui/tabs: fix padding and center the favicon
should fix the weird title position on windows/linux
2026-04-25 20:19:50 +06:00
wukko a867a3337c helium/ui/vertical: fix toolbar height on windows 2026-04-25 20:19:48 +06:00
jj cdbece53a3 helium/zen: fix division-by-zero when collapsing vts (#1441)
fixes #1390
2026-04-25 10:39:18 +00:00
jj b4fd4a8efe helium/zen: block caption button events when hidden (#1439)
fixes #1267
2026-04-25 12:24:48 +02:00
wukko a0780eb1ed helium/ui/rounded-frame: hide the frame in fullscreen mode (#1436)
really sorry for missing this
2026-04-25 13:43:22 +06:00
jj 458bee8ece utils/i18n: limit max number of workers to 32 (#1432)
fixes applying on windows
2026-04-24 19:58:20 +00:00
17 changed files with 520 additions and 134 deletions
+14 -2
View File
@@ -368,8 +368,8 @@
{
"name": "IDS_SETTINGS_CUSTOM_AVATAR_LABEL",
"source": "chrome/app/settings_strings.grdp",
"context": "The text on the custom avatar photo of the user.",
"message": "Custom Avatar"
"context": "The tooltip shown for the custom avatar photo of the user.",
"message": "Custom avatar"
},
{
"name": "IDS_POLICY_SOURCE_HOP",
@@ -563,6 +563,18 @@
"context": "Description for the zen mode toggle in appearance settings.",
"message": "Hide toolbar and tab strip until hovering near their edges"
},
{
"name": "IDS_SETTINGS_ZEN_PIN_SIDEBAR",
"source": "chrome/app/settings_strings.grdp",
"context": "Description for the toggle to pin the sidebar (vertical tab strip) when in Zen mode.",
"message": "Always show the sidebar"
},
{
"name": "IDS_SETTINGS_ZEN_PIN_TOP_TOOLBAR",
"source": "chrome/app/settings_strings.grdp",
"context": "Description for the toggle to pin the top bar when in Zen mode.",
"message": "Always show the top bar"
},
{
"name": "IDS_SETTINGS_DEFAULT_BROWSER_SECONDARY",
"source": "chrome/app/settings_chromium_strings.grdp",
@@ -16,8 +16,8 @@
+ <message name="IDS_SETTINGS_CUSTOM_AVATAR_ERROR" desc="Toast shown when a custom avatar image could not be decoded.">
+ Image could not be loaded
+ </message>
+ <message name="IDS_SETTINGS_CUSTOM_AVATAR_LABEL" desc="The text on the custom avatar photo of the user.">
+ Custom Avatar
+ <message name="IDS_SETTINGS_CUSTOM_AVATAR_LABEL" desc="The tooltip shown for the custom avatar photo of the user.">
+ Custom avatar
+ </message>
<message name="IDS_SETTINGS_CREATE_SHORTCUT" desc="Title of create shortcut section on the manage profile page.">
Create desktop shortcut
@@ -45,7 +45,15 @@
--- a/chrome/browser/ui/views/frame/opaque_browser_frame_view.cc
+++ b/chrome/browser/ui/views/frame/opaque_browser_frame_view.cc
@@ -527,6 +527,27 @@ bool OpaqueBrowserFrameView::ShouldShowC
@@ -120,6 +120,7 @@ class CaptionButtonBackgroundImageSource
bool HitTestCaptionButton(views::Button* button, const gfx::Point& point) {
return button && button->GetVisible() &&
+ button->GetCanProcessEventsWithinSubtree() &&
button->GetMirroredBounds().Contains(point);
}
@@ -527,6 +528,28 @@ bool OpaqueBrowserFrameView::ShouldShowC
return GetShowWindowTitleBar();
}
@@ -54,6 +62,7 @@
+ if (!view) {
+ return;
+ }
+ view->SetCanProcessEventsWithinSubtree(opacity > 0.0f);
+ if (opacity < 1.0f) {
+ if (!view->layer()) {
+ view->SetPaintToLayer();
@@ -83,3 +92,69 @@
gfx::Size GetMinimumSize() const override;
void PaintAsActiveChanged() override;
void OnThemeChanged() override;
--- a/chrome/browser/ui/views/frame/browser_caption_button_container_win.cc
+++ b/chrome/browser/ui/views/frame/browser_caption_button_container_win.cc
@@ -36,6 +36,7 @@ std::unique_ptr<WindowsCaptionButton> Cr
bool HitTestCaptionButton(WindowsCaptionButton* button,
const gfx::Point& point) {
return button && button->GetVisible() &&
+ button->GetCanProcessEventsWithinSubtree() &&
button->GetMirroredBounds().Contains(point);
}
@@ -120,6 +121,19 @@ int BrowserCaptionButtonContainer::NonCl
return HTCAPTION;
}
+void BrowserCaptionButtonContainer::SetCaptionButtonsCanProcessEvents(
+ bool can_process_events) {
+ auto apply = [can_process_events](WindowsCaptionButton* view) {
+ if (view) {
+ view->SetCanProcessEventsWithinSubtree(can_process_events);
+ }
+ };
+ apply(minimize_button_);
+ apply(maximize_button_);
+ apply(restore_button_);
+ apply(close_button_);
+}
+
void BrowserCaptionButtonContainer::OnWindowControlsOverlayEnabledChanged() {
if (frame_view_->GetBrowserView()->IsWindowControlsOverlayEnabled()) {
SetBackground(
--- a/chrome/browser/ui/views/frame/browser_caption_button_container_win.h
+++ b/chrome/browser/ui/views/frame/browser_caption_button_container_win.h
@@ -36,6 +36,8 @@ class BrowserCaptionButtonContainer : pu
// See also ClientView::NonClientHitTest.
int NonClientHitTest(const gfx::Point& point) const;
+ void SetCaptionButtonsCanProcessEvents(bool can_process_events);
+
void OnWindowControlsOverlayEnabledChanged();
private:
--- a/chrome/browser/ui/views/frame/browser_frame_view_win.cc
+++ b/chrome/browser/ui/views/frame/browser_frame_view_win.cc
@@ -473,6 +473,12 @@ void BrowserFrameViewWin::UpdateWindowTi
}
}
+void BrowserFrameViewWin::SetCaptionButtonsOpacity(float) {
+ caption_button_container_->SetCaptionButtonsCanProcessEvents(
+ !GetBrowserView()->IsZenModeEnabledForLayout() ||
+ GetBrowserView()->GetTopChromeRevealRatio() > 0.0f);
+}
+
void BrowserFrameViewWin::ResetWindowControls() {
BrowserFrameView::ResetWindowControls();
caption_button_container_->ResetWindowControls();
--- a/chrome/browser/ui/views/frame/browser_frame_view_win.h
+++ b/chrome/browser/ui/views/frame/browser_frame_view_win.h
@@ -42,6 +42,7 @@ class BrowserFrameViewWin : public Brows
int GetTopInset(bool restored) const override;
SkColor GetCaptionColor(BrowserFrameActiveState active_state) const override;
void UpdateThrobber(bool running) override;
+ void SetCaptionButtonsOpacity(float opacity) override;
gfx::Size GetMinimumSize() const override;
void WindowControlsOverlayEnabledChanged() override;
@@ -1,6 +1,6 @@
--- a/chrome/app/settings_strings.grdp
+++ b/chrome/app/settings_strings.grdp
@@ -313,6 +313,12 @@
@@ -313,6 +313,18 @@
<message name="IDS_SETTINGS_MINIMAL_LOCATION_BAR" desc="Label for the toggle that enables the minimal address bar.">
Minimal address bar
</message>
@@ -9,22 +9,30 @@
+ </message>
+ <message name="IDS_SETTINGS_BROWSER_ZEN_MODE_DESCRIPTION" desc="Description for the zen mode toggle in appearance settings.">
+ Hide toolbar and tab strip until hovering near their edges
+ </message>
+ <message name="IDS_SETTINGS_ZEN_PIN_SIDEBAR" desc="Description for the toggle to pin the sidebar (vertical tab strip) when in Zen mode.">
+ Always show the sidebar
+ </message>
+ <message name="IDS_SETTINGS_ZEN_PIN_TOP_TOOLBAR" desc="Description for the toggle to pin the top bar when in Zen mode.">
+ Always show the top bar
+ </message>
<message name="IDS_SETTINGS_SHOW_HOME_BUTTON" desc="Label for the checkbox which enables or disables showing the home button in the toolbar.">
Show home button
</message>
--- a/chrome/browser/ui/webui/settings/settings_localized_strings_provider.cc
+++ b/chrome/browser/ui/webui/settings/settings_localized_strings_provider.cc
@@ -511,6 +511,8 @@ void AddAppearanceStrings(content::WebUI
@@ -511,6 +511,10 @@ void AddAppearanceStrings(content::WebUI
{"browserLayoutCompact", IDS_SETTINGS_BROWSER_LAYOUT_COMPACT},
{"browserLayoutVertical", IDS_SETTINGS_BROWSER_LAYOUT_VERTICAL},
{"tabStripRightAlign", IDS_SETTINGS_TAB_STRIP_RIGHT_ALIGN},
+ {"browserZenMode", IDS_SETTINGS_BROWSER_ZEN_MODE},
+ {"browserZenModeDescription", IDS_SETTINGS_BROWSER_ZEN_MODE_DESCRIPTION},
+ {"zenModePinSidebar", IDS_SETTINGS_ZEN_PIN_SIDEBAR},
+ {"zenModePinToolbar", IDS_SETTINGS_ZEN_PIN_TOP_TOOLBAR},
{"centeredLocationBar", IDS_SETTINGS_CENTERED_LOCATION_BAR},
{"verticalCollapseShortcut", IDS_SETTINGS_VERTICAL_COLLAPSE_SHORTCUT},
{"minimalLocationBar", IDS_SETTINGS_MINIMAL_LOCATION_BAR},
@@ -579,6 +581,8 @@ void AddAppearanceStrings(content::WebUI
@@ -579,6 +583,8 @@ void AddAppearanceStrings(content::WebUI
base::FeatureList::IsEnabled(features::kTabHoverCardImages));
html_source->AddBoolean("showVerticalTabsEnabled",
tabs::IsVerticalTabsFeatureEnabled());
@@ -35,53 +43,86 @@
tabs::IsVerticalTabsFeatureEnabled() ||
--- a/chrome/browser/extensions/api/settings_private/prefs_util.cc
+++ b/chrome/browser/extensions/api/settings_private/prefs_util.cc
@@ -211,6 +211,7 @@ const PrefsUtil::TypedPrefMap& PrefsUtil
@@ -211,6 +211,11 @@ const PrefsUtil::TypedPrefMap& PrefsUtil
settings_api::PrefType::kBoolean;
(*s_allowlist)[::prefs::kHeliumMinimalLocationBar] =
settings_api::PrefType::kBoolean;
+ (*s_allowlist)[::prefs::kHeliumZenMode] = settings_api::PrefType::kBoolean;
+ (*s_allowlist)[::prefs::kHeliumZenModeSidebarPinned] =
+ settings_api::PrefType::kBoolean;
+ (*s_allowlist)[::prefs::kHeliumZenModeTopChromePinned] =
+ settings_api::PrefType::kBoolean;
// Miscellaneous
(*s_allowlist)[::embedder_support::kAlternateErrorPagesEnabled] =
--- a/chrome/browser/resources/settings/appearance_page/appearance_page.html
+++ b/chrome/browser/resources/settings/appearance_page/appearance_page.html
@@ -120,6 +120,12 @@
pref="{{prefs.helium.browser.minimal_location_bar}}"
label="$i18n{minimalLocationBar}">
@@ -121,6 +121,24 @@
</settings-toggle-button>
+ <settings-toggle-button
+ hidden="[[!showZenModeEnabled_]]"
+ pref="{{prefs.helium.browser.zen_mode}}"
+ label="$i18n{browserZenMode}"
+ sub-label="$i18n{browserZenModeDescription}">
+ </settings-toggle-button>
</div>
+ <settings-toggle-button
+ hidden="[[!showZenModeEnabled_]]"
+ pref="{{prefs.helium.browser.zen_mode}}"
+ label="$i18n{browserZenMode}"
+ sub-label="$i18n{browserZenModeDescription}">
+ </settings-toggle-button>
+ <div class="list-frame hover-card-toggles"
+ hidden="[[!showZenModeSettings_]]">
+ <settings-toggle-button
+ pref="{{prefs.helium.browser.zen_mode_sidebar_pinned}}"
+ hidden="[[!showVerticalSettings_]]"
+ label="$i18n{zenModePinSidebar}">
+ </settings-toggle-button>
+ <settings-toggle-button
+ pref="{{prefs.helium.browser.zen_mode_top_chrome_pinned}}"
+ label="$i18n{zenModePinToolbar}">
+ </settings-toggle-button>
+ </div>
<div
class="hr"
hidden="[[!showHr_(
--- a/chrome/browser/resources/settings/appearance_page/appearance_page.ts
+++ b/chrome/browser/resources/settings/appearance_page/appearance_page.ts
@@ -250,7 +250,12 @@ export class SettingsAppearancePageEleme
return loadTimeData.getBoolean('showVerticalTabsEnabled');
},
@@ -255,6 +255,17 @@ export class SettingsAppearancePageEleme
computed:
'computeShowVerticalSettings_(prefs.helium.browser.layout.value)',
},
-
+ showZenModeEnabled_: {
+ type: Boolean,
+ value() {
+ return loadTimeData.getBoolean('showZenModeEnabled');
+ },
+ },
+ showZenModeSettings_: {
+ type: Boolean,
+ computed: 'computeShowZenModeSettings_(' +
+ 'showZenModeEnabled_, prefs.helium.browser.zen_mode.value)',
+ },
showTabStripComboButtonEnabled_: {
type: Boolean,
value() {
@@ -313,6 +318,7 @@ export class SettingsAppearancePageEleme
// </if>
@@ -318,6 +329,8 @@ export class SettingsAppearancePageEleme
declare private showVerticalTabsEnabled_: boolean;
declare private showVerticalSettings_: boolean;
+ declare private showZenModeEnabled_: boolean;
+ declare private showZenModeSettings_: boolean;
declare private showTabStripComboButtonEnabled_: boolean;
declare private showProjectsPanelEnabled_: boolean;
declare private showEverythingMenuEnabled_: boolean;
@@ -489,6 +502,11 @@ export class SettingsAppearancePageEleme
return layout !== BrowserLayout.COMPACT;
}
+ private computeShowZenModeSettings_(
+ showZenModeEnabled: boolean, zenModeEnabled: boolean|undefined): boolean {
+ return showZenModeEnabled && !!zenModeEnabled;
+ }
+
private themeChanged_(themeId: string) {
if (this.prefs === undefined || this.systemTheme_ === undefined) {
return;
--- a/chrome/browser/ui/ui_features.cc
+++ b/chrome/browser/ui/ui_features.cc
@@ -25,6 +25,13 @@ bool HeliumUseCompactLocationWidth() {
@@ -178,18 +219,19 @@
HeliumLayoutType GetBrowserLayout() const;
--- a/chrome/browser/ui/tabs/tab_strip_prefs.cc
+++ b/chrome/browser/ui/tabs/tab_strip_prefs.cc
@@ -48,6 +48,8 @@ void RegisterProfilePrefs(user_prefs::Pr
@@ -48,6 +48,9 @@ void RegisterProfilePrefs(user_prefs::Pr
registry->RegisterIntegerPref(prefs::kHeliumLayout,
std::to_underlying(HeliumLayoutType::kClassic));
registry->RegisterBooleanPref(prefs::kHeliumVerticalRightAligned, false);
+ registry->RegisterBooleanPref(prefs::kHeliumZenMode, false);
+ registry->RegisterBooleanPref(prefs::kHeliumZenModeSidebarPinned, false);
+ registry->RegisterBooleanPref(prefs::kHeliumZenModeTopChromePinned, false);
registry->RegisterBooleanPref(prefs::kHeliumVerticalCollapsed, false);
registry->RegisterIntegerPref(prefs::kHeliumVerticalUncollapsedWidth,
kVerticalTabStripDefaultUncollapsedWidth);
--- a/chrome/common/pref_names.h
+++ b/chrome/common/pref_names.h
@@ -1246,6 +1246,13 @@ inline constexpr char kHeliumLayout[] =
@@ -1246,6 +1246,17 @@ inline constexpr char kHeliumLayout[] =
inline constexpr char kHeliumVerticalRightAligned[] =
"helium.browser.vertical_right_aligned";
@@ -199,7 +241,84 @@
+// A boolean pref set to true if the VTS is pinned (non-floating) in zen mode.
+inline constexpr char kHeliumZenModeSidebarPinned[] =
+ "helium.browser.zen_mode_sidebar_pinned";
+
+// A boolean pref set to true if the top toolbar is pinned in zen mode.
+inline constexpr char kHeliumZenModeTopChromePinned[] =
+ "helium.browser.zen_mode_top_chrome_pinned";
+
// A boolean pref set to true if vertical tabs are collapsed.
inline constexpr char kHeliumVerticalCollapsed[] =
"helium.browser.vertical_collapsed";
--- a/chrome/browser/ui/views/frame/browser_native_widget_mac.mm
+++ b/chrome/browser/ui/views/frame/browser_native_widget_mac.mm
@@ -270,6 +270,7 @@ void BrowserNativeWidgetMac::ValidateUse
case IDC_PRINT:
case IDC_RELOAD:
case IDC_CTRL_S_SHORTCUT:
+ case IDC_TOGGLE_ZEN_MODE_TOP_CHROME_PIN:
case IDC_SAVE_PAGE:
case IDC_SELECT_NEXT_TAB:
case IDC_SELECT_PREVIOUS_TAB:
--- a/chrome/app/chrome_command_ids.h
+++ b/chrome/app/chrome_command_ids.h
@@ -103,6 +103,7 @@
#define IDC_BROWSER_LAYOUT_DYNAMIC 34086
#define IDC_CTRL_S_SHORTCUT 34090
+#define IDC_TOGGLE_ZEN_MODE_TOP_CHROME_PIN 34091
// Tab group Commands
#define IDC_ADD_NEW_TAB_TO_GROUP 34100
--- a/chrome/app/chrome_dll.rc
+++ b/chrome/app/chrome_dll.rc
@@ -61,6 +61,7 @@ BEGIN
"A", IDC_FOCUS_INACTIVE_POPUP_FOR_ACCESSIBILITY, VIRTKEY, SHIFT, ALT
"D", IDC_FOCUS_LOCATION, VIRTKEY, ALT
"L", IDC_FOCUS_LOCATION, VIRTKEY, CONTROL
+ "L", IDC_TOGGLE_ZEN_MODE_TOP_CHROME_PIN, VIRTKEY, CONTROL, SHIFT
VK_F10, IDC_FOCUS_MENU_BAR, VIRTKEY
VK_MENU, IDC_FOCUS_MENU_BAR, VIRTKEY
VK_F6, IDC_FOCUS_NEXT_PANE, VIRTKEY
--- a/chrome/browser/global_keyboard_shortcuts_mac.mm
+++ b/chrome/browser/global_keyboard_shortcuts_mac.mm
@@ -144,6 +144,7 @@ const std::vector<KeyboardShortcutData>&
{true, false, false, false, kVK_ANSI_Keypad9, IDC_SELECT_LAST_TAB},
{true, false, false, false, kVK_ANSI_S, IDC_CTRL_S_SHORTCUT},
+ {true, true, false, false, kVK_ANSI_L, IDC_TOGGLE_ZEN_MODE_TOP_CHROME_PIN},
{true, true, false, false, kVK_ANSI_M, IDC_SHOW_AVATAR_MENU},
{true, false, false, true, kVK_ANSI_L, IDC_SHOW_DOWNLOADS},
--- a/chrome/browser/ui/accelerator_table.cc
+++ b/chrome/browser/ui/accelerator_table.cc
@@ -65,6 +65,8 @@ const AcceleratorMapping kAcceleratorMap
{ui::VKEY_G, ui::EF_SHIFT_DOWN | ui::EF_PLATFORM_ACCELERATOR,
IDC_FIND_PREVIOUS},
{ui::VKEY_L, ui::EF_PLATFORM_ACCELERATOR, IDC_FOCUS_LOCATION},
+ {ui::VKEY_L, ui::EF_SHIFT_DOWN | ui::EF_PLATFORM_ACCELERATOR,
+ IDC_TOGGLE_ZEN_MODE_TOP_CHROME_PIN},
{ui::VKEY_O, ui::EF_PLATFORM_ACCELERATOR, IDC_OPEN_FILE},
{ui::VKEY_P, ui::EF_PLATFORM_ACCELERATOR, IDC_PRINT},
{ui::VKEY_R, ui::EF_PLATFORM_ACCELERATOR, IDC_RELOAD},
--- a/chrome/browser/ui/browser_command_controller.cc
+++ b/chrome/browser/ui/browser_command_controller.cc
@@ -1811,6 +1811,8 @@ void BrowserCommandController::InitComma
// These are always enabled; the menu determines their menu item visibility.
command_updater_.UpdateCommandEnabled(IDC_UPGRADE_DIALOG, true);
command_updater_.UpdateCommandEnabled(IDC_HELIUM_SERVICES_OPEN, true);
+ command_updater_.UpdateCommandEnabled(IDC_TOGGLE_ZEN_MODE_TOP_CHROME_PIN,
+ false);
command_updater_.UpdateCommandEnabled(IDC_SET_BROWSER_AS_DEFAULT, true);
// Safety Hub commands.
--- a/chrome/browser/ui/cocoa/accelerators_cocoa.mm
+++ b/chrome/browser/ui/cocoa/accelerators_cocoa.mm
@@ -49,6 +49,8 @@ const struct AcceleratorMapping {
{IDC_PRINT, ui::EF_COMMAND_DOWN, ui::VKEY_P},
{IDC_RESTORE_TAB, ui::EF_COMMAND_DOWN | ui::EF_SHIFT_DOWN, ui::VKEY_T},
{IDC_CTRL_S_SHORTCUT, ui::EF_COMMAND_DOWN, ui::VKEY_S},
+ {IDC_TOGGLE_ZEN_MODE_TOP_CHROME_PIN,
+ ui::EF_COMMAND_DOWN | ui::EF_SHIFT_DOWN, ui::VKEY_L},
{IDC_SHOW_BOOKMARK_BAR, ui::EF_COMMAND_DOWN | ui::EF_SHIFT_DOWN,
ui::VKEY_B},
{IDC_SHOW_BOOKMARK_MANAGER, ui::EF_COMMAND_DOWN | ui::EF_ALT_DOWN,
+168 -74
View File
@@ -58,7 +58,19 @@
// Add any legal notices required for the user to the queue.
QueueLegalAndPrivacyNotices(browser_->GetProfile());
@@ -1175,6 +1196,7 @@ BrowserView::~BrowserView() {
@@ -1130,6 +1151,11 @@ BrowserView::BrowserView(Browser* browse
prefs::kFullscreenAllowed,
base::BindRepeating(&BrowserView::UpdateFullscreenAllowedFromPolicy,
base::Unretained(this), CanFullscreen()));
+ registrar_.AddMultiple(
+ {prefs::kHeliumZenModeSidebarPinned,
+ prefs::kHeliumZenModeTopChromePinned},
+ base::BindRepeating(&BrowserView::OnZenModePinnedChromePrefChanged,
+ base::Unretained(this)));
UpdateFullscreenAllowedFromPolicy(CanFullscreen());
WebUIContentsPreloadManager::GetInstance()->WarmupForBrowser(browser_.get());
@@ -1175,6 +1201,7 @@ BrowserView::~BrowserView() {
// Stop the animation timer explicitly here to avoid running it in a nested
// message loop, which may run by Browser destructor.
loading_animation_timer_.Stop();
@@ -66,7 +78,7 @@
// Reset autofill bubble handler to make sure it does not out-live toolbar,
// since it is responsible for showing autofill related bubbles from toolbar's
@@ -1393,6 +1415,13 @@ bool BrowserView::GetTabStripVisible() c
@@ -1393,6 +1420,13 @@ bool BrowserView::GetTabStripVisible() c
return false;
}
@@ -80,7 +92,7 @@
// In non-fullscreen the tabstrip should always be visible.
auto* const immersive_mode_controller =
ImmersiveModeController::From(browser());
@@ -1584,6 +1613,52 @@ float BrowserView::GetTopControlsSlideBe
@@ -1584,6 +1618,56 @@ float BrowserView::GetTopControlsSlideBe
return 1.f;
}
@@ -110,6 +122,11 @@
+ prefs::kHeliumZenModeSidebarPinned);
+}
+
+bool BrowserView::IsZenModeTopChromePinned() const {
+ return zen_mode_enabled_ && browser_->profile()->GetPrefs()->GetBoolean(
+ prefs::kHeliumZenModeTopChromePinned);
+}
+
+void BrowserView::ToggleZenModeSideChrome() {
+ if (!IsZenModeEnabled() || !ShouldDrawVerticalTabStrip()) {
+ return;
@@ -117,23 +134,22 @@
+ const bool was_pinned = IsZenModeSideChromePinned();
+ browser_->profile()->GetPrefs()->SetBoolean(
+ prefs::kHeliumZenModeSidebarPinned, !was_pinned);
+ if (!was_pinned) {
+ // Snap to fully shown; the layout will handle it as non-floating.
+ zen_side_chrome_animation_.Reset(1);
+ } else if (auto* controller =
+ tabs::VerticalTabStripStateController::From(browser_);
+ controller && controller->IsCollapsed()) {
+ // Force expanded when returning to floating mode.
+ controller->SetCollapsed(false);
+}
+
+void BrowserView::ToggleZenModeTopChrome() {
+ if (!IsZenModeEnabled()) {
+ return;
+ }
+ UpdateZenCollapseButtonVisibility();
+ InvalidateLayout();
+
+ const bool was_pinned = IsZenModeTopChromePinned();
+ browser_->profile()->GetPrefs()->SetBoolean(
+ prefs::kHeliumZenModeTopChromePinned, !was_pinned);
+}
+
views::Widget* BrowserView::GetWidgetForAnchoring() {
#if BUILDFLAG(IS_MAC)
if (UsesImmersiveFullscreenMode()) {
@@ -1608,6 +1683,7 @@ void BrowserView::OnVerticalTabStripMode
@@ -1608,6 +1692,7 @@ void BrowserView::OnVerticalTabStripMode
const bool should_be_vertical = controller->ShouldDisplayVerticalTabs();
if (vertical_initialized == should_be_vertical) {
// Mode is unchanged; just re-layout so alignment-dependent views update.
@@ -141,12 +157,40 @@
InvalidateLayout();
return;
}
@@ -1647,10 +1723,263 @@ void BrowserView::OnToolbarTabStripState
@@ -1647,10 +1732,310 @@ void BrowserView::OnToolbarTabStripState
toolbar_->UpdateToolbarLayout();
}
+ UpdateZenModeState();
UpdateTabSearchBubbleHost();
+ UpdateZenCollapseButtonVisibility();
+ InvalidateLayout();
+}
+
+void BrowserView::OnZenModePinnedChromePrefChanged() {
+ if (!zen_mode_enabled_) {
+ return;
+ }
+
+ const bool side_chrome_pinned = IsZenModeSideChromePinned();
+ const bool top_chrome_pinned = IsZenModeTopChromePinned();
+
+ if (side_chrome_pinned) {
+ zen_side_chrome_animation_.Reset(1);
+ } else if (auto* controller =
+ tabs::VerticalTabStripStateController::From(browser_);
+ controller && controller->IsCollapsed()) {
+ controller->SetCollapsed(false);
+ }
+
+ if (top_chrome_pinned) {
+ RevealZenModeTopChromeImmediately();
+ }
+
+ if (!side_chrome_pinned || !top_chrome_pinned) {
+ UpdateZenModeRevealFromCursor();
+ }
+
+ UpdateZenCollapseButtonVisibility();
InvalidateLayout();
}
@@ -163,6 +207,8 @@
+ }
+
+ zen_mode_enabled_ = zen_mode_enabled;
+ browser_->command_controller()->UpdateCommandEnabled(
+ IDC_TOGGLE_ZEN_MODE_TOP_CHROME_PIN, zen_mode_enabled);
+
+ if (zen_mode_enabled_) {
+ // When entering zen mode with the VTS pinned, snap to fully shown.
@@ -172,6 +218,10 @@
+ } else {
+ zen_side_chrome_animation_.Reset(0);
+ }
+
+ if (IsZenModeTopChromePinned()) {
+ zen_top_chrome_animation_.Reset(1);
+ }
+ }
+
+ // Force the vertical tab strip expanded when not pinned.
@@ -276,6 +326,11 @@
+ reveal_side = true;
+ }
+
+ // Pinned top chrome stays visible regardless of cursor position.
+ if (IsZenModeTopChromePinned()) {
+ reveal_top = true;
+ }
+
+ // Keep the top chrome visible while the omnibox is focused.
+ const bool omnibox_focused = toolbar_ && toolbar_->location_bar_view() &&
+ toolbar_->location_bar_view()->HasFocus();
@@ -309,6 +364,14 @@
+ }
+}
+
+void BrowserView::RevealZenModeTopChromeImmediately() {
+ zen_top_chrome_animation_.Reset(1);
+ if (auto* frame_view = GetFrameView()) {
+ frame_view->SetCaptionButtonsOpacity(1.0f);
+ }
+ DeprecatedLayoutImmediately();
+}
+
+bool BrowserView::IsZenModeEnabled() const {
+ auto* controller = HeliumLayoutStateController::From(browser_);
+ return controller && controller->IsZenModeEnabled() && GetIsNormalType() &&
@@ -405,7 +468,7 @@
void BrowserView::OnProjectsPanelStateChanged(
ProjectsPanelStateController* controller) {
projects_panel_container_->OnProjectsPanelStateChanged(controller);
@@ -2404,6 +2733,8 @@ void BrowserView::FullscreenStateChanged
@@ -2404,6 +2789,8 @@ void BrowserView::FullscreenStateChanged
ShowSplitView(GetActiveContentsWebView()->HasFocus());
}
}
@@ -414,7 +477,7 @@
}
void BrowserView::SetToolbarButtonProvider(ToolbarButtonProvider* provider) {
@@ -2456,6 +2787,17 @@ void BrowserView::SetFocusToLocationBar(
@@ -2456,6 +2843,13 @@ void BrowserView::SetFocusToLocationBar(
return;
}
@@ -422,17 +485,13 @@
+ // and can receive focus. A synchronous layout is required so the toolbar
+ // has non-zero height before FocusLocation runs.
+ if (zen_mode_enabled_) {
+ zen_top_chrome_animation_.Reset(1);
+ if (auto* frame_view = GetFrameView()) {
+ frame_view->SetCaptionButtonsOpacity(1.0f);
+ }
+ DeprecatedLayoutImmediately();
+ RevealZenModeTopChromeImmediately();
+ }
+
LocationBar* location_bar = GetLocationBar();
location_bar->FocusLocation(is_user_initiated,
/*clear_focus_if_failed=*/true);
@@ -3210,7 +3552,7 @@ bool BrowserView::IsToolbarVisible() con
@@ -3210,7 +3604,7 @@ bool BrowserView::IsToolbarVisible() con
}
bool BrowserView::IsToolbarShowing() const {
@@ -441,7 +500,7 @@
}
bool BrowserView::IsLocationBarVisible() const {
@@ -4407,6 +4749,11 @@ void BrowserView::OnWidgetActivationChan
@@ -4407,6 +4801,11 @@ void BrowserView::OnWidgetActivationChan
}
}
@@ -453,7 +512,7 @@
browser_->GetFeatures()
.extension_keybinding_registry()
->OnHostActivationChanged(active);
@@ -5246,6 +5593,8 @@ void BrowserView::AddedToWidget() {
@@ -5246,6 +5645,8 @@ void BrowserView::AddedToWidget() {
base::BindRepeating(&BrowserView::OnToolbarTabStripStateChanged,
base::Unretained(this)));
OnToolbarTabStripStateChanged(helium_layout_controller);
@@ -462,7 +521,7 @@
}
UpdateTabSearchBubbleHost();
@@ -5395,6 +5744,7 @@ void BrowserView::AddedToWidget() {
@@ -5395,6 +5796,7 @@ void BrowserView::AddedToWidget() {
}
void BrowserView::RemovedFromWidget() {
@@ -470,7 +529,7 @@
CHECK(GetFocusManager());
focus_manager_observation_.Reset();
}
@@ -5423,6 +5773,14 @@ void BrowserView::OnThemeChanged() {
@@ -5423,6 +5825,14 @@ void BrowserView::OnThemeChanged() {
}
FrameColorsChanged();
@@ -485,7 +544,7 @@
}
bool BrowserView::GetDropFormats(
@@ -5753,6 +6111,9 @@ void BrowserView::UpdateFastResizeForCon
@@ -5753,6 +6163,9 @@ void BrowserView::UpdateFastResizeForCon
}
int BrowserView::GetClientAreaTop() {
@@ -495,7 +554,7 @@
views::View* top_view = toolbar_;
#if BUILDFLAG(ENABLE_WEBUI_TAB_STRIP)
// If webui_tab_strip is displayed, the client area starts at its top,
@@ -6307,6 +6668,42 @@ void BrowserView::OnWillChangeFocus(View
@@ -6307,6 +6720,42 @@ void BrowserView::OnWillChangeFocus(View
}
void BrowserView::OnDidChangeFocus(View* focused_before, View* focused_now) {
UpdateAccessibleNameForRootView();
@@ -575,7 +634,7 @@
// The name of a key to store on the window handle so that other code can
// locate this object using just the handle.
static constexpr char kBrowserViewKey[] = "__BROWSER_VIEW__";
@@ -422,6 +431,15 @@ class BrowserView : public BrowserWindow
@@ -422,6 +431,17 @@ class BrowserView : public BrowserWindow
// Returns the current shown ratio of the top browser controls.
float GetTopControlsSlideBehaviorShownRatio() const;
@@ -584,14 +643,16 @@
+ float GetTopChromeRevealRatio() const;
+ float GetSideChromeRevealRatio() const;
+ bool IsZenModeSideChromePinned() const;
+ bool IsZenModeTopChromePinned() const;
+
+ // Toggles the side chrome (VTS) visibility in zen mode.
+ void ToggleZenModeSideChrome();
+ void ToggleZenModeTopChrome();
+
// Returns the widget for anchoring bubbles and dialogs.
// This returns BrowserWidget except on fullscreen macOS where the toolbar is
// hosted in an OverlayWidget.
@@ -806,6 +824,13 @@ class BrowserView : public BrowserWindow
@@ -806,6 +826,13 @@ class BrowserView : public BrowserWindow
void OnWillChangeFocus(View* focused_before, View* focused_now) override;
void OnDidChangeFocus(View* focused_before, View* focused_now) override;
@@ -605,16 +666,18 @@
// Testing interface:
views::View* GetContentsContainerForTest() { return contents_container_; }
BrowserViewLayout* GetBrowserViewLayoutForTesting() {
@@ -956,6 +981,20 @@ class BrowserView : public BrowserWindow
@@ -956,6 +983,22 @@ class BrowserView : public BrowserWindow
void OnProjectsPanelStateChanged(ProjectsPanelStateController* controller);
+ // Zen mode helpers.
+ void OnZenModePinnedChromePrefChanged();
+ void UpdateZenModeState();
+ void UpdateZenCollapseButtonVisibility();
+ void UpdateZenModeEventMonitor();
+ void UpdateZenModeRevealFromCursor();
+ void UpdateZenModeReveal(bool reveal_top, bool reveal_side);
+ void RevealZenModeTopChromeImmediately();
+ bool IsZenModeEnabled() const;
+ bool IsPointInZenTopTrigger(const gfx::Point& point) const;
+ bool IsPointInZenSideTrigger(const gfx::Point& point) const;
@@ -626,7 +689,7 @@
// Make sure the WebUI tab strip exists if it should.
void MaybeInitializeWebUITabStrip();
@@ -1471,6 +1510,13 @@ class BrowserView : public BrowserWindow
@@ -1471,6 +1514,13 @@ class BrowserView : public BrowserWindow
std::unique_ptr<TabCyclingEventHandler> tab_cycling_event_handler_;
@@ -944,9 +1007,9 @@
+ params.visual_client_area.width(), tabstrip_height);
+ tabstrip_bounds = SlideBoundsFromTop(tabstrip_bounds, top_chrome_ratio);
+ } else {
+ tabstrip_bounds = gfx::Rect(params.visual_client_area.x(), -tabstrip_height,
+ params.visual_client_area.width(),
+ tabstrip_height);
+ tabstrip_bounds =
+ gfx::Rect(params.visual_client_area.x(), -tabstrip_height,
+ params.visual_client_area.width(), tabstrip_height);
+ }
layout.AddChild(views().horizontal_tab_strip_region_view, tabstrip_bounds,
- show_dynamic_tab_strip);
@@ -1053,7 +1116,7 @@
}
// Lay out toolbar. If toolbar is in the top-most row, it will go into the
@@ -1139,21 +1254,26 @@ gfx::Rect BrowserViewTabbedLayoutImpl::C
@@ -1139,21 +1254,24 @@ gfx::Rect BrowserViewTabbedLayoutImpl::C
params.visual_client_area.y(),
params.visual_client_area.width(),
views().toolbar->GetPreferredSize().height());
@@ -1062,9 +1125,8 @@
needs_exclusion = false;
}
- layout.AddChild(views().toolbar, toolbar_bounds, toolbar_visible);
+ layout.AddChild(
+ views().toolbar, toolbar_bounds,
+ toolbar_visible && toolbar_bounds.height() > 0);
+ layout.AddChild(views().toolbar, toolbar_bounds,
+ toolbar_visible && toolbar_bounds.height() > 0);
}
// Clamp the margins visually by overlapping toolbar and the tab strip
@@ -1078,13 +1140,12 @@
- views().horizontal_tab_strip_region_view->GetPreferredSize().height() -
- toolbar_tabstrip_overlap);
+ ScaleExtent(views().horizontal_tab_strip_region_view->GetPreferredSize()
+ .height() -
+ toolbar_tabstrip_overlap,
+ .height() - toolbar_tabstrip_overlap,
+ top_chrome_ratio));
}
// Lay out the bookmarks bar if one is present.
@@ -1162,9 +1282,13 @@ gfx::Rect BrowserViewTabbedLayoutImpl::C
@@ -1162,9 +1280,13 @@ gfx::Rect BrowserViewTabbedLayoutImpl::C
const gfx::Rect bookmarks_bounds(
params.visual_client_area.x(), params.visual_client_area.y(),
params.visual_client_area.width(),
@@ -1101,7 +1162,7 @@
params.SetTop(bookmarks_bounds.bottom());
}
@@ -1174,29 +1298,37 @@ gfx::Rect BrowserViewTabbedLayoutImpl::C
@@ -1174,29 +1296,37 @@ gfx::Rect BrowserViewTabbedLayoutImpl::C
// Lay out the loading bar when present.
if (IsParentedTo(views().loading_bar, views().top_container)) {
gfx::Rect loading_bar_bounds;
@@ -1146,7 +1207,7 @@
}
return gfx::Rect(params.visual_client_area.x(), original_top,
@@ -1204,6 +1336,26 @@ gfx::Rect BrowserViewTabbedLayoutImpl::C
@@ -1204,6 +1334,26 @@ gfx::Rect BrowserViewTabbedLayoutImpl::C
params.visual_client_area.y() - original_top);
}
@@ -1173,7 +1234,7 @@
void BrowserViewTabbedLayoutImpl::ConfigureTopContainerBackground(
const BrowserLayoutParams& params,
CustomCornersBackground* background) {
@@ -1217,9 +1369,98 @@ void BrowserViewTabbedLayoutImpl::Config
@@ -1217,9 +1367,98 @@ void BrowserViewTabbedLayoutImpl::Config
// The top container always draws an opaque background when in vertical
// tabstrip mode.
@@ -1349,6 +1410,21 @@
PrefService* prefs = profile()->GetPrefs();
if (ShouldToggleVerticalCollapse(prefs)) {
auto* controller =
@@ -1319,6 +1328,14 @@ bool BrowserCommandController::ExecuteCo
return ExecuteCommandWithDisposition(IDC_SAVE_PAGE, disposition,
time_stamp);
}
+ case IDC_TOGGLE_ZEN_MODE_TOP_CHROME_PIN: {
+ if (auto* browser_view =
+ BrowserView::GetBrowserViewForBrowser(browser_)) {
+ browser_view->ToggleZenModeTopChrome();
+ return true;
+ }
+ break;
+ }
// Hosted App commands
case IDC_COPY_URL:
CopyURL(browser_, browser_->tab_strip_model()->GetActiveWebContents());
--- a/chrome/browser/ui/views/frame/multi_contents_view.h
+++ b/chrome/browser/ui/views/frame/multi_contents_view.h
@@ -80,6 +80,8 @@ class MultiContentsView : public views::
@@ -1583,20 +1659,21 @@
void MultiContentsView::ContentsSeparators::Reset() {
top_separator = nullptr;
leading_separator = nullptr;
@@ -69,11 +85,7 @@ MultiContentsView::MultiContentsView(
@@ -68,12 +84,7 @@ void MultiContentsView::ContentsSeparato
MultiContentsView::MultiContentsView(
BrowserView* browser_view,
std::unique_ptr<MultiContentsViewDelegate> delegate)
: browser_view_(browser_view),
- : browser_view_(browser_view),
- delegate_(std::move(delegate)),
- start_contents_view_inset_(
- gfx::Insets(kSplitViewContentInset).set_top(0).set_right(0)),
- end_contents_view_inset_(
- gfx::Insets(kSplitViewContentInset).set_top(0).set_left(0)) {
+ delegate_(std::move(delegate)) {
+ : browser_view_(browser_view), delegate_(std::move(delegate)) {
SetLayoutManager(std::make_unique<views::DelegatingLayoutManager>(this));
SetProperty(views::kElementIdentifierKey, kMultiContentsViewElementId);
@@ -431,6 +443,12 @@ int MultiContentsView::GetInactiveIndex(
@@ -432,6 +443,12 @@ int MultiContentsView::GetInactiveIndex(
return active_index_ == 0 ? 1 : 0;
}
@@ -1609,7 +1686,7 @@
void MultiContentsView::OnWebContentsFocused(views::WebView* web_view) {
if (IsInSplitView()) {
// Check whether the widget is visible as otherwise during browser hide,
@@ -493,9 +511,11 @@ views::ProposedLayout MultiContentsView:
@@ -494,9 +511,11 @@ views::ProposedLayout MultiContentsView:
gfx::Rect available_space = gfx::Rect(width, height);
@@ -1622,7 +1699,7 @@
should_use_rounded_frame;
layouts.child_layouts.emplace_back(background_view_.get(), show_background,
available_space);
@@ -518,18 +538,28 @@ views::ProposedLayout MultiContentsView:
@@ -519,18 +538,28 @@ views::ProposedLayout MultiContentsView:
gfx::Rect end_rect(resize_rect.top_right(),
gfx::Size(widths.end_width, available_space.height()));
@@ -1653,9 +1730,9 @@
+ const int trailing_inset =
+ trailing_edge_attached ? 0 : kSplitViewContentInset;
+
+ start_rect.Inset(gfx::Insets::TLBR(
+ top_inset, leading_inset, kSplitViewContentInset,
+ is_in_split ? 0 : trailing_inset));
+ start_rect.Inset(gfx::Insets::TLBR(top_inset, leading_inset,
+ kSplitViewContentInset,
+ is_in_split ? 0 : trailing_inset));
+ if (is_in_split) {
+ end_rect.Inset(gfx::Insets::TLBR(top_inset, 0, kSplitViewContentInset,
+ trailing_inset));
@@ -1663,7 +1740,7 @@
}
layouts.child_layouts.emplace_back(contents_container_views_[0],
@@ -620,17 +650,24 @@ gfx::Rect MultiContentsView::CalculateDr
@@ -621,17 +650,24 @@ gfx::Rect MultiContentsView::CalculateDr
const bool is_drop_target_on_start =
drop_target_view_->side() == MultiContentsDropTargetView::DropSide::START;
const bool should_use_rounded_frame = ShouldUseRoundedFrame();
@@ -1692,7 +1769,7 @@
use_system_side_corners);
UpdateContentsBorderAndOverlay();
@@ -640,9 +677,11 @@ gfx::Rect MultiContentsView::CalculateDr
@@ -641,9 +677,11 @@ gfx::Rect MultiContentsView::CalculateDr
const int remaining_space_x =
available_space.x() + (is_drop_target_on_start ? drop_target_width : 0);
int top_margin = 0;
@@ -1700,14 +1777,14 @@
- top_margin = contents_separators_.should_show_top ? 0
- : kSplitViewContentInset;
+ if (IsInSplitView() || should_use_rounded_frame || zen_mode) {
+ top_margin = IsTopChromeAttached(
+ *browser_view_, contents_separators_.should_show_top)
+ top_margin = IsTopChromeAttached(*browser_view_,
+ contents_separators_.should_show_top)
+ ? 0
+ : kSplitViewContentInset;
} else if (contents_separators_.should_show_top) {
top_margin =
contents_separators_.top_separator->GetPreferredSize().height();
@@ -714,10 +753,14 @@ gfx::Rect MultiContentsView::CalculateSe
@@ -715,10 +753,14 @@ gfx::Rect MultiContentsView::CalculateSe
gfx::Rect(available_space.right() - trailing_separator_width,
available_space.y(), trailing_separator_width, height));
@@ -1723,7 +1800,7 @@
(should_show_leading || should_show_trailing));
if (corner_layout.visible) {
if (should_show_leading) {
@@ -740,8 +783,8 @@ gfx::Rect MultiContentsView::CalculateSe
@@ -741,8 +783,8 @@ gfx::Rect MultiContentsView::CalculateSe
contents_separators_.trailing_corner_separator.get();
views::ChildLayout trailing_corner_layout(
trailing_corner_separator,
@@ -1734,13 +1811,13 @@
if (trailing_corner_layout.visible) {
trailing_corner_layout.bounds = gfx::Rect(
gfx::Point(available_space.right() - corner_preferred_size.width(),
@@ -831,12 +874,32 @@ void MultiContentsView::UpdateContentsBo
@@ -835,12 +877,32 @@ void MultiContentsView::UpdateContentsBo
is_drop_target_visible &&
drop_target_view_->side() == MultiContentsDropTargetView::DropSide::END;
+ const bool zen_mode = browser_view_->IsZenModeEnabledForLayout();
+ const bool top_edge_is_window_edge =
+ !IsTopChromeAttached(*browser_view_, contents_separators_.should_show_top);
+ const bool top_edge_is_window_edge = !IsTopChromeAttached(
+ *browser_view_, contents_separators_.should_show_top);
+ const bool can_use_system_corners =
+ (is_in_split || should_round_single_contents) && !is_fullscreen;
+ const bool leading_edge_is_window_edge =
@@ -1754,12 +1831,12 @@
+ contents_separators_.should_show_trailing) &&
+ !is_drop_target_on_end;
+
+ const bool use_system_top_left_radius =
+ can_use_system_corners && top_edge_is_window_edge &&
+ leading_edge_is_window_edge;
+ const bool use_system_top_right_radius =
+ can_use_system_corners && top_edge_is_window_edge &&
+ trailing_edge_is_window_edge;
+ const bool use_system_top_left_radius = can_use_system_corners &&
+ top_edge_is_window_edge &&
+ leading_edge_is_window_edge;
+ const bool use_system_top_right_radius = can_use_system_corners &&
+ top_edge_is_window_edge &&
+ trailing_edge_is_window_edge;
const bool use_system_bottom_left_radius =
- (is_in_split || should_round_single_contents) && !is_fullscreen &&
- !contents_separators_.should_show_leading && !is_drop_target_on_start;
@@ -1771,7 +1848,7 @@
for (auto* contents_container_view : contents_container_views_) {
const bool is_active =
@@ -855,6 +918,8 @@ void MultiContentsView::UpdateContentsBo
@@ -859,6 +921,8 @@ void MultiContentsView::UpdateContentsBo
contents_container_view->UpdateBorderAndOverlay(
is_in_split, should_round_contents, is_active,
is_active && active_contents_view_highlighted_,
@@ -1780,7 +1857,7 @@
use_system_bottom_left_radius && is_first_view,
use_system_bottom_right_radius && is_last_view);
}
@@ -907,10 +972,7 @@ void MultiContentsView::SetShouldShowTop
@@ -911,10 +975,7 @@ void MultiContentsView::SetShouldShowTop
return;
}
contents_separators_.should_show_top = should_show;
@@ -1792,7 +1869,7 @@
// This can be called during BrowserView layout, so protect against creating a
// layout loop.
@@ -922,11 +984,7 @@ void MultiContentsView::SetShouldShowLea
@@ -926,11 +987,7 @@ void MultiContentsView::SetShouldShowLea
return;
}
contents_separators_.should_show_leading = should_show;
@@ -1805,7 +1882,7 @@
// This can be called during BrowserView layout, so protect against creating a
// layout loop.
@@ -938,16 +996,25 @@ void MultiContentsView::SetShouldShowTra
@@ -942,16 +999,25 @@ void MultiContentsView::SetShouldShowTra
return;
}
contents_separators_.should_show_trailing = should_show;
@@ -1856,3 +1933,20 @@
AddLayerToRegion(border_.layer(), views::LayerRegion::kBelow);
views::AnimatingLayoutManager* animating_layout =
--- a/chrome/browser/ui/views/tabs/vertical/vertical_pinned_tab_container_view.cc
+++ b/chrome/browser/ui/views/tabs/vertical/vertical_pinned_tab_container_view.cc
@@ -94,11 +94,12 @@ views::ProposedLayout VerticalPinnedTabC
int available_width =
size_bounds.width().value() - region_horizontal_padding;
- children_on_row =
+ children_on_row = std::max(
+ 1,
std::min(children_on_row,
static_cast<int>(std::floor((available_width - child_width) /
(child_width + kTabPadding)) +
- 1));
+ 1)));
// Allocate extra space to the tabs.
available_width -=
@@ -147,7 +147,7 @@
for (auto* contents_container_view : contents_container_views_) {
auto& view_map = container_focusable_map_[contents_container_view];
@@ -643,6 +649,9 @@ gfx::Rect MultiContentsView::CalculateSe
@@ -644,6 +650,9 @@ gfx::Rect MultiContentsView::CalculateSe
false, gfx::Rect());
child_layouts.emplace_back(contents_separators_.corner_separator.get(),
false, gfx::Rect());
@@ -157,7 +157,7 @@
return available_space;
}
@@ -683,7 +692,6 @@ gfx::Rect MultiContentsView::CalculateSe
@@ -684,7 +693,6 @@ gfx::Rect MultiContentsView::CalculateSe
gfx::Rect(available_space.right() - trailing_separator_width,
available_space.y(), trailing_separator_width, height));
@@ -165,7 +165,7 @@
auto* const corner_separator = contents_separators_.corner_separator.get();
const auto corner_preferred_size = corner_separator->GetPreferredSize();
views::ChildLayout corner_layout(
@@ -706,6 +714,22 @@ gfx::Rect MultiContentsView::CalculateSe
@@ -707,6 +715,22 @@ gfx::Rect MultiContentsView::CalculateSe
}
child_layouts.push_back(corner_layout);
@@ -0,0 +1,16 @@
--- a/chrome/browser/ui/views/frame/browser_frame_view_win.cc
+++ b/chrome/browser/ui/views/frame/browser_frame_view_win.cc
@@ -624,11 +624,12 @@ int BrowserFrameViewWin::TopAreaHeight(b
}
const bool maximized = IsMaximized() && !restored;
- int top = FrameTopBorderThickness(restored);
+ int top = WindowTopY();
if (IsWebUITabStrip()) {
// Caption bar is default Windows size in maximized mode but full size when
// windows are tiled in tablet mode (baesd on behavior of first-party
// Windows applications).
+ top = FrameTopBorderThickness(restored);
top += maximized ? TitlebarMaximizedVisualHeight()
: caption_button_container_->GetPreferredSize().height();
return top;
@@ -180,7 +180,7 @@
(*s_allowlist)[::embedder_support::kAlternateErrorPagesEnabled] =
--- a/chrome/browser/resources/settings/appearance_page/appearance_page.ts
+++ b/chrome/browser/resources/settings/appearance_page/appearance_page.ts
@@ -480,6 +480,10 @@ export class SettingsAppearancePageEleme
@@ -485,6 +485,10 @@ export class SettingsAppearancePageEleme
return this.showVerticalTabsEnabled_ && layout === BrowserLayout.VERTICAL;
}
@@ -193,7 +193,7 @@
return;
--- a/chrome/browser/resources/settings/appearance_page/appearance_page.html
+++ b/chrome/browser/resources/settings/appearance_page/appearance_page.html
@@ -110,6 +110,12 @@
@@ -109,6 +109,12 @@
pref="{{prefs.helium.browser.vertical_right_aligned}}"
label="$i18n{tabStripRightAlign}">
</settings-toggle-button>
@@ -276,7 +276,7 @@
(*s_allowlist)[::embedder_support::kAlternateErrorPagesEnabled] =
--- a/chrome/browser/resources/settings/appearance_page/appearance_page.html
+++ b/chrome/browser/resources/settings/appearance_page/appearance_page.html
@@ -116,6 +116,10 @@
@@ -115,6 +115,10 @@
pref="{{prefs.helium.browser.centered_location_bar}}"
label="$i18n{centeredLocationBar}">
</settings-toggle-button>
+25 -7
View File
@@ -104,7 +104,26 @@
},
];
},
@@ -301,7 +318,7 @@ export class SettingsAppearancePageEleme
@@ -233,7 +250,11 @@ export class SettingsAppearancePageEleme
return loadTimeData.getBoolean('showVerticalTabsEnabled');
},
},
-
+ showVerticalSettings_: {
+ type: Boolean,
+ computed:
+ 'computeShowVerticalSettings_(prefs.helium.browser.layout.value)',
+ },
showTabStripComboButtonEnabled_: {
type: Boolean,
value() {
@@ -296,12 +317,13 @@ export class SettingsAppearancePageEleme
// </if>
declare private showVerticalTabsEnabled_: boolean;
+ declare private showVerticalSettings_: boolean;
declare private showTabStripComboButtonEnabled_: boolean;
declare private showProjectsPanelEnabled_: boolean;
declare private showEverythingMenuEnabled_: boolean;
declare private showManagedThemeDialog_: boolean;
declare private sidePanelOptions_: DropdownMenuOptionList;
@@ -113,11 +132,11 @@
private appearanceBrowserProxy_: AppearanceBrowserProxy =
AppearanceBrowserProxyImpl.getInstance();
private colorSchemeModeHandler_: CustomizeColorSchemeModeHandlerInterface =
@@ -459,6 +476,10 @@ export class SettingsAppearancePageEleme
@@ -459,6 +481,10 @@ export class SettingsAppearancePageEleme
}
// </if>
+ private showVerticalRightAlignSetting_(layout: number|undefined): boolean {
+ private computeShowVerticalSettings_(layout: number|undefined): boolean {
+ return this.showVerticalTabsEnabled_ && layout === BrowserLayout.VERTICAL;
+ }
+
@@ -126,7 +145,7 @@
return;
--- a/chrome/browser/resources/settings/appearance_page/appearance_page.html
+++ b/chrome/browser/resources/settings/appearance_page/appearance_page.html
@@ -92,6 +92,26 @@
@@ -92,6 +92,25 @@
</cr-button>
</template>
</div>
@@ -143,8 +162,7 @@
+ </div>
+ <div class="list-frame hover-card-toggles">
+ <settings-toggle-button
+ hidden="[[!showVerticalRightAlignSetting_(
+ prefs.helium.browser.layout.value)]]"
+ hidden="[[!showVerticalSettings_]]"
+ pref="{{prefs.helium.browser.vertical_right_aligned}}"
+ label="$i18n{tabStripRightAlign}">
+ </settings-toggle-button>
@@ -153,7 +171,7 @@
<div
class="hr"
hidden="[[!showHr_(
@@ -151,44 +171,6 @@
@@ -151,44 +170,6 @@
label="$i18n{showBookmarksBar}">
</settings-toggle-button>
+13
View File
@@ -1341,3 +1341,16 @@
return side_panel->IsRightAligned()
? gfx::RoundedCornersF(generic_radius, generic_radius,
--- a/chrome/browser/ui/views/frame/browser_frame_view_win.cc
+++ b/chrome/browser/ui/views/frame/browser_frame_view_win.cc
@@ -673,6 +673,10 @@ int BrowserFrameViewWin::GetFrameHeight(
return info.tabstrip_preferred_height - WindowTopY() -
GetLayoutConstant(LayoutConstant::kTabstripToolbarOverlap);
}
+ if (GetBrowserView()->ShouldDrawVerticalTabStrip() &&
+ GetBrowserView()->toolbar()) {
+ return GetBrowserView()->toolbar()->GetPreferredSize().height();
+ }
return IsMaximized() ? TitlebarMaximizedVisualHeight()
: TitlebarHeight(false);
}
@@ -275,7 +275,7 @@
raw_ptr<views::ImageView> icon_view_ = nullptr;
--- a/chrome/browser/ui/views/frame/multi_contents_view.cc
+++ b/chrome/browser/ui/views/frame/multi_contents_view.cc
@@ -610,27 +610,49 @@ gfx::Rect MultiContentsView::CalculateDr
@@ -611,27 +611,49 @@ gfx::Rect MultiContentsView::CalculateDr
std::vector<views::ChildLayout>& child_layouts) const {
CHECK(IsDragAndDropEnabled());
if (!drop_target_view_->GetVisible()) {
@@ -336,8 +336,8 @@
return gfx::Rect(remaining_space_x, available_space.y(),
available_space.width() - drop_target_width,
@@ -795,19 +817,26 @@ bool MultiContentsView::ShouldUseRounded
return browser_view_->GetIsNormalType() && is_rounded_frame_pref_enabled_;
@@ -799,19 +821,26 @@ bool MultiContentsView::ShouldUseRounded
!is_fullscreen;
}
-void MultiContentsView::UpdateContentsBorderAndOverlay() {
+19 -8
View File
@@ -265,7 +265,15 @@
}
MultiContentsView::~MultiContentsView() {
@@ -479,8 +487,10 @@ views::ProposedLayout MultiContentsView:
@@ -411,6 +419,7 @@ void MultiContentsView::OnThemeChanged()
void MultiContentsView::OnFullscreenStateChanged() {
UpdateContentsBorderAndOverlay();
+ InvalidateLayout();
}
int MultiContentsView::GetInactiveIndex() const {
@@ -479,8 +488,10 @@ views::ProposedLayout MultiContentsView:
gfx::Rect available_space = gfx::Rect(width, height);
@@ -277,7 +285,7 @@
layouts.child_layouts.emplace_back(background_view_.get(), show_background,
available_space);
@@ -505,6 +515,15 @@ views::ProposedLayout MultiContentsView:
@@ -505,6 +516,15 @@ views::ProposedLayout MultiContentsView:
if (IsInSplitView()) {
start_rect.Inset(start_contents_view_inset_);
end_rect.Inset(end_contents_view_inset_);
@@ -293,7 +301,7 @@
}
layouts.child_layouts.emplace_back(contents_container_views_[0],
@@ -615,7 +634,7 @@ gfx::Rect MultiContentsView::CalculateDr
@@ -615,7 +635,7 @@ gfx::Rect MultiContentsView::CalculateDr
gfx::Rect MultiContentsView::CalculateSeparatorLayouts(
const gfx::Rect& available_space,
std::vector<views::ChildLayout>& child_layouts) const {
@@ -302,12 +310,15 @@
child_layouts.emplace_back(contents_separators_.top_separator.get(), false,
gfx::Rect());
child_layouts.emplace_back(contents_separators_.leading_separator.get(),
@@ -748,27 +767,40 @@ int MultiContentsView::GetMinViewWidth(g
@@ -748,27 +768,43 @@ int MultiContentsView::GetMinViewWidth(g
std::max(kConstrainedMinWebContentsWidth, min_percentage));
}
+bool MultiContentsView::ShouldUseRoundedFrame() const {
+ return browser_view_->GetIsNormalType() && is_rounded_frame_pref_enabled_;
+ const views::Widget* widget = browser_view_->GetWidget();
+ const bool is_fullscreen = widget && widget->IsFullscreen();
+ return browser_view_->GetIsNormalType() && is_rounded_frame_pref_enabled_ &&
+ !is_fullscreen;
+}
+
void MultiContentsView::UpdateContentsBorderAndOverlay() {
@@ -346,7 +357,7 @@
is_active && active_contents_view_highlighted_,
use_system_bottom_left_radius && is_first_view,
use_system_bottom_right_radius && is_last_view);
@@ -809,6 +841,14 @@ void MultiContentsView::OnDragAndDropPre
@@ -809,6 +845,14 @@ void MultiContentsView::OnDragAndDropPre
InvalidateLayout();
}
@@ -361,7 +372,7 @@
void MultiContentsView::SetShouldShowTopSeparator(bool should_show) {
if (contents_separators_.should_show_top == should_show) {
return;
@@ -831,7 +871,7 @@ void MultiContentsView::SetShouldShowLea
@@ -831,7 +875,7 @@ void MultiContentsView::SetShouldShowLea
contents_separators_.should_show_leading = should_show;
start_contents_view_inset_.set_left(
should_show ? 0 : MultiContentsView::kSplitViewContentInset);
@@ -370,7 +381,7 @@
UpdateContentsBorderAndOverlay();
}
@@ -847,7 +887,7 @@ void MultiContentsView::SetShouldShowTra
@@ -847,7 +891,7 @@ void MultiContentsView::SetShouldShowTra
contents_separators_.should_show_trailing = should_show;
end_contents_view_inset_.set_right(
should_show ? 0 : MultiContentsView::kSplitViewContentInset);
+34 -8
View File
@@ -64,6 +64,20 @@
};
const SkColor active_bg =
@@ -266,11 +272,9 @@ SkColor TabStyle::GetCurrentTabBackgroun
gfx::Insets TabStyle::GetContentsInsets() const {
return gfx::Insets::TLBR(
- kChromeRefreshTabVerticalPadding +
- GetLayoutConstant(LayoutConstant::kTabStripPadding),
+ kChromeRefreshTabVerticalPadding,
GetBottomCornerRadius() + kChromeRefreshTabHorizontalPadding,
- kChromeRefreshTabVerticalPadding +
- GetLayoutConstant(LayoutConstant::kTabStripPadding),
+ kChromeRefreshTabVerticalPadding,
GetBottomCornerRadius() + kChromeRefreshTabHorizontalPadding);
}
--- a/chrome/browser/ui/views/tabs/tab_style_views.cc
+++ b/chrome/browser/ui/views/tabs/tab_style_views.cc
@@ -202,8 +202,6 @@ SkPath TabStyleViewsImpl::GetPath(TabSty
@@ -209,7 +223,19 @@
bool g_show_hover_card_on_mouse_hover = true;
@@ -456,19 +453,15 @@ void Tab::Layout(PassKey) {
@@ -401,7 +398,10 @@ void Tab::Layout(PassKey) {
// The bounds for the favicon will include extra width for the attention
// indicator, but visually it will be smaller at kFaviconSize wide.
- gfx::Rect favicon_bounds(start, contents_rect.y(), 0, 0);
+ gfx::Rect favicon_bounds(
+ start,
+ contents_rect.y() + Center(contents_rect.height(), gfx::kFaviconSize),
+ 0, 0);
if (showing_icon_) {
if (center_icon_) {
// When centering the favicon, the favicon is allowed to escape the normal
@@ -456,19 +456,15 @@ void Tab::Layout(PassKey) {
}
close_button_->SetVisible(showing_close_button_);
@@ -234,7 +260,7 @@
contents_rect.y() + Center(contents_rect.height(), image_size.height()),
image_size.width(), image_size.height());
if (center_icon_) {
@@ -479,6 +472,7 @@ void Tab::Layout(PassKey) {
@@ -479,6 +475,7 @@ void Tab::Layout(PassKey) {
MaybeAdjustLeftForPinnedTab(&bounds, bounds.width());
}
alert_indicator_button_->SetBoundsRect(bounds);
@@ -242,7 +268,7 @@
}
alert_indicator_button_->UpdateAlertIndicatorAnimation();
alert_indicator_button_->SetVisible(showing_alert_indicator_);
@@ -487,7 +481,9 @@ void Tab::Layout(PassKey) {
@@ -487,7 +484,9 @@ void Tab::Layout(PassKey) {
bool show_title = ShouldRenderAsNormalTab();
if (show_title) {
int title_left = start;
@@ -253,7 +279,7 @@
// When computing the spacing from the favicon, don't count the actual
// icon view width (which will include extra room for the alert
// indicator), but rather the normal favicon width which is what it will
@@ -498,9 +494,7 @@ void Tab::Layout(PassKey) {
@@ -498,9 +497,7 @@ void Tab::Layout(PassKey) {
title_left = std::max(title_left, after_favicon);
}
int title_right = contents_rect.right();
@@ -264,7 +290,7 @@
// Allow the title to overlay the close button's empty border padding.
title_right = close_x - after_title_padding;
}
@@ -1160,7 +1154,7 @@ void Tab::UpdateIconVisibility() {
@@ -1160,7 +1157,7 @@ void Tab::UpdateIconVisibility() {
const int close_button_width =
GetLayoutConstant(LayoutConstant::kTabCloseButtonSize) +
GetLayoutConstant(LayoutConstant::kTabAfterTitlePadding);
@@ -273,7 +299,7 @@
available_width >= (touch_ui ? kTouchMinimumContentsWidthForCloseButtons
: kMinimumContentsWidthForCloseButtons);
@@ -1211,6 +1205,7 @@ void Tab::UpdateIconVisibility() {
@@ -1211,6 +1208,7 @@ void Tab::UpdateIconVisibility() {
controller_->GetTabCount() >=
TabStyle::kTabStripDeclutterMinTabsForCloseHide;
showing_close_button_ =
@@ -281,7 +307,7 @@
!base::CommandLine::ForCurrentProcess()->HasSwitch("hide-tab-close-buttons") &&
#if BUILDFLAG(IS_CHROMEOS)
should_show_close_button &&
@@ -1235,10 +1230,6 @@ void Tab::UpdateIconVisibility() {
@@ -1235,10 +1233,6 @@ void Tab::UpdateIconVisibility() {
}
}
}
@@ -292,7 +318,7 @@
}
bool Tab::ShouldRenderAsNormalTab() const {
@@ -1258,15 +1249,29 @@ void Tab::UpdateTabIconAttention() {
@@ -1258,15 +1252,29 @@ void Tab::UpdateTabIconAttention() {
}
int Tab::GetWidthOfLargestSelectableRegion() const {
+1
View File
@@ -295,6 +295,7 @@ helium/ui/pdf-viewer.patch
helium/ui/hide-pip-live-caption-button.patch
helium/ui/disable-ink-ripple-effect.patch
helium/ui/dont-antialias-rects.patch
helium/ui/fix-windows-ui-position.patch
helium/ui/experiments/zen-mode-wiring.patch
helium/ui/experiments/zen-caption-buttons.patch
+1 -1
View File
@@ -1 +1 @@
4
5
+2 -1
View File
@@ -10,6 +10,7 @@ import xml.etree.ElementTree as xml
import argparse
import json
import re
import os
import sys
from collections import defaultdict
@@ -195,7 +196,7 @@ def apply_translations(tree):
xtb_index = build_xtb_index(source, tree)
tasks = [(code, source, xtb_index) for code in languages]
with Pool() as pool:
with Pool(min(32, os.cpu_count() or 1)) as pool:
pool.map(apply_language, tasks)