Compare commits

...

26 Commits

Author SHA1 Message Date
jj d14e214a34 revision: bump to 3 (#1682) 2026-05-14 09:43:10 +03:00
jj 48eb96f4a3 helium/zen: fix zen vts not displaying on windows (#1681)
fixes imputnet/helium-windows#259
2026-05-14 06:42:43 +00:00
wukko 549f912f82 merge: update to chromium 148.0.7778.167 (#1679) 2026-05-14 12:17:38 +06:00
wukko b304a82afb patches: refresh for chromium 148.0.7778.167 2026-05-13 15:26:49 +03:00
wukko 4f53b3ce3e merge: update ungoogled-chromium to 148.0.7778.167 2026-05-13 15:09:12 +03:00
Blaise dca3530bdd Update to Chromium 148.0.7778.167 2026-05-12 14:29:13 -05:00
jj d028d7d459 revision: bump to 2 (#1668) 2026-05-12 19:19:32 +06:00
jj 1116777318 helium: add support for configuring custom keyboard shortcuts (#1552)
closes #119

Co-authored-by: wukko <me@wukko.me>
2026-05-12 15:17:52 +02:00
wukko d3c146cab1 helium/ui/zen: floating VTS sidebar with slide animation, refactor (#1590)
- the sidebar now visually appears as a floating surface, with proper
padding, margins, rounded corners, and an outline
- the sidebar now slides in/out instead of scaling down in width
- separated top/side chrome pin effect logic
- redone top chrome autopin when any bubbles (and app menu, which is not
a bubble, surprisingly) are visible
- introduced a ZenModeLayoutState struct to reduce generic zen prop
duplication
- reduced trigger area thickness and improved grace period timing
2026-05-12 12:29:44 +06:00
wukko de395cbfc6 helium/ui/color-mixers: improve light mode element contrast (#1663)
increases contrast of tabs and location bar in light mode, both in
greyscale (default) and tinted themes. also fixes the color of content
separators in default light theme.

fixes #1532
2026-05-11 14:50:32 +06:00
jj 52a83d0a6f helium/noise: harden & improve performance of noising algorithms (#1642) 2026-05-11 10:31:43 +02:00
jj 1884190d95 helium: move all hardcoded strings to grd for i18n (#1655)
fixes #1553
2026-05-10 20:44:03 +00:00
wukko e830f2cf55 helium/ui: remove toolbar dividers (#1656)
fixes #1116 
supersedes #1654
2026-05-11 02:31:09 +06:00
jj 245e236154 helium/noise/canvas: reduce noise on smooth pixels
detect locally smooth pixel neighborhoods while building the content
hash, and apply a lighter noise pattern there to make slow gradients
look much less distorted without removing noising from them entirely
2026-05-10 18:19:22 +00:00
jj 5fcaac214c helium/noise/canvas: avalanche coordinate seeds
avalanche coordinates before feeding them into the hash so they don't
produce visible artifacts, and everything is noised instead which is
much less obvious and more pleasant to look at
2026-05-10 16:34:21 +00:00
jj ac103b4708 helium/noise/canvas: refactor 2026-05-10 16:34:21 +00:00
jj b48236f772 helium/noise/audio: add coordinate jitter to audio readback 2026-05-10 16:34:21 +00:00
jj ac87ba6409 helium/noise/canvas: split content and coordinate noise
derive the stable rgb component from the source pixel and its local
neighborhood, then add a separate coordinate jitter component. the
same local content now keeps a stable bias across positions, while
readback/export coordinates still affect the final value.
2026-05-10 16:34:21 +00:00
jj abe3e55672 helium/noise/canvas: simplify float noising paths
replace the shared float-like traits helper with explicit f32 and f16
paths, cache quantized source pixels once and reuse it for empty checks
and hash input, avoiding repeated f16 -> float conversion for neighbor
lookups.
2026-05-10 16:34:21 +00:00
jj 118c87c414 helium/noise/canvas: write pixels back directly to buffer
dropping SpanWriter results in about a 3-4x perf boost
2026-05-10 16:34:21 +00:00
jj db09cac3d1 helium/zen: add new tab toast when opening links in zen mode (#1649)
fixes #1236
2026-05-10 18:28:54 +02:00
jj 1cd894dbfb helium/core/kb-shortcuts: open downloads bubble when available (#1652)
when the download toolbar ui is available (e.g. if something was
downloaded), open the bubble instead of the webui page, and fall back
otherwise

fixes #1149
2026-05-10 15:41:44 +00:00
jj b974f81445 helium/override-protocol: override protocol in tab search ui (#1650)
fixes #1574
2026-05-10 17:29:21 +02:00
jj 2b78ce4852 helium/noise/canvas: support floating point types and imagedata (#1625) 2026-05-09 19:21:36 +02:00
wukko 06bc5f816d helium/ui/app-menu: restore exit option under "more tools" (#1628)
closes #1612
2026-05-08 16:45:13 +00:00
Blaise d195bfc940 Update to Chromium 148.0.7778.96 2026-05-05 15:23:22 -05:00
61 changed files with 5927 additions and 709 deletions
+1 -1
View File
@@ -1 +1 @@
148.0.7778.96
148.0.7778.167
+306
View File
@@ -35,6 +35,30 @@
"context": "Label for a performance settings toggle that controls whether performance intervention notifications should be shown and link to learn more about performance issue alerts.",
"message": "Get notifications that suggest ways to improve detected performance issues."
},
{
"name": "IDS_IMPORT_FULL_DISK_ACCESS_DIALOG_TITLE",
"source": "chrome/app/generated_resources.grd",
"context": "Title for the dialog shown when Full Disk Access is needed to import from Safari.",
"message": "Full Disk Access required"
},
{
"name": "IDS_IMPORT_FULL_DISK_ACCESS_DIALOG_MESSAGE",
"source": "chrome/app/generated_resources.grd",
"context": "Message for the dialog shown when Full Disk Access is needed to import bookmarks from Safari.",
"message": "Helium needs Full Disk Access to import your Bookmarks from Safari."
},
{
"name": "IDS_IMPORT_FULL_DISK_ACCESS_DIALOG_LINK",
"source": "chrome/app/generated_resources.grd",
"context": "Help link text in the dialog shown when Full Disk Access is needed to import from Safari.",
"message": "Learn how to grant Full Disk Access from your System Preferences."
},
{
"name": "IDS_IMPORT_FULL_DISK_ACCESS_DIALOG_OPEN_SETTINGS",
"source": "chrome/app/generated_resources.grd",
"context": "Accept button text for opening System Preferences from the Full Disk Access import dialog.",
"message": "Open System Preferences"
},
{
"name": "IDS_IMPORTED_FROM_BOOKMARK_FOLDER",
"source": "chrome/app/generated_resources.grd",
@@ -119,6 +143,12 @@
"context": "ARIA label of the text input for overriding the Helium services server",
"message": "Custom origin URL for Helium services"
},
{
"name": "IDS_SETTINGS_HELIUM_SERVICES_OVERRIDE_INVALID_ORIGIN",
"source": "chrome/app/settings_strings.grdp",
"context": "Validation error shown when the custom Helium services origin is invalid.",
"message": "Invalid origin"
},
{
"name": "IDS_APPMENU_TOOLTIP_HELIUM_SERVICES_UPDATE",
"source": "chrome/app/chromium_strings.grd",
@@ -299,6 +329,198 @@
"context": "In Title Case: The label of the 'Close Tabs Above' Tab context menu item.",
"message": "Close Tabs Above"
},
{
"name": "IDS_SHORTCUT_COMMAND_SELECT_NEXT_TAB",
"source": "chrome/app/generated_resources.grd",
"context": "Command name shown on the Settings shortcuts page for selecting the next tab.",
"message": "Next tab"
},
{
"name": "IDS_SHORTCUT_COMMAND_SELECT_PREVIOUS_TAB",
"source": "chrome/app/generated_resources.grd",
"context": "Command name shown on the Settings shortcuts page for selecting the previous tab.",
"message": "Previous tab"
},
{
"name": "IDS_SHORTCUT_COMMAND_FOCUS_LOCATION",
"source": "chrome/app/generated_resources.grd",
"context": "Command name shown on the Settings shortcuts page for focusing the address bar.",
"message": "Focus address bar"
},
{
"name": "IDS_SHORTCUT_COMMAND_FIND_NEXT",
"source": "chrome/app/generated_resources.grd",
"context": "Command name shown on the Settings shortcuts page for finding the next match in the current page.",
"message": "Find next"
},
{
"name": "IDS_SHORTCUT_COMMAND_FIND_PREVIOUS",
"source": "chrome/app/generated_resources.grd",
"context": "Command name shown on the Settings shortcuts page for finding the previous match in the current page.",
"message": "Find previous"
},
{
"name": "IDS_SHORTCUT_COMMAND_BACK",
"source": "chrome/app/generated_resources.grd",
"context": "Command name shown on the Settings shortcuts page for navigating back.",
"message": "Back"
},
{
"name": "IDS_SHORTCUT_COMMAND_FORWARD",
"source": "chrome/app/generated_resources.grd",
"context": "Command name shown on the Settings shortcuts page for navigating forward.",
"message": "Forward"
},
{
"name": "IDS_SHORTCUT_COMMAND_HOME",
"source": "chrome/app/generated_resources.grd",
"context": "Command name shown on the Settings shortcuts page for opening the home page.",
"message": "Home"
},
{
"name": "IDS_SHORTCUT_COMMAND_NEW_SPLIT_TAB",
"source": "chrome/app/generated_resources.grd",
"context": "Command name shown on the Settings shortcuts page for opening a new split tab.",
"message": "New split tab"
},
{
"name": "IDS_SHORTCUT_COMMAND_SELECT_LAST_TAB",
"source": "chrome/app/generated_resources.grd",
"context": "Command name shown on the Settings shortcuts page for selecting the last tab.",
"message": "Last tab"
},
{
"name": "IDS_SHORTCUT_COMMAND_SELECT_TAB",
"source": "chrome/app/generated_resources.grd",
"context": "Command name shown on the Settings shortcuts page for selecting a tab by number.",
"message": "Tab <ph name=\"TAB_NUMBER\">$1<ex>1</ex></ph>"
},
{
"name": "IDS_SHORTCUT_COMMAND_MOVE_TAB_NEXT",
"source": "chrome/app/generated_resources.grd",
"context": "Command name shown on the Settings shortcuts page for moving the current tab to the right.",
"message": "Move tab right"
},
{
"name": "IDS_SHORTCUT_COMMAND_MOVE_TAB_PREVIOUS",
"source": "chrome/app/generated_resources.grd",
"context": "Command name shown on the Settings shortcuts page for moving the current tab to the left.",
"message": "Move tab left"
},
{
"name": "IDS_SHORTCUT_COMMAND_FOCUS_NEXT_TAB_GROUP",
"source": "chrome/app/generated_resources.grd",
"context": "Command name shown on the Settings shortcuts page for focusing the next tab group.",
"message": "Next tab group"
},
{
"name": "IDS_SHORTCUT_COMMAND_FOCUS_PREVIOUS_TAB_GROUP",
"source": "chrome/app/generated_resources.grd",
"context": "Command name shown on the Settings shortcuts page for focusing the previous tab group.",
"message": "Previous tab group"
},
{
"name": "IDS_SHORTCUT_COMMAND_CLOSE_TAB_GROUP",
"source": "chrome/app/generated_resources.grd",
"context": "Command name shown on the Settings shortcuts page for closing the current tab group.",
"message": "Close tab group"
},
{
"name": "IDS_SHORTCUT_COMMAND_FOCUS_BOOKMARKS",
"source": "chrome/app/generated_resources.grd",
"context": "Command name shown on the Settings shortcuts page for focusing the bookmarks bar.",
"message": "Focus bookmarks bar"
},
{
"name": "IDS_SHORTCUT_COMMAND_TOGGLE_VERTICAL_TABS",
"source": "chrome/app/generated_resources.grd",
"context": "Command name shown on the Settings shortcuts page for toggling vertical tabs with the Ctrl+S shortcut when vertical layout is active.",
"message": "Toggle vertical tabs"
},
{
"name": "IDS_SHORTCUT_COMMAND_CLOSE_FIND_OR_STOP",
"source": "chrome/app/generated_resources.grd",
"context": "Command name shown on the Settings shortcuts page for closing the find bar or stopping page loading.",
"message": "Close find bar or stop loading"
},
{
"name": "IDS_SHORTCUT_COMMAND_FOCUS_SEARCH",
"source": "chrome/app/generated_resources.grd",
"context": "Command name shown on the Settings shortcuts page for focusing search.",
"message": "Focus search"
},
{
"name": "IDS_SHORTCUT_COMMAND_FOCUS_NEXT_PANE",
"source": "chrome/app/generated_resources.grd",
"context": "Command name shown on the Settings shortcuts page for focusing the next browser pane.",
"message": "Focus next pane"
},
{
"name": "IDS_SHORTCUT_COMMAND_FOCUS_PREVIOUS_PANE",
"source": "chrome/app/generated_resources.grd",
"context": "Command name shown on the Settings shortcuts page for focusing the previous browser pane.",
"message": "Focus previous pane"
},
{
"name": "IDS_SHORTCUT_COMMAND_FOCUS_WEB_CONTENTS_PANE",
"source": "chrome/app/generated_resources.grd",
"context": "Command name shown on the Settings shortcuts page for focusing page content.",
"message": "Focus page content"
},
{
"name": "IDS_SHORTCUT_COMMAND_FOCUS_MENU_BAR",
"source": "chrome/app/generated_resources.grd",
"context": "Command name shown on the Settings shortcuts page for focusing the menu bar.",
"message": "Focus menu bar"
},
{
"name": "IDS_SHORTCUT_COMMAND_FOCUS_TOOLBAR",
"source": "chrome/app/generated_resources.grd",
"context": "Command name shown on the Settings shortcuts page for focusing the toolbar.",
"message": "Focus toolbar"
},
{
"name": "IDS_SHORTCUT_COMMAND_FOCUS_INACTIVE_POPUP",
"source": "chrome/app/generated_resources.grd",
"context": "Command name shown on the Settings shortcuts page for focusing an inactive popup for accessibility.",
"message": "Focus inactive popup"
},
{
"name": "IDS_SHORTCUT_COMMAND_SHOW_AVATAR_MENU",
"source": "chrome/app/generated_resources.grd",
"context": "Command name shown on the Settings shortcuts page for opening the profile menu.",
"message": "Profile menu"
},
{
"name": "IDS_SHORTCUT_COMMAND_SHOW_APP_MENU",
"source": "chrome/app/generated_resources.grd",
"context": "Command name shown on the Settings shortcuts page for opening the app menu.",
"message": "App menu"
},
{
"name": "IDS_SHORTCUT_COMMAND_TOGGLE_ZEN_MODE_TOP_CHROME_PIN",
"source": "chrome/app/generated_resources.grd",
"context": "Command name shown on the Settings shortcuts page for pinning or unpinning the top toolbar in zen mode.",
"message": "Pin top toolbar"
},
{
"name": "IDS_SHORTCUT_COMMAND_TOGGLE_DEV_TOOLS",
"source": "chrome/app/generated_resources.grd",
"context": "Command name shown on the Settings shortcuts page for toggling Developer Tools.",
"message": "Toggle developer tools"
},
{
"name": "IDS_APP_PLUS_KEY",
"source": "ui/strings/ui_strings.grd",
"context": "Plus key, which is the key labelled with a plus sign.",
"message": "Plus"
},
{
"name": "IDS_APP_NUMPAD_KEY",
"source": "ui/strings/ui_strings.grd",
"context": "Label for a key located on the numeric keypad. $1 is a localized key name or a digit, for example '1' or 'Plus'.",
"message": "Numpad <ph name=\"KEY_NAME\">$1<ex>1</ex></ph>"
},
{
"name": "IDS_SETTINGS_PERMISSIONS_DESCRIPTION_NORMAL",
"source": "chrome/app/settings_strings.grdp",
@@ -383,6 +605,84 @@
"context": "The tooltip shown for the custom avatar photo of the user.",
"message": "Custom avatar"
},
{
"name": "IDS_SETTINGS_SHORTCUTS_TITLE",
"source": "chrome/app/settings_strings.grdp",
"context": "Title of the keyboard shortcuts Settings subpage and row.",
"message": "Keyboard shortcuts"
},
{
"name": "IDS_SETTINGS_SHORTCUTS_SEARCH_LABEL",
"source": "chrome/app/settings_strings.grdp",
"context": "Placeholder for the search/filter field on the browser shortcuts Settings page.",
"message": "Search shortcuts"
},
{
"name": "IDS_SETTINGS_SHORTCUTS_REMOVE_A11Y_LABEL",
"source": "chrome/app/settings_strings.grdp",
"context": "Accessibility label for removing a browser keyboard shortcut.",
"message": "Remove <ph name=\"SHORTCUT\">$1<ex>Ctrl+T</ex></ph> from <ph name=\"COMMAND\">$2<ex>New tab</ex></ph>"
},
{
"name": "IDS_SETTINGS_SHORTCUTS_RESET_ALL",
"source": "chrome/app/settings_strings.grdp",
"context": "Button label for resetting all browser command shortcuts.",
"message": "Reset all to defaults"
},
{
"name": "IDS_SETTINGS_SHORTCUTS_ADD_DIALOG_TITLE",
"source": "chrome/app/settings_strings.grdp",
"context": "Title of the dialog for recording a new browser keyboard shortcut.",
"message": "Add shortcut"
},
{
"name": "IDS_SETTINGS_SHORTCUTS_RESET_DIALOG_DESCRIPTION",
"source": "chrome/app/settings_strings.grdp",
"context": "Description of the confirmation dialog shown when user resets their shortcuts to default.",
"message": "All keyboard shortcuts will be reset to their default values. Any custom shortcuts you've set will be lost."
},
{
"name": "IDS_SETTINGS_SHORTCUTS_PRESS_SHORTCUT",
"source": "chrome/app/settings_strings.grdp",
"context": "Prompt shown while waiting for the user to press keys to create a shortcut.",
"message": "Press a combination of keys to create a new shortcut"
},
{
"name": "IDS_SETTINGS_SHORTCUTS_NEED_KEY",
"source": "chrome/app/settings_strings.grdp",
"context": "Validation message shown when a shortcut recording contains only modifier keys.",
"message": "Include a key that is not a modifier."
},
{
"name": "IDS_SETTINGS_SHORTCUTS_WILL_OVERRIDE",
"source": "chrome/app/settings_strings.grdp",
"context": "Warning shown when a shortcut is already assigned to another modifiable browser command.",
"message": "Saving will remove this shortcut from <ph name=\"COMMAND\">$1<ex>New tab</ex></ph>."
},
{
"name": "IDS_SETTINGS_SHORTCUTS_SYSTEM_CONFLICT",
"source": "chrome/app/settings_strings.grdp",
"context": "Error shown when a shortcut is already assigned to a browser command that cannot be modified.",
"message": "This shortcut is managed by <ph name=\"COMMAND\">$1<ex>Full screen</ex></ph> and cannot be changed."
},
{
"name": "IDS_SETTINGS_SHORTCUTS_INVALID",
"source": "chrome/app/settings_strings.grdp",
"context": "Error shown when a shortcut cannot be saved.",
"message": "This shortcut cannot be saved."
},
{
"name": "IDS_SETTINGS_SHORTCUTS_MAC_SYSTEM_SETTINGS_NOTICE",
"source": "chrome/app/settings_strings.grdp",
"context": "macOS-only note shown on the browser shortcuts Settings page explaining that some keyboard shortcuts are protected and/or managed outside the browser.",
"message": "Some keyboard shortcuts are protected and can't be changed here. To change them, go to:"
},
{
"name": "IDS_SETTINGS_SHORTCUTS_MAC_SYSTEM_SETTINGS_LINK",
"source": "chrome/app/settings_strings.grdp",
"context": "macOS-only link on the browser shortcuts Settings page that opens the system keyboard shortcuts settings.",
"message": "System Settings &gt; Keyboard &gt; Keyboard Shortcuts &gt; App Shortcuts"
},
{
"name": "IDS_POLICY_SOURCE_HOP",
"source": "components/policy_strings.grdp",
@@ -587,6 +887,12 @@
"context": "Description for the toggle to pin the top bar when in Zen mode.",
"message": "Always show the top bar"
},
{
"name": "IDS_ZEN_MODE_NEW_TAB_CREATED_TOAST_BODY",
"source": "chrome/app/generated_resources.grd",
"context": "Text on a toast notification that is shown when a link opens a new tab while Zen Mode is enabled.",
"message": "New tab opened"
},
{
"name": "IDS_SETTINGS_DEFAULT_BROWSER_SECONDARY",
"source": "chrome/app/settings_chromium_strings.grdp",
+28 -5
View File
@@ -1873,21 +1873,21 @@ along with this program. If not, see <http://www.gnu.org/licenses/>.
+FullDiskAccessConfirmDialogDelegate::~FullDiskAccessConfirmDialogDelegate() =
+ default;
+
+// TODO: figure out l10n
+std::u16string FullDiskAccessConfirmDialogDelegate::GetTitle() {
+ return u"Full Disk Access required";
+ return l10n_util::GetStringUTF16(IDS_IMPORT_FULL_DISK_ACCESS_DIALOG_TITLE);
+}
+
+std::u16string FullDiskAccessConfirmDialogDelegate::GetDialogMessage() {
+ return u"Helium needs Full Disk Access to import your Bookmarks from Safari.";
+ return l10n_util::GetStringUTF16(IDS_IMPORT_FULL_DISK_ACCESS_DIALOG_MESSAGE);
+}
+
+std::u16string FullDiskAccessConfirmDialogDelegate::GetLinkText() const {
+ return u"Learn how to grant Full Disk Access from your System Preferences.";
+ return l10n_util::GetStringUTF16(IDS_IMPORT_FULL_DISK_ACCESS_DIALOG_LINK);
+}
+
+std::u16string FullDiskAccessConfirmDialogDelegate::GetAcceptButtonTitle() {
+ return u"Open System Preferences";
+ return l10n_util::GetStringUTF16(
+ IDS_IMPORT_FULL_DISK_ACCESS_DIALOG_OPEN_SETTINGS);
+}
+
+void FullDiskAccessConfirmDialogDelegate::OnAccepted() {
@@ -3255,3 +3255,26 @@ along with this program. If not, see <http://www.gnu.org/licenses/>.
+};
+
+#endif // BRAVE_UTILITY_IMPORTER_CHROME_IMPORTER_H_
--- a/chrome/app/generated_resources.grd
+++ b/chrome/app/generated_resources.grd
@@ -11594,6 +11594,20 @@ Check your passwords anytime in <ph name
<message name="IDS_IMPORT_FROM_SAFARI" desc="browser combo box: Safari">
Safari
</message>
+ <if expr="is_macosx">
+ <message name="IDS_IMPORT_FULL_DISK_ACCESS_DIALOG_TITLE" desc="Title for the dialog shown when Full Disk Access is needed to import from Safari.">
+ Full Disk Access required
+ </message>
+ <message name="IDS_IMPORT_FULL_DISK_ACCESS_DIALOG_MESSAGE" desc="Message for the dialog shown when Full Disk Access is needed to import bookmarks from Safari.">
+ Helium needs Full Disk Access to import your Bookmarks from Safari.
+ </message>
+ <message name="IDS_IMPORT_FULL_DISK_ACCESS_DIALOG_LINK" desc="Help link text in the dialog shown when Full Disk Access is needed to import from Safari.">
+ Learn how to grant Full Disk Access from your System Preferences.
+ </message>
+ <message name="IDS_IMPORT_FULL_DISK_ACCESS_DIALOG_OPEN_SETTINGS" desc="Accept button text for opening System Preferences from the Full Disk Access import dialog.">
+ Open System Preferences
+ </message>
+ </if>
<message name="IDS_IMPORT_FROM_BOOKMARKS_HTML_FILE" desc="browser combo box: Bookmarks HTML File">
Bookmarks HTML File
</message>
+1 -1
View File
@@ -244,7 +244,7 @@ along with this program. If not, see <http://www.gnu.org/licenses/>.
}
--- a/chrome/common/pref_names.h
+++ b/chrome/common/pref_names.h
@@ -3601,6 +3601,9 @@ inline constexpr char kSharedWorkerBlobU
@@ -3607,6 +3607,9 @@ inline constexpr char kSharedWorkerBlobU
inline constexpr char kSharedWorkerExtendedLifetimeEnabled[] =
"worker.shared_worker_extended_lifetime_enabled";
+3 -3
View File
@@ -117,7 +117,7 @@ along with this program. If not, see <http://www.gnu.org/licenses/>.
--- a/chrome/browser/ui/views/frame/browser_view.cc
+++ b/chrome/browser/ui/views/frame/browser_view.cc
@@ -314,7 +314,10 @@
@@ -315,7 +315,10 @@
#include "ui/compositor/paint_recorder.h"
#include "ui/content_accelerators/accelerator_util.h"
#include "ui/display/screen.h"
@@ -128,7 +128,7 @@ along with this program. If not, see <http://www.gnu.org/licenses/>.
#include "ui/gfx/animation/animation_runner.h"
#include "ui/gfx/canvas.h"
#include "ui/gfx/color_utils.h"
@@ -332,6 +335,7 @@
@@ -333,6 +336,7 @@
#include "ui/views/controls/button/menu_button.h"
#include "ui/views/controls/textfield/textfield.h"
#include "ui/views/controls/webview/webview.h"
@@ -136,7 +136,7 @@ along with this program. If not, see <http://www.gnu.org/licenses/>.
#include "ui/views/interaction/element_tracker_views.h"
#include "ui/views/layout/fill_layout.h"
#include "ui/views/view.h"
@@ -838,6 +842,83 @@ class BrowserView::ExclusiveAccessContex
@@ -839,6 +843,83 @@ class BrowserView::ExclusiveAccessContex
base::WeakPtrFactory<ExclusiveAccessContextImpl> weak_ptr_factory_{this};
};
@@ -101,7 +101,7 @@ with limited CPU/memory resources and it is disabled by default.
--- a/chrome/browser/flag_descriptions.h
+++ b/chrome/browser/flag_descriptions.h
@@ -2908,6 +2908,10 @@ inline constexpr char kLogJsConsoleMessa
@@ -2920,6 +2920,10 @@ inline constexpr char kLogJsConsoleMessa
"Enable logging JS console messages in system logs, please note that they "
"may contain PII.";
+2 -2
View File
@@ -1,6 +1,6 @@
--- a/chrome/app/generated_resources.grd
+++ b/chrome/app/generated_resources.grd
@@ -12031,6 +12031,9 @@ Check your passwords anytime in <ph name
@@ -12045,6 +12045,9 @@ Check your passwords anytime in <ph name
<message name="IDS_TAB_CXMENU_CLOSETABSBELOW" desc="The label of the 'Close Tabs Below' Tab context menu item.">
Close tabs below
</message>
@@ -10,7 +10,7 @@
<message name="IDS_TAB_CXMENU_CLOSEALLTABS" desc="The label of the 'Close All Tabs' Tab context menu item.">
Close all tabs
</message>
@@ -12150,6 +12153,9 @@ Check your passwords anytime in <ph name
@@ -12164,6 +12167,9 @@ Check your passwords anytime in <ph name
<message name="IDS_TAB_CXMENU_CLOSETABSBELOW" desc="In Title Case: The label of the 'Close Tabs Below' Tab context menu item.">
Close Tabs Below
</message>
File diff suppressed because it is too large Load Diff
+1 -1
View File
@@ -1,6 +1,6 @@
--- a/components/search/ntp_features.cc
+++ b/components/search/ntp_features.cc
@@ -197,7 +197,7 @@ BASE_FEATURE(kNtpNextFeatures, base::FEA
@@ -206,7 +206,7 @@ BASE_FEATURE(kNtpNextCanvasChip, base::F
BASE_FEATURE(kNtpOneGoogleBarAsyncBarParts, base::FEATURE_DISABLED_BY_DEFAULT);
// If enabled, a footer will show on the NTP.
@@ -1,6 +1,6 @@
--- a/chrome/browser/about_flags.cc
+++ b/chrome/browser/about_flags.cc
@@ -13066,11 +13066,395 @@ const FeatureEntry kFeatureEntries[] = {
@@ -13113,11 +13113,395 @@ const FeatureEntry kFeatureEntries[] = {
// AboutFlagsHistogramTest unit test to verify this process).
};
@@ -397,7 +397,7 @@
FlagsStateSingleton(const FlagsStateSingleton&) = delete;
FlagsStateSingleton& operator=(const FlagsStateSingleton&) = delete;
~FlagsStateSingleton() override = default;
@@ -13089,7 +13473,7 @@ class FlagsStateSingleton : public flags
@@ -13136,7 +13520,7 @@ class FlagsStateSingleton : public flags
void RestoreDefaultState() {
flags_state_ =
@@ -406,7 +406,7 @@
}
private:
@@ -13416,7 +13800,7 @@ base::span<const FeatureEntry> GetFeatur
@@ -13463,7 +13847,7 @@ base::span<const FeatureEntry> GetFeatur
!entries_for_testing->empty()) {
return *entries_for_testing;
}
+1 -1
View File
@@ -15,7 +15,7 @@
#endif // USE_AURA
#if defined(USE_AURA)
@@ -4651,11 +4651,13 @@ const FeatureEntry::FeatureVariation
@@ -4682,11 +4682,13 @@ const FeatureEntry::FeatureVariation
// calculate and verify checksum.
//
// When adding a new choice, add it to the end of the list.
@@ -1,6 +1,6 @@
--- a/chrome/app/generated_resources.grd
+++ b/chrome/app/generated_resources.grd
@@ -12013,6 +12013,9 @@ Check your passwords anytime in <ph name
@@ -12027,6 +12027,9 @@ Check your passwords anytime in <ph name
<message name="IDS_TAB_CXMENU_DUPLICATE" desc="The label of the 'Duplicate' Tab context menu item.">
Duplicate
</message>
@@ -10,7 +10,7 @@
<message name="IDS_TAB_CXMENU_CLOSETAB" desc="The label of the tab context menu item for closing one or more tabs.">
Close
</message>
@@ -12129,6 +12132,9 @@ Check your passwords anytime in <ph name
@@ -12143,6 +12146,9 @@ Check your passwords anytime in <ph name
<message name="IDS_TAB_CXMENU_DUPLICATE" desc="In Title Case: The label of the 'Duplicate' Tab context menu item.">
Duplicate
</message>
+27 -6
View File
@@ -52,7 +52,15 @@
--- a/chrome/browser/ui/browser_command_controller.cc
+++ b/chrome/browser/ui/browser_command_controller.cc
@@ -324,6 +324,11 @@ BrowserCommandController::BrowserCommand
@@ -85,6 +85,7 @@
#include "chrome/browser/ui/tabs/tab_strip_user_gesture_details.h"
#include "chrome/browser/ui/toolbar/chrome_labs/chrome_labs_utils.h"
#include "chrome/browser/ui/ui_features.h"
+#include "chrome/browser/ui/views/download/bubble/download_toolbar_ui_controller.h"
#include "chrome/browser/ui/views/frame/browser_view.h"
#include "chrome/browser/ui/web_applications/app_browser_controller.h"
#include "chrome/browser/ui/web_applications/web_app_dialog_utils.h"
@@ -324,6 +325,11 @@ BrowserCommandController::BrowserCommand
base::Unretained(this)));
#endif // BUILDFLAG(ENABLE_PRINTING)
profile_pref_registrar_.Add(
@@ -64,7 +72,7 @@
policy::policy_prefs::kDownloadRestrictions,
base::BindRepeating(&BrowserCommandController::UpdateSaveAsState,
base::Unretained(this)));
@@ -456,7 +461,9 @@ bool BrowserCommandController::IsReserve
@@ -456,7 +462,9 @@ bool BrowserCommandController::IsReserve
command_id == IDC_NEW_INCOGNITO_WINDOW || command_id == IDC_NEW_TAB ||
command_id == IDC_NEW_WINDOW || command_id == IDC_RESTORE_TAB ||
command_id == IDC_SELECT_NEXT_TAB ||
@@ -75,7 +83,20 @@
}
void BrowserCommandController::TabStateChanged() {
@@ -1283,6 +1290,14 @@ bool BrowserCommandController::ExecuteCo
@@ -1103,6 +1111,12 @@ bool BrowserCommandController::ExecuteCo
SidePanelEntryId::kHistoryClusters, SidePanelOpenTrigger::kAppMenu);
break;
case IDC_SHOW_DOWNLOADS:
+ if (auto* download_controller =
+ browser_->GetFeatures().download_toolbar_ui_controller();
+ download_controller && download_controller->IsShowing()) {
+ download_controller->InvokeUI();
+ break;
+ }
ShowDownloads(browser_->GetBrowserForOpeningWebUi());
break;
case IDC_SHOW_COMMENTS_SIDE_PANEL:
@@ -1283,6 +1297,14 @@ bool BrowserCommandController::ExecuteCo
case IDC_DUPLICATE_TARGET_TAB:
DuplicateKeyboardFocusedTab(browser_);
break;
@@ -90,7 +111,7 @@
// Hosted App commands
case IDC_COPY_URL:
CopyURL(browser_, browser_->tab_strip_model()->GetActiveWebContents());
@@ -1751,6 +1766,7 @@ void BrowserCommandController::InitComma
@@ -1751,6 +1773,7 @@ void BrowserCommandController::InitComma
is_web_app_or_custom_tab);
command_updater_.UpdateCommandEnabled(IDC_WEB_APP_MENU_APP_INFO,
is_web_app_or_custom_tab);
@@ -98,7 +119,7 @@
// Tab management commands
const bool supports_tabs =
@@ -2056,6 +2072,25 @@ void BrowserCommandController::UpdateCom
@@ -2056,6 +2079,25 @@ void BrowserCommandController::UpdateCom
UpdatePrintingState();
}
@@ -124,7 +145,7 @@
// TODO(crbug.com/442892562): Remove this function once the feature is launched.
void BrowserCommandController::UpdateCommandsForDevTools() {
if (is_locked_fullscreen_) {
@@ -2064,6 +2099,9 @@ void BrowserCommandController::UpdateCom
@@ -2064,6 +2106,9 @@ void BrowserCommandController::UpdateCom
bool dev_tools_enabled = DevToolsWindow::AllowDevToolsFor(
profile(), browser_->tab_strip_model()->GetActiveWebContents());
+153 -41
View File
@@ -44,15 +44,33 @@
// AIPageContent.
--- a/third_party/blink/renderer/modules/webaudio/audio_buffer.cc
+++ b/third_party/blink/renderer/modules/webaudio/audio_buffer.cc
@@ -32,6 +32,7 @@
@@ -30,8 +30,10 @@
#include <memory>
+#include "base/atomic_sequence_num.h"
#include "base/compiler_specific.h"
#include "base/containers/span.h"
+#include "third_party/blink/public/common/features.h"
#include "third_party/blink/renderer/bindings/modules/v8/v8_audio_buffer_options.h"
#include "third_party/blink/renderer/modules/webaudio/base_audio_context.h"
#include "third_party/blink/renderer/platform/audio/audio_bus.h"
@@ -197,6 +198,20 @@ AudioBuffer::AudioBuffer(AudioBus* bus)
@@ -42,6 +44,14 @@
namespace blink {
+namespace {
+
+// Cheap per-render salt. This is not intended to be random; it just keeps
+// separate rendered buffers from sharing the same coordinate-noise stream.
+base::AtomicSequenceNumber g_helium_audio_render_sequence;
+
+} // namespace
+
AudioBuffer* AudioBuffer::Create(unsigned number_of_channels,
uint32_t number_of_frames,
float sample_rate) {
@@ -197,6 +207,29 @@ AudioBuffer::AudioBuffer(AudioBus* bus)
}
}
@@ -61,10 +79,19 @@
+ return;
+ }
+
+ const uint64_t render_seed =
+ static_cast<uint64_t>(g_helium_audio_render_sequence.GetNext());
+ for (unsigned i = 0; i < channels_.size(); ++i) {
+ if (NotShared<DOMFloat32Array> channel = getChannelData(i)) {
+ for (float& sample : channel->AsSpan()) {
+ sample = BaseAudioContext::JitterAudioData(sample, context);
+ base::span<float> samples = channel->AsSpan();
+ for (size_t frame = 0; frame < samples.size(); ++frame) {
+ // Include render, channel, and frame coordinates so repeated equal
+ // sample values do not get identical coordinate jitter. The channel is
+ // shifted into high bits to avoid colliding with normal frame indices.
+ const uint64_t coordinate_seed =
+ render_seed ^ (static_cast<uint64_t>(i) << 48) ^ frame;
+ samples[frame] = BaseAudioContext::JitterAudioData(
+ samples[frame], context, coordinate_seed);
+ }
+ }
+ }
@@ -134,11 +161,31 @@
#include "third_party/blink/renderer/core/frame/local_dom_window.h"
#include "third_party/blink/renderer/core/frame/settings.h"
#include "third_party/blink/renderer/core/html/media/html_media_element.h"
@@ -775,6 +781,35 @@ LocalDOMWindow* BaseAudioContext::GetWin
@@ -90,6 +96,17 @@ namespace blink {
namespace {
+constexpr float kHeliumAudioNoiseScale = 0.0001f / 10000.0f;
+// Arbitrary domain separator. This keeps coordinate jitter on a distinct hash
+// stream from stable content jitter; the value itself does not encode anything.
+constexpr uint64_t kHeliumAudioCoordinateNoiseDomain = 0x080341bb6f41d206ULL;
+
+float GetAudioJitter(HeliumNoiseHash& noise_hash) {
+ const int noise_value = noise_hash.GetValueBelow(10000 + 1);
+ const int noise_sign = noise_hash.GetValueBelow(2) ? 1 : -1;
+ return noise_value * noise_sign * kHeliumAudioNoiseScale;
+}
+
void NotifyDecodingComplete(V8DecodeSuccessCallback* success_callback,
V8DecodeErrorCallback* error_callback,
AudioBus* audio_bus,
@@ -775,6 +792,43 @@ LocalDOMWindow* BaseAudioContext::GetWin
return To<LocalDOMWindow>(GetExecutionContext());
}
+float BaseAudioContext::JitterAudioData(float data, ExecutionContext* context) {
+float BaseAudioContext::JitterAudioData(float data,
+ ExecutionContext* context,
+ uint64_t coordinate_seed) {
+ if (!base::FeatureList::IsEnabled(blink::features::kHeliumNoiseAudio)) {
+ return data;
+ }
@@ -148,21 +195,27 @@
+ return data;
+ }
+
+ HeliumNoiseHash noise_hash(
+ HeliumNoiseHash content_hash(
+ context->GetHeliumNoiseTokens().at(HeliumNoiseFeature::kAudio));
+
+ // Update the hash with audio data for extra entropy. This makes it
+ // harder to identify or remove the noise, similar to how we do
+ // it in canvas.
+ uint64_t data_bits = std::bit_cast<uint64_t>(static_cast<double>(data));
+ noise_hash.Update(data_bits);
+ content_hash.Update(data_bits);
+
+ // Generate jitter within [-0.0001, 0.0001] (aka ±0.01%)
+ // Note: GetValueBelow(2) returns an int value, either 0 or 1.
+ constexpr float scale = 0.0001f / 10000.0f;
+ int noise_value = noise_hash.GetValueBelow(10000 + 1);
+ int noise_sign = noise_hash.GetValueBelow(2) ? 1 : -1;
+ float jitter = noise_value * noise_sign * scale;
+ HeliumNoiseHash coordinate_hash(
+ context->GetHeliumNoiseTokens().at(HeliumNoiseFeature::kAudio));
+ coordinate_hash.Update(kHeliumAudioCoordinateNoiseDomain);
+ coordinate_hash.Update(coordinate_seed);
+ coordinate_hash.Update(data_bits);
+
+ // Keep the overall jitter bounded to roughly +/-0.01%. The content component
+ // keeps equal sample values from reading back raw, while the coordinate
+ // component prevents chosen repeated samples from calibrating the exact
+ // target noise away.
+ const float jitter =
+ (GetAudioJitter(content_hash) + GetAudioJitter(coordinate_hash)) * 0.5f;
+
+ return data * (1.0f + jitter);
+}
@@ -172,11 +225,22 @@
DeferredTaskHandler::GraphAutoLocker locker(this);
--- a/third_party/blink/renderer/modules/webaudio/base_audio_context.h
+++ b/third_party/blink/renderer/modules/webaudio/base_audio_context.h
@@ -331,6 +331,8 @@ class MODULES_EXPORT BaseAudioContext
@@ -26,6 +26,8 @@
#ifndef THIRD_PARTY_BLINK_RENDERER_MODULES_WEBAUDIO_BASE_AUDIO_CONTEXT_H_
#define THIRD_PARTY_BLINK_RENDERER_MODULES_WEBAUDIO_BASE_AUDIO_CONTEXT_H_
+#include <cstdint>
+
#include "base/memory/raw_ptr.h"
#include "base/memory/scoped_refptr.h"
#include "third_party/blink/renderer/bindings/core/v8/active_script_wrappable.h"
@@ -331,6 +333,10 @@ class MODULES_EXPORT BaseAudioContext
// if the execution context does not exist.
bool CheckExecutionContextAndThrowIfNecessary(ExceptionState&);
+ static float JitterAudioData(float data, ExecutionContext* context);
+ static float JitterAudioData(float data,
+ ExecutionContext* context,
+ uint64_t coordinate_seed);
+
protected:
enum class ContextType { kRealtimeContext, kOfflineContext };
@@ -194,8 +258,13 @@
DispatchEvent(*OfflineAudioCompletionEvent::Create(rendered_buffer));
--- a/third_party/blink/renderer/modules/webaudio/realtime_analyser.cc
+++ b/third_party/blink/renderer/modules/webaudio/realtime_analyser.cc
@@ -33,6 +33,8 @@
@@ -30,9 +30,13 @@
#include <algorithm>
#include <bit>
#include <complex>
+#include <cstdint>
+#include "base/atomic_sequence_num.h"
#include "base/compiler_specific.h"
#include "media/base/audio_bus.h"
+#include "third_party/blink/public/common/features.h"
@@ -203,7 +272,42 @@
#include "third_party/blink/renderer/platform/audio/audio_bus.h"
#include "third_party/blink/renderer/platform/audio/audio_utilities.h"
#include "third_party/blink/renderer/platform/audio/vector_math.h"
@@ -99,7 +101,8 @@ bool RealtimeAnalyser::SetFftSize(uint32
@@ -44,6 +48,34 @@ namespace {
constexpr unsigned kDefaultFFTSize = 2048;
constexpr unsigned kInputBufferSize = RealtimeAnalyser::kMaxFFTSize * 2;
+// Domain separators for analyzer coordinate jitter; see
+// kHeliumAudioCoordinateNoiseDomain for the same pattern on rendered buffers.
+constexpr uint64_t kFloatFrequencyNoiseDomain = 0xd8cc6b42025be550ULL;
+constexpr uint64_t kByteFrequencyNoiseDomain = 0x84c6c6f10f44f2d2ULL;
+constexpr uint64_t kFloatTimeDomainNoiseDomain = 0xf912377bc42ec37eULL;
+constexpr uint64_t kByteTimeDomainNoiseDomain = 0x74d81b1c8f65eac1ULL;
+
+// Cheap per-read salt for analyzer readbacks. This is not intended to be
+// random; it just keeps repeated reads from sharing the same coordinate-noise
+// stream for equal values at the same destination index.
+base::AtomicSequenceNumber g_helium_audio_analyzer_read_sequence;
+
+struct AudioAnalyzerNoiseState {
+ explicit AudioAnalyzerNoiseState()
+ : enabled(base::FeatureList::IsEnabled(
+ blink::features::kHeliumNoiseAudio)),
+ read_seed(enabled ? static_cast<uint64_t>(
+ g_helium_audio_analyzer_read_sequence.GetNext())
+ : 0) {}
+
+ uint64_t CoordinateSeed(uint64_t domain, uint64_t index) const {
+ DCHECK(enabled);
+ return domain ^ (read_seed << 32) ^ index;
+ }
+
+ const bool enabled;
+ const uint64_t read_seed;
+};
void ApplyWindow(base::span<float> p) {
DCHECK(IsMainThread());
@@ -99,7 +131,8 @@ bool RealtimeAnalyser::SetFftSize(uint32
}
void RealtimeAnalyser::GetFloatFrequencyData(DOMFloat32Array* destination_array,
@@ -213,12 +317,11 @@
DCHECK(IsMainThread());
DCHECK(destination_array);
@@ -113,17 +116,23 @@ void RealtimeAnalyser::GetFloatFrequency
@@ -113,17 +146,26 @@ void RealtimeAnalyser::GetFloatFrequency
const size_t source_length = magnitude_buffer_.size();
const size_t len = std::min(source_length, destination_array->length());
if (len > 0) {
+ const bool jitter_enabled = base::FeatureList::IsEnabled(
+ blink::features::kHeliumNoiseAudio);
+ const AudioAnalyzerNoiseState noise_state;
+
base::span<float> destination = destination_array->AsSpan();
for (unsigned i = 0; i < len; ++i) {
@@ -226,8 +329,12 @@
const double db_mag = audio_utilities::LinearToDecibels(linear_value);
- destination[i] = static_cast<float>(db_mag);
+ auto db_value = static_cast<float>(db_mag);
+ destination[i] = jitter_enabled ?
+ BaseAudioContext::JitterAudioData(db_value, context) : db_value;
+ destination[i] =
+ noise_state.enabled
+ ? BaseAudioContext::JitterAudioData(
+ db_value, context,
+ noise_state.CoordinateSeed(kFloatFrequencyNoiseDomain, i))
+ : db_value;
}
}
}
@@ -239,17 +346,16 @@
DCHECK(IsMainThread());
DCHECK(destination_array);
@@ -146,6 +155,9 @@ void RealtimeAnalyser::GetByteFrequencyD
@@ -146,6 +188,8 @@ void RealtimeAnalyser::GetByteFrequencyD
: 1.0 / (max_decibels_ - min_decibels_);
const double min_decibels = min_decibels_;
+ const bool jitter_enabled = base::FeatureList::IsEnabled(
+ blink::features::kHeliumNoiseAudio);
+ const AudioAnalyzerNoiseState noise_state;
+
base::span<unsigned char> destination = destination_array->AsSpan();
for (unsigned i = 0; i < len; ++i) {
const float linear_value = magnitude_buffer_[i];
@@ -153,9 +165,13 @@ void RealtimeAnalyser::GetByteFrequencyD
@@ -153,9 +197,15 @@ void RealtimeAnalyser::GetByteFrequencyD
// The range m_minDecibels to m_maxDecibels will be scaled to byte values
// from 0 to UCHAR_MAX.
@@ -257,14 +363,16 @@
+ double scaled_value =
UCHAR_MAX * (db_mag - min_decibels) * range_scale_factor;
+ if (jitter_enabled) {
+ scaled_value = BaseAudioContext::JitterAudioData(scaled_value, context);
+ if (noise_state.enabled) {
+ scaled_value = BaseAudioContext::JitterAudioData(
+ scaled_value, context,
+ noise_state.CoordinateSeed(kByteFrequencyNoiseDomain, i));
+ }
+
// Clip to valid range.
destination[i] =
static_cast<unsigned char>(ClampTo(scaled_value, 0, UCHAR_MAX));
@@ -164,7 +180,8 @@ void RealtimeAnalyser::GetByteFrequencyD
@@ -164,7 +214,8 @@ void RealtimeAnalyser::GetByteFrequencyD
}
void RealtimeAnalyser::GetFloatTimeDomainData(
@@ -274,23 +382,26 @@
DCHECK(IsMainThread());
DCHECK(destination_array);
@@ -177,6 +194,9 @@ void RealtimeAnalyser::GetFloatTimeDomai
@@ -177,6 +228,8 @@ void RealtimeAnalyser::GetFloatTimeDomai
const unsigned write_index = GetWriteIndex();
+ const bool jitter_enabled = base::FeatureList::IsEnabled(
+ blink::features::kHeliumNoiseAudio);
+ const AudioAnalyzerNoiseState noise_state;
+
base::span<float> destination = destination_array->AsSpan();
for (unsigned i = 0; i < len; ++i) {
// Buffer access is protected due to modulo operation.
@@ -184,12 +204,14 @@ void RealtimeAnalyser::GetFloatTimeDomai
@@ -184,12 +237,18 @@ void RealtimeAnalyser::GetFloatTimeDomai
input_buffer_[(i + write_index - fft_size + kInputBufferSize) %
kInputBufferSize];
- destination[i] = value;
+ destination[i] = jitter_enabled ?
+ BaseAudioContext::JitterAudioData(value, context) : value;
+ destination[i] =
+ noise_state.enabled
+ ? BaseAudioContext::JitterAudioData(
+ value, context,
+ noise_state.CoordinateSeed(kFloatTimeDomainNoiseDomain, i))
+ : value;
}
}
}
@@ -301,12 +412,11 @@
DCHECK(IsMainThread());
DCHECK(destination_array);
@@ -202,13 +224,20 @@ void RealtimeAnalyser::GetByteTimeDomain
@@ -202,13 +261,21 @@ void RealtimeAnalyser::GetByteTimeDomain
const unsigned write_index = GetWriteIndex();
+ const bool jitter_enabled = base::FeatureList::IsEnabled(
+ blink::features::kHeliumNoiseAudio);
+ const AudioAnalyzerNoiseState noise_state;
+
base::span<unsigned char> destination = destination_array->AsSpan();
for (unsigned i = 0; i < len; ++i) {
@@ -316,8 +426,10 @@
input_buffer_[(i + write_index - fft_size + kInputBufferSize) %
kInputBufferSize];
+ if (jitter_enabled) {
+ value = BaseAudioContext::JitterAudioData(value, context);
+ if (noise_state.enabled) {
+ value = BaseAudioContext::JitterAudioData(
+ value, context,
+ noise_state.CoordinateSeed(kByteTimeDomainNoiseDomain, i));
+ }
+
// Scale from nominal -1 -> +1 to unsigned byte.
+516 -110
View File
@@ -80,7 +80,7 @@
// AIPageContent.
--- /dev/null
+++ b/third_party/blink/renderer/core/helium_noise/canvas_noising_helper.cc
@@ -0,0 +1,258 @@
@@ -0,0 +1,635 @@
+// Copyright 2026 The Helium Authors
+// You can use, redistribute, and/or modify this source code under
+// the terms of the GPL-3.0 license that can be found in the LICENSE file.
@@ -93,72 +93,54 @@
+
+#include <algorithm>
+#include <array>
+#include <cmath>
+#include <cstddef>
+#include <cstdint>
+#include <limits>
+#include <optional>
+#include <vector>
+
+#include "base/check_op.h"
+#include "base/containers/span.h"
+#include "base/containers/span_writer.h"
+#include "base/memory/scoped_refptr.h"
+#include "base/numerics/byte_conversions.h"
+#include "base/numerics/safe_conversions.h"
+#include "third_party/blink/public/common/features.h"
+#include "third_party/blink/renderer/core/execution_context/execution_context.h"
+#include "third_party/blink/renderer/core/helium_noise/helium_noise_hash.h"
+#include "third_party/blink/renderer/core/html/canvas/image_data.h"
+#include "third_party/blink/renderer/platform/graphics/static_bitmap_image.h"
+#include "third_party/blink/renderer/platform/graphics/unaccelerated_static_bitmap_image.h"
+#include "third_party/skia/include/core/SkBitmap.h"
+#include "third_party/skia/include/core/SkImageInfo.h"
+#include "third_party/skia/src/base/SkHalf.h"
+#include "third_party/skia/src/base/SkVx.h"
+#include "ui/gfx/skia_span_util.h"
+
+namespace blink {
+
+namespace {
+
+constexpr uint8_t kNearbyPixelMaxOffset = 2u;
+// Tuning parameters.
+constexpr int kMaxSharedRgbNoise = 1;
+constexpr int kMaxIndependentRgbNoise = 1;
+constexpr int kMaxAlphaNoise = 1;
+// Treat a 3x3 neighborhood as smooth when every RGB channel stays within this
+// range. Smooth regions show structured noise much more readily than edges.
+constexpr uint8_t kSmoothNeighborhoodRgbRange = 2u;
+// Smooth RGB noise is sparse: 4 means roughly one in four smooth pixels is
+// changed. Lower values are stronger; higher values are less visible.
+constexpr int kSmoothRgbNoiseFrequency = 4;
+
+// Pixel layout and derived constants.
+constexpr uint8_t kChannelsPerPixel = 4u;
+constexpr size_t kRgbChannelsPerPixel = 3u;
+using RgbBytes = std::array<uint8_t, kRgbChannelsPerPixel>;
+using RgbNoise = std::array<int, kRgbChannelsPerPixel>;
+constexpr std::array<uint8_t, 4u> kEmptyPixel({0, 0, 0, 0});
+
+struct PixelLocation {
+ int x;
+ int y;
+};
+
+void ClampPixelLocation(PixelLocation* location,
+ const int width,
+ const int height) {
+ CHECK(width >= 1 && height >= 1);
+ location->x = std::min(std::max(0, location->x), width - 1);
+ location->y = std::min(std::max(0, location->y), height - 1);
+}
+
+// Returns two random pixel locations; one close to the offset and one
+// randomly selected from the entire canvas.
+std::pair<PixelLocation, PixelLocation> GetRandomPixelLocations(
+ HeliumNoiseHash& token_hash,
+ const PixelLocation offset,
+ const int width,
+ const int height) {
+ std::pair<PixelLocation, PixelLocation> pixel_locations;
+ // Uses at most 2 * bit_width(kNearbyPixelMaxOffset * 2) bits from hash.
+ pixel_locations.first = {
+ offset.x + token_hash.GetValueBelow(kNearbyPixelMaxOffset * 2) -
+ kNearbyPixelMaxOffset + 1,
+ offset.y + token_hash.GetValueBelow(kNearbyPixelMaxOffset * 2) -
+ kNearbyPixelMaxOffset + 1};
+ // x and y might be negative or go beyond the width or height here, so we need
+ // to clamp them.
+ ClampPixelLocation(&pixel_locations.first, width, height);
+ // Uses at most bit_width(width) + bit_width(height) bits from hash.
+ pixel_locations.second = {token_hash.GetValueBelow(width),
+ token_hash.GetValueBelow(height)};
+ // Uses at most 32 bits from hash.
+ return pixel_locations;
+}
+constexpr RgbBytes kMinRgbInitialValue = {255u, 255u, 255u};
+constexpr RgbBytes kMaxRgbInitialValue = {0u, 0u, 0u};
+constexpr float kFloatChannelScale = 1.0f / 255.0f;
+
+int GetSignedNoiseValue(HeliumNoiseHash& token_hash, int max_abs_noise) {
+ if (max_abs_noise <= 0) {
@@ -167,18 +149,77 @@
+ return token_hash.GetValueBelow(max_abs_noise * 2 + 1) - max_abs_noise;
+}
+
+void HeliumNoisePixel(base::span<uint8_t> pixel, HeliumNoiseHash& token_hash) {
+ base::SpanWriter writer(base::as_writable_bytes(pixel));
+ const int shared_rgb_noise =
+ GetSignedNoiseValue(token_hash, kMaxSharedRgbNoise);
+ for (int i = 0; i < kChannelsPerPixel; ++i) {
+int GetNonZeroSignedNoiseValue(HeliumNoiseHash& token_hash) {
+ return token_hash.GetValueBelow(2) == 0 ? -1 : 1;
+}
+
+RgbNoise GetSmoothRgbNoiseVector(HeliumNoiseHash& content_hash,
+ HeliumNoiseHash& coordinate_hash) {
+ // Dense per-channel noise is visible on flat fills and slow gradients. For
+ // those pixels, only change one RGB channel on a sparse coordinate-selected
+ // subset.
+ if (coordinate_hash.GetValueBelow(kSmoothRgbNoiseFrequency) != 0) {
+ return {0, 0, 0};
+ }
+
+ RgbNoise noise = {0, 0, 0};
+ noise[content_hash.GetValueBelow(3)] =
+ GetNonZeroSignedNoiseValue(content_hash);
+ return noise;
+}
+
+RgbNoise GetFullRgbNoiseVector(HeliumNoiseHash& content_hash,
+ HeliumNoiseHash& coordinate_hash) {
+ RgbNoise noise = {0, 0, 0};
+ for (int& channel_noise : noise) {
+ channel_noise =
+ GetNonZeroSignedNoiseValue(content_hash) +
+ GetSignedNoiseValue(coordinate_hash, kMaxIndependentRgbNoise);
+ }
+ return noise;
+}
+
+RgbNoise GetRgbNoiseVector(HeliumNoiseHash& content_hash,
+ HeliumNoiseHash& coordinate_hash,
+ bool smooth_neighborhood) {
+ return smooth_neighborhood
+ ? GetSmoothRgbNoiseVector(content_hash, coordinate_hash)
+ : GetFullRgbNoiseVector(content_hash, coordinate_hash);
+}
+
+uint64_t MixCanvasCoordinateSeed(uint64_t value) {
+ // SplitMix64 finalizer. This is not cryptographic; it just avalanches nearby
+ // coordinates so low-amplitude noise does not form visible axis-aligned
+ // bands.
+ value ^= value >> 30;
+ value *= 0xbf58476d1ce4e5b9ULL;
+ value ^= value >> 27;
+ value *= 0x94d049bb133111ebULL;
+ value ^= value >> 31;
+ return value;
+}
+
+size_t CheckedPixelStorageSize(const int width,
+ const int height,
+ const size_t bytes_per_channel) {
+ base::CheckedNumeric<size_t> size = base::checked_cast<size_t>(width);
+ size *= base::checked_cast<size_t>(height);
+ size *= kChannelsPerPixel;
+ size *= bytes_per_channel;
+ return size.ValueOrDie();
+}
+
+void HeliumNoisePixel(base::span<uint8_t, kChannelsPerPixel> pixel,
+ HeliumNoiseHash& coordinate_hash,
+ const RgbNoise& rgb_noise) {
+ for (size_t i = 0; i < kChannelsPerPixel; ++i) {
+ int channel_value = pixel[i];
+
+ const bool is_alpha = i == kChannelsPerPixel - 1;
+
+ // Keep alpha limits stable.
+ if (is_alpha && (channel_value == 0 || channel_value == 255)) {
+ writer.WriteU8LittleEndian(base::checked_cast<uint8_t>(channel_value));
+ pixel[i] = base::checked_cast<uint8_t>(channel_value);
+ continue;
+ }
+
@@ -194,54 +235,199 @@
+
+ int noise = 0;
+ if (is_alpha) {
+ noise = GetSignedNoiseValue(token_hash, kMaxAlphaNoise);
+ noise = GetSignedNoiseValue(coordinate_hash, kMaxAlphaNoise);
+ } else {
+ noise = shared_rgb_noise +
+ GetSignedNoiseValue(token_hash, kMaxIndependentRgbNoise);
+ noise = rgb_noise[i];
+ }
+
+ const int noised_value =
+ std::clamp(channel_value + noise, minNoisedVal, maxNoisedVal);
+ writer.WriteU8LittleEndian(base::checked_cast<uint8_t>(noised_value));
+ pixel[i] = base::checked_cast<uint8_t>(noised_value);
+ }
+}
+
+base::span<uint8_t, 4u> GetPixelAt(const int x,
+ const int y,
+ const int width,
+ const base::span<uint8_t> pixels) {
+uint8_t QuantizeFloatChannel(float channel_value) {
+ if (!std::isfinite(channel_value)) {
+ return 0;
+ }
+
+ return base::checked_cast<uint8_t>(
+ std::clamp(std::lround(channel_value * 255.0f), 0L, 255L));
+}
+
+std::array<uint8_t, 4u> QuantizeFloatPixel(
+ base::span<const float, kChannelsPerPixel> pixel) {
+ return {QuantizeFloatChannel(pixel[0]), QuantizeFloatChannel(pixel[1]),
+ QuantizeFloatChannel(pixel[2]), QuantizeFloatChannel(pixel[3])};
+}
+
+uint32_t QuantizedFloatPixelValue(
+ base::span<const float, kChannelsPerPixel> pixel) {
+ std::array<uint8_t, kChannelsPerPixel> quantized_pixel =
+ QuantizeFloatPixel(pixel);
+ return base::U32FromLittleEndian(base::span(quantized_pixel));
+}
+
+void HeliumNoiseFloatPixel(base::span<float, kChannelsPerPixel> pixel,
+ HeliumNoiseHash& coordinate_hash,
+ const RgbNoise& rgb_noise) {
+ for (size_t i = 0; i < kChannelsPerPixel; ++i) {
+ float channel_value = pixel[i];
+ if (!std::isfinite(channel_value)) {
+ continue;
+ }
+
+ const bool is_alpha = i == kChannelsPerPixel - 1;
+
+ // Keep alpha limits stable.
+ if (is_alpha && (channel_value <= 0.0f || channel_value >= 1.0f)) {
+ pixel[i] = std::clamp(channel_value, 0.0f, 1.0f);
+ continue;
+ }
+
+ int noise = 0;
+ if (is_alpha) {
+ noise = GetSignedNoiseValue(coordinate_hash, kMaxAlphaNoise);
+ } else {
+ noise = rgb_noise[i];
+ }
+
+ const float lower_limit =
+ is_alpha && channel_value > 0.0f ? kFloatChannelScale : 0.0f;
+ const float upper_limit =
+ is_alpha ? 1.0f : std::numeric_limits<float>::max();
+ pixel[i] = std::clamp(channel_value + noise * kFloatChannelScale,
+ lower_limit, upper_limit);
+ }
+}
+
+template <typename T>
+base::span<T, kChannelsPerPixel> GetPixelAt(const int x,
+ const int y,
+ const int width,
+ const base::span<T> pixels) {
+ return pixels
+ .subspan(static_cast<size_t>((x + y * width) * kChannelsPerPixel))
+ .first<4u>();
+ .template first<kChannelsPerPixel>();
+}
+
+base::span<const uint8_t, 4u> GetPixelAt(
+ const int x,
+ const int y,
+ const int width,
+ const base::span<const uint8_t> pixels) {
+ return pixels
+ .subspan(static_cast<size_t>((x + y * width) * kChannelsPerPixel))
+ .first<4u>();
+std::array<float, kChannelsPerPixel>
+LoadHalfFloatPixel(base::span<const SkHalf> pixels, int x, int y, int width) {
+ auto pixel =
+ pixels.subspan(static_cast<size_t>((x + y * width) * kChannelsPerPixel))
+ .first<kChannelsPerPixel>();
+ skvx::half4 half_pixel = {pixel[0], pixel[1], pixel[2], pixel[3]};
+ skvx::float4 float_pixel = skvx::from_half(half_pixel);
+ return {float_pixel[0], float_pixel[1], float_pixel[2], float_pixel[3]};
+}
+
+uint64_t GetValueFromPixelLocations(
+ const std::pair<PixelLocation, PixelLocation> locations,
+ const base::span<const uint8_t> pixels,
+ int width) {
+ uint64_t result = 0u;
+ result |= base::U32FromLittleEndian(
+ GetPixelAt(locations.first.x, locations.first.y, width, pixels));
+ result <<= 32u;
+ result |= base::U32FromLittleEndian(
+ GetPixelAt(locations.second.x, locations.second.y, width, pixels));
+ return result;
+void StoreHalfFloatPixel(base::span<SkHalf> pixels,
+ int x,
+ int y,
+ int width,
+ const std::array<float, kChannelsPerPixel>& pixel) {
+ auto destination =
+ pixels.subspan(static_cast<size_t>((x + y * width) * kChannelsPerPixel))
+ .first<kChannelsPerPixel>();
+ skvx::float4 float_pixel = {std::isnan(pixel[0]) ? 0.0f : pixel[0],
+ std::isnan(pixel[1]) ? 0.0f : pixel[1],
+ std::isnan(pixel[2]) ? 0.0f : pixel[2],
+ std::isnan(pixel[3]) ? 0.0f : pixel[3]};
+ skvx::half4 half_pixel = skvx::to_half(float_pixel);
+ for (size_t i = 0; i < kChannelsPerPixel; ++i) {
+ destination[i] = std::isnan(pixel[i]) ? SK_HalfNaN : half_pixel[i];
+ }
+}
+
+void CopyPixelValue(const base::span<const uint8_t> from_pixel,
+ base::span<uint8_t> to_pixel) {
+ base::SpanWriter writer(base::as_writable_bytes(to_pixel));
+ writer.Write(from_pixel.first<kChannelsPerPixel>());
+template <typename LoadPixel>
+bool UpdateHashAndCheckSmoothPixelNeighborhood(HeliumNoiseHash& hash,
+ int x,
+ int y,
+ int width,
+ int height,
+ LoadPixel load_pixel) {
+ // Use one 3x3 pass both to feed local content into the stable hash and to
+ // decide whether this pixel sits in a visually smooth area. The smoothness
+ // decision must use the source pixels, not already-noised output.
+ RgbBytes min_rgb = kMinRgbInitialValue;
+ RgbBytes max_rgb = kMaxRgbInitialValue;
+ for (int dy = -1; dy <= 1; ++dy) {
+ const int sample_y = std::clamp(y + dy, 0, height - 1);
+ for (int dx = -1; dx <= 1; ++dx) {
+ const int sample_x = std::clamp(x + dx, 0, width - 1);
+ const auto sample_pixel = load_pixel(sample_x, sample_y);
+ hash.Update(sample_pixel.hash_value);
+ for (size_t channel = 0; channel < sample_pixel.rgb.size(); ++channel) {
+ min_rgb[channel] =
+ std::min(min_rgb[channel], sample_pixel.rgb[channel]);
+ max_rgb[channel] =
+ std::max(max_rgb[channel], sample_pixel.rgb[channel]);
+ }
+ }
+ }
+ for (size_t channel = 0; channel < min_rgb.size(); ++channel) {
+ if (max_rgb[channel] - min_rgb[channel] > kSmoothNeighborhoodRgbRange) {
+ return false;
+ }
+ }
+ return true;
+}
+
+struct NeighborhoodPixel {
+ uint32_t hash_value;
+ RgbBytes rgb;
+};
+
+// The stable content component keeps repeated copies from averaging back to raw
+// pixels. A separate coordinate component keeps a copied calibration sample
+// from subtracting that stable component perfectly.
+bool UpdateHashAndCheckSmoothBytePixelNeighborhood(
+ HeliumNoiseHash& hash,
+ int x,
+ int y,
+ int width,
+ int height,
+ base::span<const uint8_t> pixels) {
+ return UpdateHashAndCheckSmoothPixelNeighborhood(
+ hash, x, y, width, height, [width, pixels](int sample_x, int sample_y) {
+ auto sample_pixel = GetPixelAt(sample_x, sample_y, width, pixels);
+ return NeighborhoodPixel{
+ base::U32FromLittleEndian(sample_pixel),
+ {sample_pixel[0], sample_pixel[1], sample_pixel[2]}};
+ });
+}
+
+bool UpdateHashAndCheckSmoothQuantizedPixelNeighborhood(
+ HeliumNoiseHash& hash,
+ int x,
+ int y,
+ int width,
+ int height,
+ base::span<const uint32_t> quantized_pixels) {
+ return UpdateHashAndCheckSmoothPixelNeighborhood(
+ hash, x, y, width, height,
+ [width, quantized_pixels](int sample_x, int sample_y) {
+ const uint32_t sample_pixel =
+ quantized_pixels[sample_x + sample_y * width];
+ return NeighborhoodPixel{
+ sample_pixel,
+ {static_cast<uint8_t>(sample_pixel & 0xffu),
+ static_cast<uint8_t>((sample_pixel >> 8) & 0xffu),
+ static_cast<uint8_t>((sample_pixel >> 16) & 0xffu)}};
+ });
+}
+
+void UpdateHashWithPixelCoordinates(HeliumNoiseHash& hash,
+ int x,
+ int y,
+ int x_offset,
+ int y_offset) {
+ const uint64_t packed_coordinate =
+ (static_cast<uint64_t>(static_cast<uint32_t>(y + y_offset)) << 32) |
+ static_cast<uint32_t>(x + x_offset);
+ // Adjacent packed coordinates can otherwise produce visible axis-aligned
+ // patterns on flat fills, so avalanche them before updating the hash.
+ hash.Update(MixCanvasCoordinateSeed(packed_coordinate));
+}
+
+// Adds noise to the provided pixels in place, using |token_hash| as the
@@ -250,9 +436,11 @@
+void HeliumNoisePixels(const HeliumNoiseHash& token_hash,
+ base::span<uint8_t> pixels,
+ const int width,
+ const int height) {
+ const int height,
+ const int x_offset,
+ const int y_offset) {
+ CHECK_EQ(pixels.size(),
+ static_cast<size_t>(width * height * kChannelsPerPixel));
+ CheckedPixelStorageSize(width, height, sizeof(uint8_t)));
+
+ std::vector<uint8_t> source_pixel_storage(pixels.begin(), pixels.end());
+ base::span<const uint8_t> source_pixels(source_pixel_storage);
@@ -264,22 +452,181 @@
+ continue;
+ }
+ auto pixel = GetPixelAt(x, y, width, pixels);
+ CopyPixelValue(source_pixel, pixel);
+ pixel.copy_from(source_pixel);
+
+ HeliumNoiseHash hash_copy = token_hash;
+ hash_copy.Update((static_cast<uint64_t>(y) << 32) |
+ static_cast<uint32_t>(x));
+ hash_copy.Update(base::U32FromLittleEndian(source_pixel));
+ // GetRandomPixelLocations consumes at most 32 bits from hash.
+ const std::pair<PixelLocation, PixelLocation> other_pixels =
+ GetRandomPixelLocations(hash_copy, {x, y}, width, height);
+ hash_copy.Update(
+ GetValueFromPixelLocations(other_pixels, source_pixels, width));
+ HeliumNoisePixel(pixel, hash_copy);
+ HeliumNoiseHash content_hash = token_hash;
+ content_hash.Update(base::U32FromLittleEndian(source_pixel));
+ const bool smooth_neighborhood =
+ UpdateHashAndCheckSmoothBytePixelNeighborhood(
+ content_hash, x, y, width, height, source_pixels);
+ HeliumNoiseHash coordinate_hash = token_hash;
+ UpdateHashWithPixelCoordinates(coordinate_hash, x, y, x_offset, y_offset);
+ coordinate_hash.Update(base::U32FromLittleEndian(source_pixel));
+ RgbNoise rgb_noise =
+ GetRgbNoiseVector(content_hash, coordinate_hash, smooth_neighborhood);
+ HeliumNoisePixel(pixel, coordinate_hash, rgb_noise);
+ }
+ }
+}
+
+void HeliumNoiseFloatPixels(const HeliumNoiseHash& token_hash,
+ base::span<float> pixels,
+ const int width,
+ const int height,
+ const int x_offset,
+ const int y_offset) {
+ CHECK_EQ(
+ pixels.size(),
+ CheckedPixelStorageSize(width, height, sizeof(float)) / sizeof(float));
+
+ std::vector<float> source_pixel_storage(pixels.begin(), pixels.end());
+ base::span<const float> source_pixels(source_pixel_storage);
+ std::vector<uint32_t> quantized_source_pixels;
+ quantized_source_pixels.reserve(base::checked_cast<size_t>(width) *
+ base::checked_cast<size_t>(height));
+ for (int y = 0; y < height; ++y) {
+ for (int x = 0; x < width; ++x) {
+ quantized_source_pixels.push_back(
+ QuantizedFloatPixelValue(GetPixelAt(x, y, width, source_pixels)));
+ }
+ }
+
+ for (int y = 0; y < height; ++y) {
+ for (int x = 0; x < width; ++x) {
+ auto source_pixel = GetPixelAt(x, y, width, source_pixels);
+ uint32_t quantized_source_pixel = quantized_source_pixels[x + y * width];
+ if (quantized_source_pixel == 0u) {
+ continue;
+ }
+ auto pixel = GetPixelAt(x, y, width, pixels);
+ pixel.copy_from(source_pixel);
+
+ HeliumNoiseHash content_hash = token_hash;
+ content_hash.Update(quantized_source_pixel);
+ const bool smooth_neighborhood =
+ UpdateHashAndCheckSmoothQuantizedPixelNeighborhood(
+ content_hash, x, y, width, height, quantized_source_pixels);
+ HeliumNoiseHash coordinate_hash = token_hash;
+ UpdateHashWithPixelCoordinates(coordinate_hash, x, y, x_offset, y_offset);
+ coordinate_hash.Update(quantized_source_pixel);
+ RgbNoise rgb_noise =
+ GetRgbNoiseVector(content_hash, coordinate_hash, smooth_neighborhood);
+ HeliumNoiseFloatPixel(pixel, coordinate_hash, rgb_noise);
+ }
+ }
+}
+
+void HeliumNoiseHalfFloatPixels(const HeliumNoiseHash& token_hash,
+ base::span<SkHalf> pixels,
+ const int width,
+ const int height,
+ const int x_offset,
+ const int y_offset) {
+ CHECK_EQ(
+ pixels.size(),
+ CheckedPixelStorageSize(width, height, sizeof(SkHalf)) / sizeof(SkHalf));
+
+ std::vector<SkHalf> source_pixel_storage(pixels.begin(), pixels.end());
+ std::vector<uint32_t> quantized_source_pixels;
+ quantized_source_pixels.reserve(base::checked_cast<size_t>(width) *
+ base::checked_cast<size_t>(height));
+ for (int y = 0; y < height; ++y) {
+ for (int x = 0; x < width; ++x) {
+ std::array<float, kChannelsPerPixel> source_pixel =
+ LoadHalfFloatPixel(source_pixel_storage, x, y, width);
+ quantized_source_pixels.push_back(
+ QuantizedFloatPixelValue(base::span(source_pixel)));
+ }
+ }
+ for (int y = 0; y < height; ++y) {
+ for (int x = 0; x < width; ++x) {
+ uint32_t quantized_source_pixel = quantized_source_pixels[x + y * width];
+ if (quantized_source_pixel == 0u) {
+ continue;
+ }
+ std::array<float, kChannelsPerPixel> source_pixel =
+ LoadHalfFloatPixel(source_pixel_storage, x, y, width);
+ std::array<float, kChannelsPerPixel> pixel = source_pixel;
+
+ HeliumNoiseHash content_hash = token_hash;
+ content_hash.Update(quantized_source_pixel);
+ const bool smooth_neighborhood =
+ UpdateHashAndCheckSmoothQuantizedPixelNeighborhood(
+ content_hash, x, y, width, height, quantized_source_pixels);
+ HeliumNoiseHash coordinate_hash = token_hash;
+ UpdateHashWithPixelCoordinates(coordinate_hash, x, y, x_offset, y_offset);
+ coordinate_hash.Update(quantized_source_pixel);
+ RgbNoise rgb_noise =
+ GetRgbNoiseVector(content_hash, coordinate_hash, smooth_neighborhood);
+ HeliumNoiseFloatPixel(base::span(pixel), coordinate_hash, rgb_noise);
+
+ StoreHalfFloatPixel(pixels, x, y, width, pixel);
+ }
+ }
+}
+
+std::optional<HeliumNoiseHash> GetCanvasTokenHash(
+ ExecutionContext* execution_context) {
+ if (!base::FeatureList::IsEnabled(blink::features::kHeliumNoiseCanvas)) {
+ return std::nullopt;
+ }
+
+ if (!execution_context || !execution_context->GetHeliumNoiseTokens().contains(
+ HeliumNoiseFeature::kCanvas)) {
+ return std::nullopt;
+ }
+
+ return HeliumNoiseHash(execution_context->GetHeliumNoiseTokens().at(
+ HeliumNoiseFeature::kCanvas));
+}
+
+bool IsSupportedNoisingColorType(SkColorType color_type) {
+ switch (color_type) {
+ case kRGBA_8888_SkColorType:
+ case kBGRA_8888_SkColorType:
+ case kRGBA_F16_SkColorType:
+ case kRGBA_F32_SkColorType:
+ return true;
+ default:
+ return false;
+ }
+}
+
+bool HeliumNoisePixelBuffer(const HeliumNoiseHash& token_hash,
+ SkColorType color_type,
+ base::span<uint8_t> pixels,
+ int width,
+ int height,
+ int x_offset,
+ int y_offset) {
+ switch (color_type) {
+ case kRGBA_8888_SkColorType:
+ case kBGRA_8888_SkColorType:
+ HeliumNoisePixels(token_hash, pixels, width, height, x_offset, y_offset);
+ return true;
+ case kRGBA_F16_SkColorType: {
+ CHECK_EQ(pixels.size(),
+ CheckedPixelStorageSize(width, height, sizeof(SkHalf)));
+ auto half_pixels = base::span(reinterpret_cast<SkHalf*>(pixels.data()),
+ pixels.size() / sizeof(SkHalf));
+
+ HeliumNoiseHalfFloatPixels(token_hash, half_pixels, width, height,
+ x_offset, y_offset);
+ return true;
+ }
+ case kRGBA_F32_SkColorType: {
+ auto float_pixels = base::span(reinterpret_cast<float*>(pixels.data()),
+ pixels.size() / sizeof(float));
+ HeliumNoiseFloatPixels(token_hash, float_pixels, width, height, x_offset,
+ y_offset);
+ return true;
+ }
+ default:
+ NOTREACHED() << "Unsupported canvas color type for noising: "
+ << static_cast<int>(color_type);
+ }
+}
+
+} // namespace
+
+// static
@@ -288,23 +635,24 @@
+ scoped_refptr<StaticBitmapImage>& snapshot) {
+ CHECK(snapshot);
+
+ if (!base::FeatureList::IsEnabled(
+ blink::features::kHeliumNoiseCanvas)) {
+ std::optional<HeliumNoiseHash> token_hash =
+ GetCanvasTokenHash(execution_context);
+ if (!token_hash) {
+ return false;
+ }
+
+ // Check if execution context exists and has a canvas noise token
+ if (!execution_context ||
+ !execution_context->GetHeliumNoiseTokens().contains(
+ HeliumNoiseFeature::kCanvas)) {
+ return false;
+ // Read back unpremultiplied pixels because noising mutates raw channel
+ // values, including alpha for non-transparent/non-opaque pixels. If the
+ // snapshot format does not map to a noising-supported color type, read it
+ // back as RGBA_8888 and noise that representation. RGBA_8888 is the default
+ // ImageData format (see |color_type| in t/b/r/c/html/canvas/image_data.cc).
+ SkColorType color_type =
+ viz::ToClosestSkColorType(snapshot->GetSharedImageFormat());
+ if (!IsSupportedNoisingColorType(color_type)) {
+ color_type = kRGBA_8888_SkColorType;
+ }
+
+ // Use kUnpremul_SkAlphaType as alpha type as we are changing the pixel values
+ // of all channels, including the alpha channel.
+ auto info = SkImageInfo::Make(
+ snapshot->GetSize().width(), snapshot->GetSize().height(),
+ viz::ToClosestSkColorType(snapshot->GetSharedImageFormat()),
+ snapshot->GetSize().width(), snapshot->GetSize().height(), color_type,
+ kUnpremul_SkAlphaType, snapshot->GetColorSpace().ToSkColorSpace());
+ SkBitmap bm;
+ if (!bm.tryAllocPixels(info)) {
@@ -324,12 +672,11 @@
+ base::span<uint8_t> modify_pixels =
+ gfx::SkPixmapToWritableSpan(pixmap_to_noise);
+
+ auto token_hash =
+ HeliumNoiseHash(execution_context->GetHeliumNoiseTokens().at(
+ HeliumNoiseFeature::kCanvas));
+
+ HeliumNoisePixels(token_hash, modify_pixels, pixmap_to_noise.width(),
+ pixmap_to_noise.height());
+ if (!HeliumNoisePixelBuffer(*token_hash, pixmap_to_noise.colorType(),
+ modify_pixels, pixmap_to_noise.width(),
+ pixmap_to_noise.height(), 0, 0)) {
+ return false;
+ }
+
+ auto noised_image = bm.asImage();
+ snapshot = blink::UnacceleratedStaticBitmapImage::Create(
@@ -338,10 +685,40 @@
+ return true;
+}
+
+// static
+bool CanvasNoisingHelper::MaybeNoiseImageData(
+ ExecutionContext* execution_context,
+ ImageData* image_data,
+ int source_x,
+ int source_y) {
+ CHECK(image_data);
+
+ std::optional<HeliumNoiseHash> token_hash =
+ GetCanvasTokenHash(execution_context);
+ if (!token_hash) {
+ return false;
+ }
+
+ base::span<uint8_t> pixels = image_data->RawByteSpan();
+ SkColorType color_type = image_data->GetSkColorType();
+ if (!IsSupportedNoisingColorType(color_type)) {
+ // ImageData creation currently only exposes RGBA_8888, RGBA_F16, and
+ // RGBA_F32. If a future ImageData format reaches this path before noising
+ // support is added, avoid both renderer crashes and unnoised readback.
+ DCHECK(false) << "Trying to noise unsupported color type: " << color_type;
+ std::ranges::fill(pixels, 0u);
+ return true;
+ }
+
+ return HeliumNoisePixelBuffer(*token_hash, color_type, pixels,
+ image_data->width(), image_data->height(),
+ source_x, source_y);
+}
+
+} // namespace blink
--- /dev/null
+++ b/third_party/blink/renderer/core/helium_noise/canvas_noising_helper.h
@@ -0,0 +1,31 @@
@@ -0,0 +1,40 @@
+// Copyright 2026 The Helium Authors
+// You can use, redistribute, and/or modify this source code under
+// the terms of the GPL-3.0 license that can be found in the LICENSE file.
@@ -359,6 +736,8 @@
+
+namespace blink {
+
+class ImageData;
+
+class CORE_EXPORT CanvasNoisingHelper {
+ public:
+ // If allowed, performs noising on a copy of the snapshot StaticBitmapImage
@@ -366,6 +745,13 @@
+ static bool MaybeNoiseSnapshot(ExecutionContext* execution_context,
+ scoped_refptr<StaticBitmapImage>& snapshot);
+
+ // If allowed, performs noising in place on RGBA ImageData readbacks.
+ // Returns true if noise was applied.
+ static bool MaybeNoiseImageData(ExecutionContext* execution_context,
+ ImageData* image_data,
+ int source_x,
+ int source_y);
+
+ private:
+ CanvasNoisingHelper() = delete;
+};
@@ -437,3 +823,23 @@
auto* async_creator = MakeGarbageCollected<CanvasAsyncBlobCreator>(
image_bitmap, options, function_type, start_time, execution_context,
resolver);
--- a/third_party/blink/renderer/modules/canvas/canvas2d/base_rendering_context_2d.cc
+++ b/third_party/blink/renderer/modules/canvas/canvas2d/base_rendering_context_2d.cc
@@ -48,6 +48,7 @@
#include "third_party/blink/renderer/core/event_type_names.h"
#include "third_party/blink/renderer/core/frame/web_feature.h"
#include "third_party/blink/renderer/core/geometry/dom_matrix.h"
+#include "third_party/blink/renderer/core/helium_noise/canvas_noising_helper.h"
#include "third_party/blink/renderer/core/html/canvas/canvas_font_cache.h"
#include "third_party/blink/renderer/core/html/canvas/canvas_performance_monitor.h"
#include "third_party/blink/renderer/core/html/canvas/canvas_rendering_context.h"
@@ -534,6 +535,9 @@ ImageData* BaseRenderingContext2D::getIm
SkIRect bounds =
snapshot->PaintImageForCurrentFrame().GetSkImageInfo().bounds();
DCHECK(!bounds.intersect(SkIRect::MakeXYWH(sx, sy, sw, sh)));
+ } else {
+ CanvasNoisingHelper::MaybeNoiseImageData(GetExecutionContext(),
+ image_data, sx, sy);
}
}
+2 -2
View File
@@ -1075,7 +1075,7 @@
std::optional<SkColor> main_document_theme_color_;
--- a/content/browser/renderer_host/render_frame_host_impl.cc
+++ b/content/browser/renderer_host/render_frame_host_impl.cc
@@ -12867,6 +12867,22 @@ void RenderFrameHostImpl::CommitNavigati
@@ -12889,6 +12889,22 @@ void RenderFrameHostImpl::CommitNavigati
}
}
@@ -1098,7 +1098,7 @@
bool is_srcdoc = common_params->url.IsAboutSrcdoc();
if (is_srcdoc) {
// TODO(wjmaclean): initialize this in NavigationRequest's constructor
@@ -16423,6 +16439,15 @@ bool RenderFrameHostImpl::DidCommitNavig
@@ -16445,6 +16461,15 @@ bool RenderFrameHostImpl::DidCommitNavig
document_associated_data_->owned_page()->set_last_main_document_source_id(
ukm::ConvertToSourceId(navigation_request->GetNavigationId(),
ukm::SourceIdType::NAVIGATION_ID));
@@ -363,3 +363,16 @@
base::UnescapeRule::NORMAL, nullptr, nullptr, nullptr);
}
}
--- a/chrome/browser/resources/tab_search/tab_search_item.ts
+++ b/chrome/browser/resources/tab_search/tab_search_item.ts
@@ -256,8 +256,8 @@ export class TabSearchItemElement extend
// Show chrome:// if it's a chrome internal url
const protocol = new URL(normalizeURL(data.tab.url)).protocol;
- if (protocol === 'chrome:') {
- this.$.secondaryText.prepend(document.createTextNode('chrome://'));
+ if (protocol === 'chrome:' || protocol === 'helium:') {
+ this.$.secondaryText.prepend(document.createTextNode('helium://'));
}
}
@@ -16,7 +16,7 @@
#include "components/safe_browsing/core/common/features.h"
#include "components/safe_browsing/core/common/hashprefix_realtime/hash_realtime_utils.h"
#include "components/saved_tab_groups/public/features.h"
@@ -2889,14 +2887,9 @@ void AddSearchStrings(content::WebUIData
@@ -2891,14 +2889,9 @@ void AddSearchStrings(content::WebUIData
html_source->AddString("searchExplanationLearnMoreURL",
chrome::kOmniboxLearnMoreURL);
+8 -3
View File
@@ -1,6 +1,6 @@
--- a/chrome/app/settings_strings.grdp
+++ b/chrome/app/settings_strings.grdp
@@ -1950,6 +1950,40 @@
@@ -1950,6 +1950,43 @@
<message name="IDS_SETTINGS_SECURITY_DESCRIPTION" desc="Description of the controls available on the security settings page">
Safe Browsing (protection from dangerous sites) and other security settings
</message>
@@ -37,13 +37,16 @@
+ <message name="IDS_SETTINGS_HELIUM_SERVICES_OVERRIDE_ARIA_LABEL" desc="ARIA label of the text input for overriding the Helium services server">
+ Custom origin URL for Helium services
+ </message>
+ <message name="IDS_SETTINGS_HELIUM_SERVICES_OVERRIDE_INVALID_ORIGIN" desc="Validation error shown when the custom Helium services origin is invalid.">
+ Invalid origin
+ </message>
+
<message name="IDS_SETTINGS_ADVANCED_PROTECTION_PROGRAM" desc="Name of the link which takes users
to the Google Advanced Protection Program external webpage">
Google Advanced Protection Program
--- a/chrome/browser/ui/webui/settings/settings_localized_strings_provider.cc
+++ b/chrome/browser/ui/webui/settings/settings_localized_strings_provider.cc
@@ -2230,6 +2230,23 @@ void AddPrivacyStrings(content::WebUIDat
@@ -2230,6 +2230,25 @@ void AddPrivacyStrings(content::WebUIDat
{"siteSettingsSublabel", IDS_SETTINGS_PERMISSIONS_DESCRIPTION},
{"securityPageTitle", IDS_SETTINGS_SECURITY},
{"securityPageDescription", IDS_SETTINGS_SECURITY_DESCRIPTION},
@@ -64,6 +67,8 @@
+ IDS_SETTINGS_HELIUM_SERVICES_OVERRIDE_DESCRIPTION_WARNING},
+ {"heliumOriginOverrideLabel",
+ IDS_SETTINGS_HELIUM_SERVICES_OVERRIDE_ARIA_LABEL},
+ {"heliumOriginOverrideInvalidOrigin",
+ IDS_SETTINGS_HELIUM_SERVICES_OVERRIDE_INVALID_ORIGIN},
{"advancedProtectionProgramTitle",
IDS_SETTINGS_ADVANCED_PROTECTION_PROGRAM},
{"advancedProtectionProgramDesc",
@@ -259,7 +264,7 @@
+ maxlength="128"
+ aria-label="$i18n{heliumOriginOverrideLabel}"
+ auto-validate
+ error-message="Invalid origin"
+ error-message="$i18n{heliumOriginOverrideInvalidOrigin}"
+ spellcheck="false">
+ </cr-input>
+ </div>
@@ -25,7 +25,7 @@
Update Chromium
--- a/chrome/app/generated_resources.grd
+++ b/chrome/app/generated_resources.grd
@@ -13438,6 +13438,9 @@ Check your passwords anytime in <ph name
@@ -13452,6 +13452,9 @@ Check your passwords anytime in <ph name
<message name="IDS_APP_MENU_BUTTON_UPDATE" desc="Short label next to app-menu button when an update is available.">
Update
</message>
@@ -1,6 +1,6 @@
--- a/chrome/app/settings_strings.grdp
+++ b/chrome/app/settings_strings.grdp
@@ -2520,6 +2520,9 @@
@@ -2523,6 +2523,9 @@
<message name="IDS_SETTINGS_SEARCH_ENGINES_ADD_SITE_SEARCH" desc="Title for a dialog that allows adding a new site search engine.">
Add site search
</message>
@@ -32,7 +32,7 @@
{"advancedPageTitle", IDS_SETTINGS_ADVANCED},
{"back", IDS_ACCNAME_BACK},
{"basicPageTitle", IDS_SETTINGS_BASIC},
@@ -2922,6 +2923,8 @@ void AddSearchEnginesStrings(content::We
@@ -2924,6 +2925,8 @@ void AddSearchEnginesStrings(content::We
IDS_SETTINGS_SEARCH_ENGINES_PAGE_EXPLANATION},
{"searchEnginesAddSiteSearch",
IDS_SETTINGS_SEARCH_ENGINES_ADD_SITE_SEARCH},
File diff suppressed because it is too large Load Diff
@@ -1,6 +1,6 @@
--- a/chrome/app/settings_strings.grdp
+++ b/chrome/app/settings_strings.grdp
@@ -4001,6 +4001,21 @@
@@ -4004,6 +4004,21 @@
<message name="IDS_SETTINGS_PICK_AN_AVATAR" desc="Title of the edit avatar selection section on the manage profile page.">
Pick an avatar
</message>
@@ -10,7 +10,7 @@
<message name="IDS_SETTINGS_ENABLE_DO_NOT_TRACK_DIALOG_LEARN_MORE_ACCESSIBILITY_LABEL" desc="The accessibility label for a link to learn more about Do Not Track">
Learn more about Do Not Track
</message>
@@ -3439,6 +3442,9 @@
@@ -3442,6 +3445,9 @@
<message name="IDS_SETTINGS_TRACKING_PROTECTION_SITES_ALLOWED_COOKIES_DESCRIPTION" desc="Description of the section on the Tracking Protection settings page that lets users manage which sites are allowed to use third-party cookies. Explains how to use a wildcard to create an exception for an entire domain.">
Affects the sites listed here. Inserting “[*.]” before a domain name creates an exception for the entire domain. For example, adding “[*.]google.com” means that third-party cookies can also be active for mail.google.com, because it’s part of google.com.
</message>
@@ -31,7 +31,7 @@
{"doNotTrackDialogLearnMoreA11yLabel",
IDS_SETTINGS_ENABLE_DO_NOT_TRACK_DIALOG_LEARN_MORE_ACCESSIBILITY_LABEL},
// TODO(crbug.com/40122957): This string is no longer used. Remove.
@@ -3040,7 +3040,7 @@ void AddSiteSettingsStrings(content::Web
@@ -3042,7 +3042,7 @@ void AddSiteSettingsStrings(content::Web
{"trackingProtectionSitesAllowedCookiesTitle",
IDS_SETTINGS_TRACKING_PROTECTION_SITES_ALLOWED_COOKIES_TITLE},
{"trackingProtectionSitesAllowedCookiesDescription",
@@ -90,7 +90,7 @@
warning_summary_ = l10n_util::GetStringUTF16(
--- a/chrome/app/generated_resources.grd
+++ b/chrome/app/generated_resources.grd
@@ -3118,6 +3118,10 @@ are declared in tools/grit/grit_args.gni
@@ -3208,6 +3208,10 @@ are declared in tools/grit/grit_args.gni
desc="Status text for a download item that was interrupted because the file path name is too long.">
File name or location is too long
</message>
@@ -101,7 +101,7 @@
<message name="IDS_DOWNLOAD_BUBBLE_INTERRUPTED_SUBPAGE_SUMMARY_PATH_TOO_LONG"
desc="Subpage summary text for a download item that was interrupted because the file path name is too long.">
Try using a shorter file name or saving to a different folder
@@ -3146,6 +3150,10 @@ are declared in tools/grit/grit_args.gni
@@ -3236,6 +3240,10 @@ are declared in tools/grit/grit_args.gni
desc="Status text for a download item that had something go wrong.">
Something went wrong
</message>
+17 -19
View File
@@ -84,20 +84,18 @@
AddSeparator(ui::NORMAL_SEPARATOR);
AddItemWithStringIdAndVectorIcon(this, IDC_PERFORMANCE, IDS_SHOW_PERFORMANCE,
@@ -1532,12 +1476,6 @@ void AppMenuModel::LogMenuMetrics(int co
@@ -996,6 +940,10 @@ void ToolsMenuModel::Build(Browser* brow
}
LogMenuAction(MENU_ACTION_TOGGLE_REQUEST_TABLET_SITE);
break;
- case IDC_EXIT:
- if (!uma_action_recorded_) {
- base::UmaHistogramMediumTimes("WrenchMenu.TimeToAction.Exit", delta);
- }
- LogMenuAction(MENU_ACTION_EXIT);
- break;
}
}
+ if (browser_defaults::kShowExitMenuItem) {
+ AddSeparator(ui::NORMAL_SEPARATOR);
+ AddItemWithStringIdAndVectorIcon(this, IDC_EXIT, IDS_EXIT, kExitMenuIcon);
+ }
}
// Hosted App menu.
case IDC_OPEN_IN_CHROME:
@@ -1732,14 +1670,6 @@ void AppMenuModel::LogMenuMetrics(int co
////////////////////////////////////////////////////////////////////////////////
@@ -1732,14 +1680,6 @@ void AppMenuModel::LogMenuMetrics(int co
}
LogMenuAction(MENU_ACTION_SAFETY_HUB_MANAGE_EXTENSIONS);
break;
@@ -112,7 +110,7 @@
default: {
if (IsOtherProfileCommand(command_id)) {
if (!uma_action_recorded_) {
@@ -1821,22 +1751,8 @@ void AppMenuModel::Build() {
@@ -1821,22 +1761,8 @@ void AppMenuModel::Build() {
// Build (and, by extension, Init) should only be called once.
DCHECK_EQ(0u, GetItemCount());
@@ -137,7 +135,7 @@
AddSeparator(ui::NORMAL_SEPARATOR);
}
@@ -1873,32 +1789,6 @@ void AppMenuModel::Build() {
@@ -1873,32 +1799,6 @@ void AppMenuModel::Build() {
AddSeparator(ui::NORMAL_SEPARATOR);
@@ -170,7 +168,7 @@
if (!browser_->profile()->IsOffTheRecord()) {
auto recent_tabs_sub_menu =
std::make_unique<RecentTabsSubMenuModel>(provider_, browser_);
@@ -1920,7 +1810,7 @@ void AppMenuModel::Build() {
@@ -1920,7 +1820,7 @@ void AppMenuModel::Build() {
std::make_unique<BookmarkSubMenuModel>(this, browser_);
AddSubMenuWithStringIdAndVectorIcon(
@@ -179,7 +177,7 @@
bookmark_sub_menu_model_.get(), kBookmarksListsMenuIcon);
SetElementIdentifierAt(GetIndexOfCommandId(IDC_BOOKMARKS_MENU).value(),
kBookmarksMenuItem);
@@ -1937,23 +1827,10 @@ void AppMenuModel::Build() {
@@ -1937,23 +1837,10 @@ void AppMenuModel::Build() {
kTabGroupsMenuItem);
}
@@ -207,7 +205,7 @@
AddItemWithStringIdAndVectorIcon(this, IDC_CLEAR_BROWSING_DATA,
IDS_CLEAR_BROWSING_DATA,
@@ -2000,9 +1877,6 @@ void AppMenuModel::Build() {
@@ -2000,9 +1887,6 @@ void AppMenuModel::Build() {
lens::features::kLensOverlay));
}
@@ -217,7 +215,7 @@
CreateFindAndEditSubMenu();
sub_menus_.push_back(
@@ -2053,13 +1927,15 @@ void AppMenuModel::Build() {
@@ -2053,13 +1937,15 @@ void AppMenuModel::Build() {
#endif
#endif
@@ -237,7 +235,7 @@
// On Chrome OS, similar UI is displayed in the system tray menu, instead of
// this menu.
#if !BUILDFLAG(IS_CHROMEOS)
@@ -2149,34 +2025,21 @@ bool AppMenuModel::AddDefaultBrowserMenu
@@ -2149,34 +2035,21 @@ bool AppMenuModel::AddDefaultBrowserMenu
return false;
}
+10 -10
View File
@@ -363,7 +363,7 @@
theme_: {type: Object},
showCustomize_: {type: Boolean},
showCustomizeChromeText_: {type: Boolean},
@@ -353,9 +321,6 @@ export class AppElement extends AppEleme
@@ -356,9 +324,6 @@ export class AppElement extends AppEleme
loadTimeData.getBoolean('searchboxShowComposebox');
protected accessor composeboxState_: ComposeboxState|null = null;
@@ -373,7 +373,7 @@
protected accessor theme_: Theme|null = null;
protected accessor showCustomize_: boolean = false;
protected accessor showCustomizeChromeText_: boolean = false;
@@ -474,13 +439,6 @@ export class AppElement extends AppEleme
@@ -480,13 +445,6 @@ export class AppElement extends AppEleme
this.shouldPrintPerformance_ =
new URLSearchParams(location.search).has('print_perf');
@@ -387,7 +387,7 @@
this.showCustomize_ =
WindowProxy.getInstance().url.searchParams.has(CUSTOMIZE_URL_PARAM);
@@ -581,30 +539,12 @@ export class AppElement extends AppEleme
@@ -587,30 +545,12 @@ export class AppElement extends AppEleme
this.setCustomizeChromeSidePanelVisible_(this.showCustomize_);
recordCustomizeChromeOpen(NtpCustomizeChromeEntryPoint.URL);
}
@@ -418,7 +418,7 @@
if (loadTimeData.getString('backgroundImageUrl')) {
this.backgroundManager_.getBackgroundImageLoadTime().then(
time => {
@@ -734,12 +674,6 @@ export class AppElement extends AppEleme
@@ -740,12 +680,6 @@ export class AppElement extends AppEleme
if (!this.modulesEnabled_) {
this.recordBrowserPromoMetrics_();
}
@@ -431,7 +431,7 @@
}
override updated(changedProperties: PropertyValues<this>) {
@@ -781,31 +715,12 @@ export class AppElement extends AppEleme
@@ -787,31 +721,12 @@ export class AppElement extends AppEleme
composeboxDialog.showModal();
}
@@ -463,7 +463,7 @@
private computeShowCustomizeChromeText_(): boolean {
if (this.showWallpaperSearchButton_) {
return false;
@@ -898,26 +813,15 @@ export class AppElement extends AppEleme
@@ -904,26 +819,15 @@ export class AppElement extends AppEleme
const composebox =
this.shadowRoot.querySelector<ComposeboxElement>('#composebox');
assert(composebox);
@@ -492,7 +492,7 @@
const composebox =
this.shadowRoot.querySelector<ComposeboxElement>('#composebox');
assert(composebox);
@@ -929,7 +833,6 @@ export class AppElement extends AppEleme
@@ -935,7 +839,6 @@ export class AppElement extends AppEleme
this.toggleComposebox_();
this.logoColor_ = this.computeLogoColor_();
this.singleColoredLogo_ = this.computeSingleColoredLogo_();
@@ -500,7 +500,7 @@
}
protected onOpenVoiceSearch_() {
@@ -1125,101 +1028,6 @@ export class AppElement extends AppEleme
@@ -1131,101 +1034,6 @@ export class AppElement extends AppEleme
return !!this.theme_ && (!!this.theme_.logoColor || this.theme_.isDark);
}
@@ -602,7 +602,7 @@
protected onNtpMiddleSlotPromoLoaded_() {
this.middleSlotPromoLoaded_ = true;
}
@@ -1334,23 +1142,6 @@ export class AppElement extends AppEleme
@@ -1340,23 +1148,6 @@ export class AppElement extends AppEleme
}
private onWindowClick_(e: Event) {
@@ -626,7 +626,7 @@
if (e.composedPath() && e.composedPath()[0] === $$(this, '#content')) {
recordClick(NtpElement.BACKGROUND);
return;
@@ -1508,33 +1299,14 @@ export class AppElement extends AppEleme
@@ -1514,33 +1305,14 @@ export class AppElement extends AppEleme
* multiple toasts at the same time. Otherwise, the first pending toast is
* popped and shown.
*/
@@ -0,0 +1,175 @@
--- a/chrome/browser/ui/views/frame/browser_view.cc
+++ b/chrome/browser/ui/views/frame/browser_view.cc
@@ -42,6 +42,7 @@
#include "chrome/browser/actor/ui/actor_overlay_web_view.h"
#include "chrome/browser/app_mode/app_mode_utils.h"
#include "chrome/browser/ash/boca/on_task/on_task_locked_controller.h"
+#include "chrome/browser/browser_features.h"
#include "chrome/browser/browser_process.h"
#include "chrome/browser/browsing_data/browsing_data_important_sites_util.h"
#include "chrome/browser/desktop_to_mobile_promos/promos_utils.h"
@@ -85,6 +86,10 @@
#include "chrome/browser/ui/browser_finder.h"
#include "chrome/browser/ui/browser_list.h"
#include "chrome/browser/ui/browser_navigator.h"
+#if BUILDFLAG(IS_MAC)
+#include "chrome/browser/ui/browser_shortcuts/browser_shortcut_platform_mac.h"
+#endif
+#include "chrome/browser/ui/browser_shortcuts/browser_shortcut_service_factory.h"
#include "chrome/browser/ui/browser_tabstrip.h"
#include "chrome/browser/ui/browser_window/public/browser_window_features.h"
#include "chrome/browser/ui/browser_window_state.h"
@@ -1171,6 +1176,15 @@ BrowserView::BrowserView(Browser* browse
focus_manager_observation_.Observe(GetFocusManager());
}
+ if (base::FeatureList::IsEnabled(features::kCustomizableBrowserShortcuts)) {
+ browser_shortcut_service_ =
+ browser_shortcuts::BrowserShortcutServiceFactory::GetForProfile(
+ browser_->profile());
+ if (browser_shortcut_service_) {
+ browser_shortcut_service_->AddObserver(this);
+ }
+ }
+
#if BUILDFLAG(IS_CHROMEOS)
on_locked_task_subscription_ =
ash::boca::OnTaskLockedController::From(browser_)
@@ -1180,6 +1194,11 @@ BrowserView::BrowserView(Browser* browse
}
BrowserView::~BrowserView() {
+ if (browser_shortcut_service_) {
+ browser_shortcut_service_->RemoveObserver(this);
+ browser_shortcut_service_ = nullptr;
+ }
+
// Remove the layout manager to avoid dangling. This needs to be earlier than
// other cleanups that destroy views referenced in the layout manager.
SetLayoutManager(nullptr);
@@ -4404,6 +4423,10 @@ void BrowserView::OnWidgetActivationChan
browser_->GetFeatures()
.extension_keybinding_registry()
->OnHostActivationChanged(active);
+
+ if (active) {
+ UpdatePlatformAccelerators();
+ }
}
void BrowserView::OnWidgetBoundsChanged(views::Widget* widget,
@@ -5894,7 +5917,20 @@ void BrowserView::LoadAccelerators() {
browser_->GetProfile()->IsOffTheRecord() &&
browser_->GetProfile()->GetOTRProfileID().IsCaptivePortal();
#endif
- const std::vector<AcceleratorMapping> accelerator_list(GetAcceleratorList());
+ std::vector<AcceleratorMapping> accelerator_list(GetAcceleratorList());
+ if (browser_shortcut_service_ &&
+ base::FeatureList::IsEnabled(features::kCustomizableBrowserShortcuts)) {
+ std::erase_if(accelerator_list, [this](const AcceleratorMapping& entry) {
+ return browser_shortcut_service_->HasDefaultAccelerator(
+ entry.command_id,
+ ui::Accelerator(entry.keycode, entry.modifiers));
+ });
+ for (const auto& [accelerator, command_id] :
+ browser_shortcut_service_->GetAcceleratorMap()) {
+ accelerator_list.push_back(
+ {accelerator.key_code(), accelerator.modifiers(), command_id});
+ }
+ }
for (const auto& entry : accelerator_list) {
// In app mode, only allow accelerators of allowlisted commands to pass
// through.
@@ -5921,14 +5957,43 @@ void BrowserView::LoadAccelerators() {
#endif
ui::Accelerator accelerator(entry.keycode, entry.modifiers);
+ const bool already_registered = accelerator_table_.contains(accelerator);
accelerator_table_[accelerator] = entry.command_id;
- // Also register with the focus manager.
- focus_manager->RegisterAccelerator(
- accelerator, ui::AcceleratorManager::kNormalPriority, this);
+ if (!already_registered) {
+ focus_manager->RegisterAccelerator(
+ accelerator, ui::AcceleratorManager::kNormalPriority, this);
+ }
}
}
+void BrowserView::ReloadAccelerators() {
+ views::FocusManager* focus_manager = GetFocusManager();
+ if (!focus_manager) {
+ return;
+ }
+ focus_manager->UnregisterAccelerators(this);
+ accelerator_table_.clear();
+ LoadAccelerators();
+ UpdatePlatformAccelerators();
+}
+
+void BrowserView::OnBrowserShortcutsChanged() {
+ ReloadAccelerators();
+}
+
+void BrowserView::UpdatePlatformAccelerators() {
+#if BUILDFLAG(IS_MAC)
+ if (!base::FeatureList::IsEnabled(features::kCustomizableBrowserShortcuts) ||
+ !browser_shortcut_service_ || !IsActive()) {
+ return;
+ }
+
+ browser_shortcuts::UpdatePlatformMenuAccelerators(
+ browser_shortcut_service_->GetAcceleratorMap());
+#endif
+}
+
int BrowserView::GetCommandIDForAppCommandID(int app_command_id) const {
#if BUILDFLAG(IS_WIN)
switch (app_command_id) {
--- a/chrome/browser/ui/views/frame/browser_view.h
+++ b/chrome/browser/ui/views/frame/browser_view.h
@@ -21,6 +21,7 @@
#include "base/timer/timer.h"
#include "build/build_config.h"
#include "chrome/browser/ui/browser.h"
+#include "chrome/browser/ui/browser_shortcuts/browser_shortcut_service.h"
#include "chrome/browser/ui/browser_window.h"
#include "chrome/browser/ui/tabs/projects/projects_panel_state_controller.h"
#include "chrome/browser/ui/tabs/tab_strip_model_observer.h"
@@ -143,6 +144,7 @@ class BrowserView : public BrowserWindow
public infobars::InfoBarContainer::Delegate,
public ImmersiveModeController::Observer,
public webapps::AppBannerManager::Observer,
+ public browser_shortcuts::BrowserShortcutService::Observer,
public views::FocusChangeListener {
METADATA_HEADER(BrowserView, views::ClientView)
@@ -784,6 +786,9 @@ class BrowserView : public BrowserWindow
// ui::AcceleratorTarget:
bool AcceleratorPressed(const ui::Accelerator& accelerator) override;
+ // browser_shortcuts::BrowserShortcutService::Observer:
+ void OnBrowserShortcutsChanged() override;
+
// ImmersiveModeController::Observer:
void OnImmersiveFullscreenEntered() override;
void OnImmersiveFullscreenExited() override;
@@ -1032,6 +1037,8 @@ class BrowserView : public BrowserWindow
// Copy the accelerator table from the app resources into something we can
// use.
void LoadAccelerators();
+ void ReloadAccelerators();
+ void UpdatePlatformAccelerators();
// Retrieves the command id for the specified Windows app command.
int GetCommandIDForAppCommandID(int app_command_id) const;
@@ -1342,6 +1349,8 @@ class BrowserView : public BrowserWindow
// A mapping between accelerators and command IDs.
std::map<ui::Accelerator, int> accelerator_table_;
+ raw_ptr<browser_shortcuts::BrowserShortcutService> browser_shortcut_service_ =
+ nullptr;
// True if we have already been initialized.
bool initialized_ = false;
@@ -21,7 +21,7 @@
</message>
--- a/chrome/browser/ui/webui/settings/settings_localized_strings_provider.cc
+++ b/chrome/browser/ui/webui/settings/settings_localized_strings_provider.cc
@@ -524,6 +524,10 @@ void AddAppearanceStrings(content::WebUI
@@ -525,6 +525,10 @@ void AddAppearanceStrings(content::WebUI
{"browserLayoutCompact", IDS_SETTINGS_BROWSER_LAYOUT_COMPACT},
{"browserLayoutVertical", IDS_SETTINGS_BROWSER_LAYOUT_VERTICAL},
{"tabStripRightAlign", IDS_SETTINGS_TAB_STRIP_RIGHT_ALIGN},
@@ -32,7 +32,7 @@
{"centeredLocationBar", IDS_SETTINGS_CENTERED_LOCATION_BAR},
{"verticalCollapseShortcut", IDS_SETTINGS_VERTICAL_COLLAPSE_SHORTCUT},
{"minimalLocationBar", IDS_SETTINGS_MINIMAL_LOCATION_BAR},
@@ -596,6 +600,9 @@ void AddAppearanceStrings(content::WebUI
@@ -597,6 +601,9 @@ void AddAppearanceStrings(content::WebUI
tabs::IsVerticalTabsFeatureEnabled());
html_source->AddBoolean("showVerticalTabsExpandOnHoverEnabled",
tabs::IsVerticalTabsExpandOnHoverFeatureEnabled());
@@ -220,7 +220,7 @@
HeliumLayoutType GetBrowserLayout() const;
--- a/chrome/browser/ui/tabs/tab_strip_prefs.cc
+++ b/chrome/browser/ui/tabs/tab_strip_prefs.cc
@@ -48,6 +48,9 @@ void RegisterProfilePrefs(user_prefs::Pr
@@ -50,6 +50,9 @@ void RegisterProfilePrefs(user_prefs::Pr
registry->RegisterIntegerPref(prefs::kHeliumLayout,
std::to_underlying(HeliumLayoutType::kClassic));
registry->RegisterBooleanPref(prefs::kHeliumVerticalRightAligned, false);
@@ -303,7 +303,7 @@
{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
@@ -1840,6 +1840,8 @@ void BrowserCommandController::InitComma
@@ -1847,6 +1847,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);
@@ -323,3 +323,48 @@
{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,
--- a/chrome/app/generated_resources.grd
+++ b/chrome/app/generated_resources.grd
@@ -19417,6 +19417,9 @@ Please help our engineers fix this probl
<message name="IDS_LINK_COPIED_TOAST_BODY" desc="Text on a toast notification that is shown when a link is successfully copied.">
Link copied
</message>
+ <message name="IDS_ZEN_MODE_NEW_TAB_CREATED_TOAST_BODY" desc="Text on a toast notification that is shown when a link opens a new tab while Zen Mode is enabled.">
+ New tab opened
+ </message>
<message name="IDS_IMAGE_COPIED_TOAST_BODY" desc="Text on a toast notification that is shown when an image is successfully copied.">
Image copied
</message>
--- a/chrome/browser/ui/toasts/api/toast_id.cc
+++ b/chrome/browser/ui/toasts/api/toast_id.cc
@@ -75,6 +75,8 @@ std::string_view GetToastName(ToastId to
return "MultistepFilterSuggestionRecent";
case ToastId::kSkillSavedWithoutInvokeButton:
return "SkillSavedWithoutInvokeButton";
+ case ToastId::kZenModeNewTabCreated:
+ return "ZenModeNewTabCreated";
}
NOTREACHED();
--- a/chrome/browser/ui/toasts/api/toast_id.h
+++ b/chrome/browser/ui/toasts/api/toast_id.h
@@ -54,7 +54,8 @@ enum class ToastId {
kMultistepFilterSuggestion = 31,
kMultistepFilterSuggestionRecent = 32,
kSkillSavedWithoutInvokeButton = 33,
- kMaxValue = kSkillSavedWithoutInvokeButton,
+ kZenModeNewTabCreated = 34,
+ kMaxValue = kZenModeNewTabCreated,
};
// LINT.ThenChange(/tools/metrics/histograms/metadata/toasts/enums.xml:ToastId)
--- a/tools/metrics/histograms/metadata/toasts/enums.xml
+++ b/tools/metrics/histograms/metadata/toasts/enums.xml
@@ -92,6 +92,7 @@ chromium-metrics-reviews@google.com.
<int value="31" label="Filter Suggestion"/>
<int value="32" label="Filter Suggestion Recent"/>
<int value="33" label="Saved Skill without Invoke Button"/>
+ <int value="34" label="New tab created in Zen mode"/>
</enum>
<!-- LINT.ThenChange(/chrome/browser/ui/toasts/api/toast_id.h:ToastId) -->
File diff suppressed because it is too large Load Diff
+1 -1
View File
@@ -1,6 +1,6 @@
--- a/chrome/browser/ui/views/toolbar/toolbar_view.cc
+++ b/chrome/browser/ui/views/toolbar/toolbar_view.cc
@@ -1757,8 +1757,7 @@ AppMenuButton* ToolbarView::GetAppMenuBu
@@ -1782,8 +1782,7 @@ AppMenuButton* ToolbarView::GetAppMenuBu
}
gfx::Rect ToolbarView::GetFindBarBoundingBox(int contents_bottom) {
+2 -2
View File
@@ -56,7 +56,7 @@
+}
--- a/chrome/browser/ui/BUILD.gn
+++ b/chrome/browser/ui/BUILD.gn
@@ -3368,6 +3368,7 @@ static_library("ui") {
@@ -3383,6 +3383,7 @@ static_library("ui") {
"views/frame/immersive_mode_controller_mac.mm",
"views/frame/immersive_mode_overlay_views_mac.h",
"views/frame/immersive_mode_overlay_views_mac.mm",
@@ -64,7 +64,7 @@
"views/tab_contents/chrome_web_contents_view_delegate_views_mac.h",
"views/tab_contents/chrome_web_contents_view_delegate_views_mac.mm",
"webui/help/version_updater_mac.mm",
@@ -4103,6 +4104,8 @@ static_library("ui") {
@@ -4118,6 +4119,8 @@ static_library("ui") {
"views/global_media_controls/media_toolbar_button_contextual_menu.h",
"views/global_media_controls/media_toolbar_button_view.cc",
"views/global_media_controls/media_toolbar_button_view.h",
+42 -2
View File
@@ -94,8 +94,8 @@
/* 16% opacity */
constexpr SkAlpha kWebUiTabStripTabSeparatorAlpha = 0.16 * 255;
+
+/* 50% opacity */
+constexpr SkAlpha kTabInactiveHoverAlpha = 0.5 * 255;
+/* 45% opacity */
+constexpr SkAlpha kTabInactiveHoverAlpha = 0.45 * 255;
+
} // namespace
@@ -183,3 +183,43 @@
mixer[kColorTabSearchButtonCRForegroundFrameActive] = {
ui::kColorSysOnSurfacePrimary};
--- a/ui/color/sys_color_mixer.cc
+++ b/ui/color/sys_color_mixer.cc
@@ -66,7 +66,7 @@ void AddThemedSysColorOverrides(ColorMix
// Experimentation.
mixer[kColorSysOmniboxContainer] = {dark_mode ? kColorRefSecondary15
- : kColorSysSurface4};
+ : kColorSysSurface5};
}
// Overrides for the grayscale baseline case.
@@ -95,6 +95,10 @@ void AddGrayscaleSysColorOverrides(Color
mixer[kColorSysOnHeaderPrimary] = {dark_mode ? kColorRefNeutral80
: kColorRefNeutral40};
+ // Toned divider.
+ mixer[kColorSysSurfaceVariant] = {dark_mode ? kColorRefNeutral40
+ : kColorRefNeutral92};
+
// States.
mixer[kColorSysStateInactiveRing] = {
dark_mode ? SetAlpha({kColorRefNeutral70}, 0x8C)
@@ -106,7 +110,7 @@ void AddGrayscaleSysColorOverrides(Color
// Experimentation.
mixer[kColorSysOmniboxContainer] = {dark_mode ? kColorRefNeutral15
- : kColorRefNeutral94};
+ : kColorRefNeutral92};
}
} // namespace
@@ -367,7 +371,7 @@ void AddSysColorMixer(ColorProvider* pro
// Experimentation.
mixer[kColorSysOmniboxContainer] = {dark_mode ? kColorRefNeutral15
- : kColorSysSurface4};
+ : kColorSysSurface5};
// Deprecated.
// TODO(crbug.com/350783235): Remove remaining uses of these deprecated sys
@@ -37,7 +37,7 @@
void OnTouchUiChanged();
void NewTabButtonPressed(const ui::Event& event);
@@ -457,6 +462,8 @@ class ToolbarView : public views::Access
@@ -459,6 +464,8 @@ class ToolbarView : public views::Access
BooleanPrefMember show_media_button_;
@@ -118,7 +118,7 @@
} // namespace
@@ -681,6 +737,11 @@ void ToolbarView::Init() {
@@ -685,6 +741,11 @@ void ToolbarView::Init() {
OnShowMediaButtonChanged();
}
@@ -130,7 +130,7 @@
InitLayout();
for (auto* button : std::array<views::Button*, 5>{back_, forward_, reload_,
@@ -1569,7 +1630,11 @@ void ToolbarView::InitLayout() {
@@ -1606,7 +1667,11 @@ void ToolbarView::InitLayout() {
views::MaximumFlexSizeRule::kUnbounded)
.WithOrder(kLocationBarFlexOrder);
@@ -143,7 +143,7 @@
layout_manager_->SetOrientation(views::LayoutOrientation::kHorizontal)
.SetCrossAxisAlignment(views::LayoutAlignment::kCenter)
@@ -1938,6 +2003,46 @@ void ToolbarView::OnShowMediaButtonChang
@@ -1963,6 +2028,46 @@ void ToolbarView::OnShowMediaButtonChang
InvalidateLayout();
}
@@ -204,7 +204,7 @@
</message>
--- a/chrome/browser/ui/webui/settings/settings_localized_strings_provider.cc
+++ b/chrome/browser/ui/webui/settings/settings_localized_strings_provider.cc
@@ -524,6 +524,7 @@ void AddAppearanceStrings(content::WebUI
@@ -525,6 +525,7 @@ void AddAppearanceStrings(content::WebUI
{"browserLayoutCompact", IDS_SETTINGS_BROWSER_LAYOUT_COMPACT},
{"browserLayoutVertical", IDS_SETTINGS_BROWSER_LAYOUT_VERTICAL},
{"tabStripRightAlign", IDS_SETTINGS_TAB_STRIP_RIGHT_ALIGN},
+14 -14
View File
@@ -50,7 +50,7 @@
BASE_DECLARE_FEATURE(kBrowserWidgetCacheThemeService);
--- a/chrome/browser/ui/views/frame/browser_view.h
+++ b/chrome/browser/ui/views/frame/browser_view.h
@@ -79,6 +79,7 @@ class ContentsLayoutManager;
@@ -80,6 +80,7 @@ class ContentsLayoutManager;
struct DropData;
class ExclusiveAccessBubbleViews;
class ExclusiveAccessBubbleViewsContext;
@@ -58,7 +58,7 @@
class InfoBarContainerView;
class LocationBarView;
class MultiContentsView;
@@ -356,6 +357,9 @@ class BrowserView : public BrowserWindow
@@ -358,6 +359,9 @@ class BrowserView : public BrowserWindow
// Returns whether the webapp frame toolbar should be drawn.
bool ShouldDrawWebAppFrameToolbar() const;
@@ -68,7 +68,7 @@
// Returns whether or not strokes should be drawn around and under the tabs.
bool ShouldDrawTabStrokes() const;
@@ -942,6 +946,8 @@ class BrowserView : public BrowserWindow
@@ -947,6 +951,8 @@ class BrowserView : public BrowserWindow
void OnVerticalTabStripModeChanged(
tabs::VerticalTabStripStateController* controller);
@@ -77,7 +77,7 @@
void OnProjectsPanelStateChanged(ProjectsPanelStateController* controller);
// Make sure the WebUI tab strip exists if it should.
@@ -1446,6 +1452,8 @@ class BrowserView : public BrowserWindow
@@ -1455,6 +1461,8 @@ class BrowserView : public BrowserWindow
PrefChangeRegistrar registrar_;
@@ -88,7 +88,7 @@
std::unique_ptr<tabs::VerticalTabStripStateController::ScopedEnableStateLock>
--- a/chrome/browser/ui/views/frame/browser_view.cc
+++ b/chrome/browser/ui/views/frame/browser_view.cc
@@ -1490,7 +1490,8 @@ bool BrowserView::ShouldDrawTabStrip() c
@@ -1510,7 +1510,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.
@@ -98,7 +98,7 @@
}
bool BrowserView::ShouldDrawVerticalTabStrip() const {
@@ -1504,6 +1505,11 @@ bool BrowserView::ShouldDrawWebAppFrameT
@@ -1524,6 +1525,11 @@ bool BrowserView::ShouldDrawWebAppFrameT
GetFrameView()->ShouldShowWebAppFrameToolbar();
}
@@ -110,7 +110,7 @@
bool BrowserView::IsVerticalTabStripCollapsed() const {
if (auto* const controller =
tabs::VerticalTabStripStateController::From(browser_)) {
@@ -1635,6 +1641,31 @@ void BrowserView::OnVerticalTabStripMode
@@ -1655,6 +1661,31 @@ void BrowserView::OnVerticalTabStripMode
InvalidateLayout();
}
@@ -142,7 +142,7 @@
void BrowserView::OnProjectsPanelStateChanged(
ProjectsPanelStateController* controller) {
projects_panel_container_->OnProjectsPanelStateChanged(controller);
@@ -4089,9 +4120,10 @@ void BrowserView::ReparentTabStripAndWeb
@@ -4112,9 +4143,10 @@ void BrowserView::ReparentTabStripAndWeb
// The TabStrip must be placed in the same position before the reparenting
// to maintain the correct Z-order to ensure it can receive mouse events.
// See crbug.com/454852658.
@@ -156,7 +156,7 @@
// Reparent PWA views that were moved for immersive and ChromeOS tablet
// mode.
@@ -5198,6 +5230,16 @@ void BrowserView::AddedToWidget() {
@@ -5237,6 +5269,16 @@ void BrowserView::AddedToWidget() {
toolbar_->Init();
@@ -191,7 +191,7 @@
constexpr int kToolbarFlexOrderOffset = 1000;
constexpr int kLocationBarFlexOrder = kToolbarFlexOrderOffset + 1;
constexpr int kToolbarActionsFlexOrder = kToolbarFlexOrderOffset + 2;
@@ -1344,6 +1346,22 @@ bool ToolbarView::IsRectInWindowCaption(
@@ -1381,6 +1383,22 @@ bool ToolbarView::IsRectInWindowCaption(
return gfx::ToEnclosingRect(rect_in_target_coords_f);
};
@@ -214,7 +214,7 @@
// Check each child 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.
@@ -1735,6 +1753,30 @@ void ToolbarView::LayoutCommon() {
@@ -1760,6 +1778,30 @@ void ToolbarView::LayoutCommon() {
// Cast button visibility is controlled externally.
}
@@ -245,7 +245,7 @@
void ToolbarView::UpdateToolbarLayout() {
if (!location_bar_) {
return;
@@ -1745,7 +1787,10 @@ void ToolbarView::UpdateToolbarLayout()
@@ -1770,7 +1812,10 @@ void ToolbarView::UpdateToolbarLayout()
views::MaximumFlexSizeRule::kPreferred);
const int location_bar_margin =
GetLayoutConstant(LayoutConstant::kLocationBarMargin);
@@ -257,7 +257,7 @@
const views::FlexSpecification location_bar_flex_rule =
views::FlexSpecification(min_location_bar_flex,
views::MaximumFlexSizeRule::kUnbounded)
@@ -2062,7 +2107,7 @@ void ToolbarView::OnLocationBarCenteredC
@@ -2087,7 +2132,7 @@ void ToolbarView::OnLocationBarCenteredC
gfx::Rect ToolbarView::GetCenteredLocationBarBounds(gfx::Rect bounds,
int toolbar_width) const {
@@ -286,7 +286,7 @@
// Accessors.
Browser* browser() const { return browser_; }
views::Button* GetChromeLabsButton() const;
@@ -423,6 +427,7 @@ class ToolbarView : public views::Access
@@ -425,6 +429,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;
+3 -3
View File
@@ -24,7 +24,7 @@
#define IDC_ADD_NEW_TAB_TO_GROUP 34100
--- a/chrome/app/generated_resources.grd
+++ b/chrome/app/generated_resources.grd
@@ -10296,6 +10296,51 @@ Keep your key file in a safe place. You
@@ -10386,6 +10386,51 @@ Keep your key file in a safe place. You
Right
</message>
@@ -128,7 +128,7 @@
if (!current_tab) {
--- a/chrome/browser/ui/browser_command_controller.cc
+++ b/chrome/browser/ui/browser_command_controller.cc
@@ -746,6 +746,21 @@ bool BrowserCommandController::ExecuteCo
@@ -747,6 +747,21 @@ bool BrowserCommandController::ExecuteCo
case IDC_NAME_WINDOW:
PromptToNameWindow(browser_);
break;
@@ -150,7 +150,7 @@
#if BUILDFLAG(IS_CHROMEOS)
case IDC_TAKE_SCREENSHOT:
@@ -1573,6 +1588,15 @@ void BrowserCommandController::InitComma
@@ -1580,6 +1595,15 @@ void BrowserCommandController::InitComma
command_updater_.UpdateCommandEnabled(IDC_SHOW_SEARCH_TOOLS, true);
command_updater_.UpdateCommandEnabled(IDC_SHOW_AI_MODE_OMNIBOX_BUTTON, true);
+4 -4
View File
@@ -68,8 +68,8 @@
#include "chrome/browser/ui/tab_search_feature.h"
#include "chrome/browser/ui/tabs/features.h"
#include "chrome/browser/ui/tabs/vertical_tab_strip_state.h"
@@ -43,11 +44,11 @@ void RegisterProfilePrefs(user_prefs::Pr
prefs::kTabSearchPinnedToTabstripMigrationComplete, false);
@@ -45,11 +46,11 @@ void RegisterProfilePrefs(user_prefs::Pr
prefs::kTabSearchPinnedToTabstripMigrationComplete2, false);
registry->RegisterBooleanPref(prefs::kProjectsPanelPinnedToTabstrip, true);
registry->RegisterBooleanPref(prefs::kEverythingMenuPinnedToTabstrip, true);
- registry->RegisterBooleanPref(prefs::kVerticalTabsEnabled, false);
@@ -275,7 +275,7 @@
// A boolean pref set to true if a Home button to open the Home pages should be
// visible on the toolbar.
inline constexpr char kShowHomeButton[] = "browser.show_home_button";
@@ -1492,18 +1499,6 @@ inline constexpr char kProjectsPanelPinn
@@ -1498,18 +1505,6 @@ inline constexpr char kProjectsPanelPinn
inline constexpr char kEverythingMenuPinnedToTabstrip[] =
"everything_menu.pinned_to_tabstrip";
@@ -771,7 +771,7 @@
void StartPasswordManagerTutorial();
--- a/chrome/browser/glic/suggestions/contextual_cueing_helper.cc
+++ b/chrome/browser/glic/suggestions/contextual_cueing_helper.cc
@@ -472,10 +472,6 @@ ContextualCueingHelper::AutoOpenGlicSide
@@ -476,10 +476,6 @@ ContextualCueingHelper::AutoOpenGlicSide
Profile* profile =
Profile::FromBrowserContext(web_contents()->GetBrowserContext());
bool vertical_tabs_enabled = false;
+3 -3
View File
@@ -1,6 +1,6 @@
--- a/chrome/browser/prefs/browser_prefs.cc
+++ b/chrome/browser/prefs/browser_prefs.cc
@@ -974,6 +974,12 @@ constexpr char kSafeBrowsingModuleLastCo
@@ -975,6 +975,12 @@ constexpr char kSafeBrowsingModuleLastCo
constexpr char kSafeBrowsingModuleOpened[] =
"safebrowsing.ntp.user_opened_module";
@@ -13,7 +13,7 @@
// Register local state used only for migration (clearing or moving to a new
// key).
void RegisterLocalStatePrefsForMigration(PrefRegistrySimple* registry) {
@@ -1336,6 +1342,10 @@ void RegisterProfilePrefsForMigration(
@@ -1337,6 +1343,10 @@ void RegisterProfilePrefsForMigration(
registry->RegisterIntegerPref(kSafeBrowsingModuleShownCount, 0);
registry->RegisterInt64Pref(kSafeBrowsingModuleLastCooldownStartAt, 0);
registry->RegisterBooleanPref(kSafeBrowsingModuleOpened, false);
@@ -24,7 +24,7 @@
}
} // namespace
@@ -2620,6 +2630,25 @@ void MigrateObsoleteProfilePrefs(PrefSer
@@ -2622,6 +2632,25 @@ void MigrateObsoleteProfilePrefs(PrefSer
// Added 03/2026.
profile_prefs->ClearPref(kNtpPromoPrefLastSnoozed);
@@ -255,7 +255,7 @@
</message>
--- a/chrome/browser/ui/webui/settings/settings_localized_strings_provider.cc
+++ b/chrome/browser/ui/webui/settings/settings_localized_strings_provider.cc
@@ -526,6 +526,7 @@ void AddAppearanceStrings(content::WebUI
@@ -527,6 +527,7 @@ void AddAppearanceStrings(content::WebUI
{"tabStripRightAlign", IDS_SETTINGS_TAB_STRIP_RIGHT_ALIGN},
{"centeredLocationBar", IDS_SETTINGS_CENTERED_LOCATION_BAR},
{"verticalCollapseShortcut", IDS_SETTINGS_VERTICAL_COLLAPSE_SHORTCUT},
+1 -1
View File
@@ -41,7 +41,7 @@
</message>
--- a/chrome/browser/ui/webui/settings/settings_localized_strings_provider.cc
+++ b/chrome/browser/ui/webui/settings/settings_localized_strings_provider.cc
@@ -518,6 +518,12 @@ void AddAppearanceStrings(content::WebUI
@@ -519,6 +519,12 @@ void AddAppearanceStrings(content::WebUI
{"openNewTabNextToActive", IDS_SETTINGS_NEW_TAB_NEXT_TO_ACTIVE_BUTTON},
{"cycleTabsInMRUOrder", IDS_SETTINGS_CYCLE_TABS_IN_MRU_ORDER},
{"roundedFrame", IDS_SETTINGS_ROUNDED_FRAME},
+6 -6
View File
@@ -50,8 +50,8 @@
+#include "chrome/browser/ui/tabs/vertical_tab_strip_state_controller.h"
#include "chrome/browser/ui/toolbar/chrome_labs/chrome_labs_utils.h"
#include "chrome/browser/ui/ui_features.h"
#include "chrome/browser/ui/views/frame/browser_view.h"
@@ -232,6 +234,13 @@ void InvokeAction(actions::ActionId id,
#include "chrome/browser/ui/views/download/bubble/download_toolbar_ui_controller.h"
@@ -233,6 +235,13 @@ void InvokeAction(actions::ActionId id,
actions::ActionManager::Get().FindAction(id, scope)->InvokeAction();
}
@@ -65,7 +65,7 @@
} // namespace
///////////////////////////////////////////////////////////////////////////////
@@ -317,6 +326,10 @@ BrowserCommandController::BrowserCommand
@@ -318,6 +327,10 @@ BrowserCommandController::BrowserCommand
base::BindRepeating(
&BrowserCommandController::UpdateCommandsForIncognitoAvailability,
base::Unretained(this)));
@@ -76,7 +76,7 @@
#if BUILDFLAG(ENABLE_PRINTING)
profile_pref_registrar_.Add(
prefs::kPrintingEnabled,
@@ -1313,6 +1326,20 @@ bool BrowserCommandController::ExecuteCo
@@ -1320,6 +1333,20 @@ bool BrowserCommandController::ExecuteCo
copy ? IDC_COPY_URL : IDC_DEV_TOOLS_INSPECT,
disposition, time_stamp);
}
@@ -97,7 +97,7 @@
// Hosted App commands
case IDC_COPY_URL:
CopyURL(browser_, browser_->tab_strip_model()->GetActiveWebContents());
@@ -2366,7 +2393,11 @@ void BrowserCommandController::UpdateSav
@@ -2373,7 +2400,11 @@ void BrowserCommandController::UpdateSav
return;
}
@@ -185,7 +185,7 @@
<message name="IDS_SETTINGS_APPEARANCE" desc="Name of the settings page which displays appearance preferences.">
--- a/chrome/browser/ui/webui/settings/settings_localized_strings_provider.cc
+++ b/chrome/browser/ui/webui/settings/settings_localized_strings_provider.cc
@@ -524,6 +524,7 @@ void AddAppearanceStrings(content::WebUI
@@ -525,6 +525,7 @@ void AddAppearanceStrings(content::WebUI
{"browserLayoutCompact", IDS_SETTINGS_BROWSER_LAYOUT_COMPACT},
{"browserLayoutVertical", IDS_SETTINGS_BROWSER_LAYOUT_VERTICAL},
{"tabStripRightAlign", IDS_SETTINGS_TAB_STRIP_RIGHT_ALIGN},
+41 -38
View File
@@ -145,7 +145,7 @@
return kViewCommandMap;
}
@@ -441,6 +457,16 @@ void ToolbarView::Init() {
@@ -438,6 +454,16 @@ void ToolbarView::Init() {
#endif
// Always add children in order from left to right, for accessibility.
@@ -162,7 +162,7 @@
if (!features::IsWebUIBackForwardButtonEnabled()) {
back_ = AddChildView(std::make_unique<BackForwardButton>(
BackForwardButton::Direction::kBack,
@@ -491,9 +517,22 @@ void ToolbarView::Init() {
@@ -488,6 +514,21 @@ void ToolbarView::Init() {
location_bar_ = toolbar_webview_->GetLocationBar();
}
@@ -181,25 +181,11 @@
+ vertical_tab_strip_state_controller->ShouldDisplayVerticalTabs();
+ }
+
if (glic::GlicEnabling::IsProfileEligible(browser_view_->GetProfile())) {
- auto* vertical_tab_strip_state_controller =
- tabs::VerticalTabStripStateController::From(browser_view_->browser());
if (base::FeatureList::IsEnabled(features::kGlicActorUi) &&
features::kGlicActorUiTaskIcon.Get()) {
glic_actor_button_container_ =
@@ -511,17 +550,28 @@ void ToolbarView::Init() {
views::kMarginsKey,
gfx::Insets::VH(
bool is_glic_left_of_profile =
features::kGlicToolbarButtonLocationParam.Get() ==
features::GlicToolbarButtonLocation::kLeftOfProfileChip ||
@@ -507,6 +548,25 @@ void ToolbarView::Init() {
0, GetLayoutConstant(LayoutConstant::kToolbarDividerSpacing)));
- if (vertical_tab_strip_state_controller) {
- vertical_tab_subscription_ =
- vertical_tab_strip_state_controller->RegisterOnModeChanged(
- base::BindRepeating(&ToolbarView::OnVerticalTabStripModeChanged,
- base::Unretained(this)));
- should_display_vertical_tabs_ =
- vertical_tab_strip_state_controller->ShouldDisplayVerticalTabs();
- }
UpdateGlicButtonVisibility();
}
+ std::unique_ptr<ToolbarButton> dynamic_new_tab_button =
@@ -224,7 +210,24 @@
if (extensions_container) {
extensions_container_ = AddChildView(std::move(extensions_container));
extensions_toolbar_coordinator_ =
@@ -708,6 +758,16 @@ void ToolbarView::Init() {
@@ -685,16 +745,6 @@ void ToolbarView::Init() {
}
if (glic::GlicEnabling::IsProfileEligible(browser_view_->GetProfile())) {
- auto* vertical_tab_strip_state_controller =
- tabs::VerticalTabStripStateController::From(browser_view_->browser());
- if (vertical_tab_strip_state_controller) {
- vertical_tab_subscription_ =
- vertical_tab_strip_state_controller->RegisterOnModeChanged(
- base::BindRepeating(&ToolbarView::OnVerticalTabStripModeChanged,
- base::Unretained(this)));
- should_display_vertical_tabs_ =
- vertical_tab_strip_state_controller->ShouldDisplayVerticalTabs();
- }
UpdateGlicButtonVisibility();
}
@@ -712,6 +762,16 @@ void ToolbarView::Init() {
reload_->SetVisible(show_reload_button_.GetValue());
@@ -241,7 +244,7 @@
show_avatar_button_.Init(
prefs::kShowAvatarButton, prefs,
base::BindRepeating(&ToolbarView::OnShowAvatarButtonChanged,
@@ -756,8 +816,9 @@ void ToolbarView::Init() {
@@ -760,8 +820,9 @@ void ToolbarView::Init() {
views::FlexSpecification(views::MinimumFlexSizeRule::kPreferred,
views::MaximumFlexSizeRule::kPreferred);
@@ -253,7 +256,7 @@
if (button) {
button->set_tag(GetViewCommandMap().at(button->GetID()));
button->SetProperty(views::kFlexBehaviorKey, flex_preferred);
@@ -772,6 +833,12 @@ void ToolbarView::OnVerticalTabStripMode
@@ -788,6 +849,12 @@ void ToolbarView::OnVerticalTabStripMode
should_display_vertical_tabs_ = controller->ShouldDisplayVerticalTabs();
UpdateGlicButtonVisibility();
UpdateGlicActorVisibility();
@@ -266,7 +269,7 @@
}
std::unique_ptr<GlicAndActorButtonsContainer>
@@ -1615,6 +1682,16 @@ void ToolbarView::NewTabButtonPressed(co
@@ -1652,6 +1719,16 @@ void ToolbarView::NewTabButtonPressed(co
NewTabTypes::kNewTabButtonInToolbarForTouch);
}
@@ -283,7 +286,7 @@
bool ToolbarView::AcceleratorPressed(const ui::Accelerator& accelerator) {
const views::View* focused_view = focus_manager()->GetFocusedView();
if (focused_view && (focused_view->GetID() == VIEW_ID_OMNIBOX)) {
@@ -1738,13 +1815,37 @@ void ToolbarView::LayoutCommon() {
@@ -1768,13 +1845,35 @@ void ToolbarView::LayoutCommon() {
browser_->window() &&
(browser_->window()->IsMaximized() || browser_->window()->IsFullscreen());
const int margin = extend_buttons_to_edge ? interior_margin.left() : 0;
@@ -291,7 +294,6 @@
- toolbar_webview_->SetBackButtonLeadingMargin(margin);
- } else {
- back_->SetLeadingMargin(margin);
+
+ const bool collapse_button_on_trailing_edge =
+ vertical_tabs_collapse_button_ &&
+ vertical_tabs_collapse_button_->GetVisible() && IsVerticalLayout() &&
@@ -307,11 +309,10 @@
+ leading_button->SetLeadingMargin(margin);
+ if (leading_button != back_.get()) {
+ back_->SetLeadingMargin(0);
}
+ }
+ if (vertical_tabs_collapse_button_.get() != leading_button) {
+ vertical_tabs_collapse_button_->SetLeadingMargin(0);
+ }
+
}
app_menu_button_->SetTrailingMargin(
- extend_buttons_to_edge ? interior_margin.right() : 0);
+ extend_buttons_to_edge && !collapse_button_on_trailing_edge
@@ -323,10 +324,10 @@
+ ? interior_margin.right()
+ : 0);
+ }
// Cast button visibility is controlled externally.
}
if (toolbar_divider_ && extensions_container_) {
views::ManualLayoutUtil(layout_manager_)
@@ -1804,6 +1905,19 @@ void ToolbarView::UpdateToolbarLayout()
@@ -1829,6 +1928,19 @@ void ToolbarView::UpdateToolbarLayout()
.WithOrder(order);
};
@@ -346,7 +347,7 @@
if (location_bar_view_) {
location_bar_view_->SetProperty(views::kFlexBehaviorKey,
location_bar_flex_rule);
@@ -1848,6 +1962,67 @@ bool ToolbarView::IsCompactLayout() cons
@@ -1873,6 +1985,67 @@ bool ToolbarView::IsCompactLayout() cons
return controller && controller->IsCompactLayout();
}
@@ -437,12 +438,14 @@
// AppMenuIconController::Delegate:
void UpdateTypeAndSeverity(
@@ -360,9 +367,12 @@ class ToolbarView : public views::Access
@@ -360,11 +367,14 @@ class ToolbarView : public views::Access
void OnTouchUiChanged();
void NewTabButtonPressed(const ui::Event& event);
+ void VerticalTabsCollapseButtonPressed(const ui::Event& event);
void InitGlicContainer();
void OnVerticalTabStripModeChanged(
tabs::VerticalTabStripStateController* controller);
+ void OnVerticalTabStripCollapseChanged(
@@ -450,7 +453,7 @@
void SetForwardButtonVisibility(bool visible);
@@ -400,6 +410,7 @@ class ToolbarView : public views::Access
@@ -402,6 +412,7 @@ class ToolbarView : public views::Access
// Controls. Most of these can be null, e.g. in popup windows. Only
// |location_bar_| is guaranteed to exist. These pointers are owned by the
// view hierarchy.
@@ -458,7 +461,7 @@
raw_ptr<ToolbarButton> back_ = nullptr;
raw_ptr<ToolbarButton> forward_ = nullptr;
raw_ptr<ReloadButton> reload_ = nullptr;
@@ -423,6 +434,7 @@ class ToolbarView : public views::Access
@@ -425,6 +436,7 @@ class ToolbarView : public views::Access
// `toolbar_webview_->GetPinnedActionsContainer()`.
raw_ptr<PinnedToolbarActions> pinned_toolbar_actions_ = nullptr;
raw_ptr<AvatarToolbarButton> avatar_ = nullptr;
@@ -466,7 +469,7 @@
raw_ptr<MediaToolbarButtonView> media_button_ = nullptr;
raw_ptr<BrowserAppMenuButton> app_menu_button_ = nullptr;
raw_ptr<views::View> new_tab_button_ = nullptr;
@@ -465,6 +477,10 @@ class ToolbarView : public views::Access
@@ -467,6 +479,10 @@ class ToolbarView : public views::Access
BooleanPrefMember show_reload_button_;
@@ -477,7 +480,7 @@
BooleanPrefMember show_avatar_button_;
BooleanPrefMember show_extensions_button_;
@@ -495,8 +511,8 @@ class ToolbarView : public views::Access
@@ -497,8 +513,8 @@ class ToolbarView : public views::Access
// `toolbar_controller_`.
raw_ptr<OverflowButton> overflow_button_ = nullptr;
@@ -80,7 +80,7 @@
// Gets the display mode for a given browser.
ToolbarView::DisplayMode GetDisplayMode(Browser* browser) {
// Checked in this order because even tabbed PWAs use the CUSTOM_TAB
@@ -744,10 +750,15 @@ void ToolbarView::Init() {
@@ -748,10 +754,15 @@ void ToolbarView::Init() {
InitLayout();
@@ -96,7 +96,7 @@
}
}
@@ -1614,21 +1625,6 @@ views::View* ToolbarView::GetDefaultFocu
@@ -1651,21 +1662,6 @@ views::View* ToolbarView::GetDefaultFocu
void ToolbarView::InitLayout() {
const int default_margin =
GetLayoutConstant(LayoutConstant::kToolbarIconDefaultMargin);
@@ -118,7 +118,7 @@
layout_manager_ =
SetLayoutManager(std::make_unique<CenteredLocationBarLayout>(
@@ -1641,16 +1637,7 @@ void ToolbarView::InitLayout() {
@@ -1678,16 +1674,7 @@ void ToolbarView::InitLayout() {
.SetCollapseMargins(true)
.SetDefault(views::kMarginsKey, gfx::Insets::VH(0, default_margin));
@@ -136,7 +136,7 @@
if (extensions_container_) {
const views::FlexSpecification extensions_flex_rule =
@@ -1696,9 +1683,7 @@ void ToolbarView::LayoutCommon() {
@@ -1726,9 +1713,7 @@ void ToolbarView::LayoutCommon() {
DCHECK(display_mode_ == DisplayMode::kNormal);
gfx::Insets interior_margin =
@@ -147,7 +147,7 @@
if (!browser_view_->webui_tab_strip()) {
if (app_menu_button_->IsLabelPresentAndVisible()) {
@@ -1750,6 +1735,74 @@ void ToolbarView::LayoutCommon() {
@@ -1775,6 +1760,74 @@ void ToolbarView::LayoutCommon() {
// Cast button visibility is controlled externally.
}
+11 -11
View File
@@ -996,7 +996,7 @@
--- a/chrome/browser/ui/views/frame/browser_view.h
+++ b/chrome/browser/ui/views/frame/browser_view.h
@@ -354,6 +354,9 @@ class BrowserView : public BrowserWindow
@@ -356,6 +356,9 @@ class BrowserView : public BrowserWindow
// Returns whether a vertical tabstrip should be shown.
bool ShouldDrawVerticalTabStrip() const;
@@ -1006,7 +1006,7 @@
// Returns whether the webapp frame toolbar should be drawn.
bool ShouldDrawWebAppFrameToolbar() const;
@@ -1313,10 +1316,6 @@ class BrowserView : public BrowserWindow
@@ -1320,10 +1323,6 @@ class BrowserView : public BrowserWindow
// The view responsible for housing the contents of the vertical tab strip.
raw_ptr<VerticalTabStripRegionView> vertical_tab_strip_region_view_ = nullptr;
@@ -1030,7 +1030,7 @@
raw_ptr<InfoBarContainerView> infobar_container = nullptr;
--- a/chrome/browser/ui/views/frame/browser_view.cc
+++ b/chrome/browser/ui/views/frame/browser_view.cc
@@ -107,6 +107,7 @@
@@ -112,6 +112,7 @@
#include "chrome/browser/ui/sharing_hub/sharing_hub_bubble_view.h"
#include "chrome/browser/ui/side_panel/side_panel_registry.h"
#include "chrome/browser/ui/side_panel/side_panel_ui.h"
@@ -1038,7 +1038,7 @@
#include "chrome/browser/ui/tabs/alert/tab_alert_controller.h"
#include "chrome/browser/ui/tabs/features.h"
#include "chrome/browser/ui/tabs/projects/projects_panel_state_controller.h"
@@ -148,7 +149,6 @@
@@ -154,7 +155,6 @@
#include "chrome/browser/ui/views/frame/contents_container_view.h"
#include "chrome/browser/ui/views/frame/contents_layout_manager.h"
#include "chrome/browser/ui/views/frame/contents_separator.h"
@@ -1046,7 +1046,7 @@
#include "chrome/browser/ui/views/frame/horizontal_tab_strip_region_view.h"
#include "chrome/browser/ui/views/frame/layout/browser_view_layout.h"
#include "chrome/browser/ui/views/frame/layout/browser_view_layout_delegate_impl.h"
@@ -1083,25 +1083,6 @@ BrowserView::BrowserView(Browser* browse
@@ -1089,25 +1089,6 @@ BrowserView::BrowserView(Browser* browse
vertical_tab_strip_region_view_ =
AddChildView(std::move(vertical_tab_strip_container));
@@ -1072,7 +1072,7 @@
} else {
horizontal_tab_strip_region_view_->InitializeTabStrip();
}
@@ -1224,8 +1205,6 @@ BrowserView::~BrowserView() {
@@ -1244,8 +1225,6 @@ BrowserView::~BrowserView() {
window_scrim_view_ = nullptr;
contents_container_ = nullptr;
vertical_tab_strip_region_view_ = nullptr;
@@ -1081,7 +1081,7 @@
projects_panel_container_ = nullptr;
toolbar_height_side_panel_ = nullptr;
contents_height_side_panel_ = nullptr;
@@ -1500,6 +1479,11 @@ bool BrowserView::ShouldDrawVerticalTabS
@@ -1520,6 +1499,11 @@ bool BrowserView::ShouldDrawVerticalTabS
controller->ShouldDisplayVerticalTabs() && browser_->is_type_normal();
}
@@ -1093,7 +1093,7 @@
bool BrowserView::ShouldDrawWebAppFrameToolbar() const {
return !IsUnframedModeEnabled() &&
GetFrameView()->ShouldShowWebAppFrameToolbar();
@@ -1627,7 +1611,20 @@ void BrowserView::OnVerticalTabStripMode
@@ -1647,7 +1631,20 @@ void BrowserView::OnVerticalTabStripMode
std::move(selection_state));
}
@@ -1115,7 +1115,7 @@
horizontal_tab_strip_region_view_->ResetTabStrip();
vertical_tab_strip_region_view_->InitializeTabStrip();
} else {
@@ -4482,13 +4479,23 @@ void BrowserView::CreateTabSearchBubble(
@@ -4521,13 +4518,23 @@ void BrowserView::CreateTabSearchBubble(
}
#endif // BUILDFLAG(ENABLE_WEBUI_TAB_STRIP)
@@ -1141,7 +1141,7 @@
tab_search_host->CloseTabSearchBubble();
}
}
@@ -4528,34 +4535,44 @@ void BrowserView::UpdateTabSearchBubbleH
@@ -4567,34 +4574,44 @@ void BrowserView::UpdateTabSearchBubbleH
return;
}
@@ -1206,7 +1206,7 @@
}
}
@@ -5316,9 +5333,6 @@ void BrowserView::AddedToWidget() {
@@ -5355,9 +5372,6 @@ void BrowserView::AddedToWidget() {
layout_views.horizontal_tab_strip_region_view =
horizontal_tab_strip_region_view_;
layout_views.vertical_tab_strip_region_view = vertical_tab_strip_region_view_;
+24 -26
View File
@@ -85,7 +85,7 @@
// layout loop.
--- a/chrome/browser/ui/views/frame/browser_view.cc
+++ b/chrome/browser/ui/views/frame/browser_view.cc
@@ -2373,6 +2373,7 @@ void BrowserView::FullscreenStateChanged
@@ -2374,6 +2374,7 @@ void BrowserView::FullscreenStateChanged
#endif // BUILDFLAG(IS_MAC)
browser_->WindowFullscreenStateChanged();
@@ -116,7 +116,7 @@
void ShowCaptureContentsBorder();
void HideCaptureContentsBorder();
@@ -158,6 +159,8 @@ class ContentsContainerView : public vie
@@ -157,6 +158,8 @@ class ContentsContainerView : public vie
const views::SizeBounds& size_bounds) const override;
bool is_in_split_ = false;
@@ -163,7 +163,7 @@
auto devtools_web_view =
std::make_unique<views::WebView>(browser_view->GetProfile());
@@ -184,9 +184,16 @@ std::vector<views::View*> ContentsContai
@@ -187,9 +187,16 @@ std::vector<views::View*> ContentsContai
void ContentsContainerView::UpdateBorderAndOverlay(bool is_in_split,
bool is_active,
@@ -181,7 +181,7 @@
if (!is_in_split) {
if (split_changed) {
@@ -204,6 +211,8 @@ void ContentsContainerView::UpdateBorder
@@ -205,6 +212,8 @@ void ContentsContainerView::UpdateBorder
if (split_changed) {
SetBorder(views::CreateEmptyBorder(gfx::Insets(
kSplitViewContentPadding + ContentsContainerOutline::kThickness)));
@@ -190,19 +190,17 @@
UpdateBorderRoundedCorners();
}
@@ -225,10 +234,40 @@ void ContentsContainerView::UpdateBorder
@@ -224,10 +233,38 @@ void ContentsContainerView::UpdateBorder
}
void ContentsContainerView::UpdateBorderRoundedCorners() {
+ const int frame_radius = GetPaddedFrameRadius();
+ const int generic_radius = GetGenericFrameRadius();
+
+ const int lower_left_radius = round_bottom_left_window_corner_
+ ? frame_radius
+ : generic_radius;
+ const int lower_right_radius = round_bottom_right_window_corner_
+ ? frame_radius
+ : generic_radius;
+ const int lower_left_radius =
+ round_bottom_left_window_corner_ ? frame_radius : generic_radius;
+ const int lower_right_radius =
+ round_bottom_right_window_corner_ ? frame_radius : generic_radius;
+
+ const gfx::RoundedCornersF container_rounded_corners(
+ generic_radius, generic_radius, lower_right_radius, lower_left_radius);
@@ -233,7 +231,7 @@
const bool devtools_in_upper_left =
devtools_web_view_->GetVisible() &&
@@ -246,18 +285,21 @@ void ContentsContainerView::UpdateBorder
@@ -245,18 +282,21 @@ void ContentsContainerView::UpdateBorder
current_devtools_docked_placement_ == DevToolsDockedPlacement::kRight);
const gfx::RoundedCornersF content_upper_rounded_corners =
@@ -265,7 +263,7 @@
auto radii = new_tab_footer_view_ && new_tab_footer_view_->GetVisible()
? content_upper_rounded_corners
@@ -265,7 +307,7 @@ void ContentsContainerView::UpdateBorder
@@ -264,7 +304,7 @@ void ContentsContainerView::UpdateBorder
contents_view_->SetBackgroundRadii(radii);
contents_view_->holder()->SetCornerRadii(radii);
@@ -410,36 +408,36 @@
#include "ui/views/view.h"
#include "ui/views/view_observer.h"
@@ -24,6 +25,7 @@ class ContentsCaptureBorderView : public
@@ -26,6 +27,7 @@ class ContentsCaptureBorderView : public
static constexpr int kContentsBorderThickness = 5;
void SetIsInSplit(bool is_in_split);
+ void SetCornerRadii(const gfx::RoundedCornersF& radii);
// views::View:
void OnPaint(gfx::Canvas* canvas) override;
@@ -37,6 +39,7 @@ class ContentsCaptureBorderView : public
void SetCaptureContentsBorderLocation(std::optional<gfx::Rect> location);
@@ -45,6 +47,7 @@ class ContentsCaptureBorderView : public
void OnViewIsDeleting(views::View* observed_view) override;
bool is_in_split_ = false;
+ gfx::RoundedCornersF corner_radii_;
std::optional<gfx::Rect> capture_location_;
raw_ptr<BrowserView> browser_view_ = nullptr;
base::ScopedObservation<views::View, views::ViewObserver>
view_bounds_observer_{this};
};
--- a/chrome/browser/ui/views/frame/contents_capture_border_view.cc
+++ b/chrome/browser/ui/views/frame/contents_capture_border_view.cc
@@ -14,7 +14,8 @@
@@ -19,7 +19,8 @@
#include "ui/views/view_class_properties.h"
ContentsCaptureBorderView::ContentsCaptureBorderView(
- views::View* /*mini_toolbar*/) {
+ views::View* /*mini_toolbar*/)
+ : corner_radii_(ContentsContainerOutline::kCornerRadius) {
SetProperty(views::kElementIdentifierKey, kContentsCaptureBorder);
SetBorder(views::CreateSolidBorder(kContentsBorderThickness,
kColorCapturedTabContentsBorder));
@@ -36,6 +37,15 @@ void ContentsCaptureBorderView::SetIsInS
}
SetPaintToLayer();
layer()->SetFillsBoundsOpaquely(false);
layer()->SetOpacity(0.50f);
@@ -58,6 +59,15 @@ void ContentsCaptureBorderView::SetCaptu
InvalidateLayout();
}
+void ContentsCaptureBorderView::SetCornerRadii(
@@ -454,7 +452,7 @@
void ContentsCaptureBorderView::OnViewBoundsChanged(
views::View* observed_view) {
SchedulePaint();
@@ -69,11 +79,15 @@ void ContentsCaptureBorderView::OnPaint(
@@ -91,11 +101,15 @@ void ContentsCaptureBorderView::OnPaint(
gfx::RectF local_bounds(GetLocalBounds());
const float half_thickness = kContentsBorderThickness / 2.0f;
local_bounds.Inset(half_thickness);
+1 -1
View File
@@ -258,7 +258,7 @@
// smaller than this bounds; they'll be centered within the bounds.
--- a/chrome/browser/ui/views/omnibox/omnibox_popup_view_views.cc
+++ b/chrome/browser/ui/views/omnibox/omnibox_popup_view_views.cc
@@ -694,14 +694,7 @@ gfx::Rect OmniboxPopupViewViews::GetTarg
@@ -725,14 +725,7 @@ gfx::Rect OmniboxPopupViewViews::GetTarg
// added if the results section has no height (result set is empty or all
// results are hidden). See https://crbug.com/1076646 for additional context.
if (popup_height != 0) {
@@ -1,6 +1,6 @@
--- a/chrome/browser/ui/views/frame/browser_view.cc
+++ b/chrome/browser/ui/views/frame/browser_view.cc
@@ -156,7 +156,6 @@
@@ -157,7 +157,6 @@
#include "chrome/browser/ui/views/frame/multi_contents_view.h"
#include "chrome/browser/ui/views/frame/multi_contents_view_delegate.h"
#include "chrome/browser/ui/views/frame/multi_contents_view_drop_target_controller.h"
@@ -8,7 +8,7 @@
#include "chrome/browser/ui/views/frame/scrim_view.h"
#include "chrome/browser/ui/views/frame/shadow_overlay_view.h"
#include "chrome/browser/ui/views/frame/tab_modal_dialog_host.h"
@@ -2460,10 +2459,6 @@ void BrowserView::UpdateToolbar(content:
@@ -2461,10 +2460,6 @@ void BrowserView::UpdateToolbar(content:
if (toolbar_) {
toolbar_->Update(contents);
}
@@ -21,8 +21,8 @@
bool BrowserView::UpdateToolbarSecurityState() {
--- a/chrome/browser/ui/views/frame/contents_container_view.h
+++ b/chrome/browser/ui/views/frame/contents_container_view.h
@@ -19,7 +19,6 @@
class BrowserView;
@@ -20,7 +20,6 @@ class BrowserView;
class ContentsCaptureBorderView;
class ContentsContainerOutline;
class ContentsWebView;
-class MultiContentsViewMiniToolbar;
@@ -37,7 +37,7 @@
ScrimView* contents_scrim_view() { return contents_scrim_view_; }
views::WebView* devtools_web_view() { return devtools_web_view_; }
ScrimView* devtools_scrim_view() { return devtools_scrim_view_; }
@@ -206,8 +204,6 @@ class ContentsContainerView : public vie
@@ -205,8 +203,6 @@ class ContentsContainerView : public vie
// The glic browser view that renders around the web contents area.
raw_ptr<glic::ContextSharingBorderView> glic_border_ = nullptr;
@@ -45,7 +45,7 @@
-
raw_ptr<ContentsContainerOutline> container_outline_ = nullptr;
std::unique_ptr<views::Widget> capture_contents_border_widget_;
raw_ptr<ContentsCaptureBorderView> capture_contents_border_view_ = nullptr;
--- a/chrome/browser/ui/views/frame/contents_container_view.cc
+++ b/chrome/browser/ui/views/frame/contents_container_view.cc
@@ -25,7 +25,6 @@
@@ -56,7 +56,7 @@
#include "chrome/browser/ui/views/frame/scrim_view.h"
#include "chrome/browser/ui/views/frame/tab_modal_dialog_host.h"
#include "chrome/browser/ui/views/frame/top_container_view.h"
@@ -153,11 +152,8 @@ ContentsContainerView::ContentsContainer
@@ -153,14 +152,11 @@ ContentsContainerView::ContentsContainer
.Build());
}
@@ -67,36 +67,31 @@
- AddChildView(std::make_unique<ContentsContainerOutline>(mini_toolbar_));
+ AddChildView(std::make_unique<ContentsContainerOutline>(nullptr));
capture_contents_border_view_ =
- AddChildView(std::make_unique<ContentsCaptureBorderView>(mini_toolbar_));
+ AddChildView(std::make_unique<ContentsCaptureBorderView>(nullptr));
view_bounds_observer_.Observe(contents_view_);
}
@@ -197,7 +193,6 @@ void ContentsContainerView::UpdateBorder
@@ -200,7 +196,6 @@ void ContentsContainerView::UpdateBorder
SetBorder(nullptr);
ClearBorderRoundedCorners();
- mini_toolbar_->SetVisible(false);
container_outline_->SetVisible(false);
if (capture_contents_border_widget_) {
static_cast<ContentsCaptureBorderView*>(
@@ -213,9 +208,6 @@ void ContentsContainerView::UpdateBorder
if (capture_contents_border_view_) {
capture_contents_border_view_->SetIsInSplit(false);
@@ -214,9 +209,6 @@ void ContentsContainerView::UpdateBorder
}
container_outline_->UpdateState(is_active, is_highlighted);
- // Mini toolbar should only be visible for the inactive contents
- // container view or both depending on configuration.
- mini_toolbar_->UpdateState(is_active, is_highlighted);
if (capture_contents_border_widget_) {
static_cast<ContentsCaptureBorderView*>(
capture_contents_border_widget_->GetContentsView())
@@ -478,7 +470,7 @@ void ContentsContainerView::CreateCaptur
capture_contents_border_widget_->Init(std::move(params));
auto contents_capture_border_view =
- std::make_unique<ContentsCaptureBorderView>(mini_toolbar_);
+ std::make_unique<ContentsCaptureBorderView>(nullptr);
capture_contents_border_widget_->SetContentsView(
std::move(contents_capture_border_view));
capture_contents_border_widget_->SetVisibilityChangedAnimationsEnabled(false);
@@ -681,24 +673,6 @@ views::ProposedLayout ContentsContainerV
if (capture_contents_border_view_) {
capture_contents_border_view_->SetIsInSplit(true);
}
@@ -608,24 +600,6 @@ views::ProposedLayout ContentsContainerV
non_devtools_contents_bounds, size_bounds);
}
@@ -345,7 +340,7 @@
BEGIN_METADATA(ContentsContainerOutline)
--- a/chrome/browser/ui/views/frame/contents_capture_border_view.h
+++ b/chrome/browser/ui/views/frame/contents_capture_border_view.h
@@ -15,7 +15,7 @@ class ContentsCaptureBorderView : public
@@ -17,7 +17,7 @@ class ContentsCaptureBorderView : public
public views::ViewObserver {
METADATA_HEADER(ContentsCaptureBorderView, views::View)
public:
@@ -354,17 +349,17 @@
ContentsCaptureBorderView(const ContentsCaptureBorderView&) = delete;
ContentsCaptureBorderView& operator=(const ContentsCaptureBorderView&) =
delete;
@@ -37,7 +37,6 @@ class ContentsCaptureBorderView : public
void OnViewIsDeleting(views::View* observed_view) override;
@@ -47,7 +47,6 @@ class ContentsCaptureBorderView : public
bool is_in_split_ = false;
std::optional<gfx::Rect> capture_location_;
raw_ptr<BrowserView> browser_view_ = nullptr;
- raw_ptr<views::View> mini_toolbar_ = nullptr;
base::ScopedObservation<views::View, views::ViewObserver>
view_bounds_observer_{this};
};
--- a/chrome/browser/ui/views/frame/contents_capture_border_view.cc
+++ b/chrome/browser/ui/views/frame/contents_capture_border_view.cc
@@ -13,15 +13,11 @@
@@ -18,8 +18,8 @@
#include "ui/views/border.h"
#include "ui/views/view_class_properties.h"
@@ -372,6 +367,10 @@
- : mini_toolbar_(mini_toolbar) {
+ContentsCaptureBorderView::ContentsCaptureBorderView(
+ views::View* /*mini_toolbar*/) {
SetPaintToLayer();
layer()->SetFillsBoundsOpaquely(false);
layer()->SetOpacity(0.50f);
@@ -31,10 +31,6 @@ ContentsCaptureBorderView::ContentsCaptu
SetProperty(views::kElementIdentifierKey, kContentsCaptureBorder);
SetBorder(views::CreateSolidBorder(kContentsBorderThickness,
kColorCapturedTabContentsBorder));
@@ -382,7 +381,7 @@
}
ContentsCaptureBorderView::~ContentsCaptureBorderView() = default;
@@ -54,7 +50,6 @@ void ContentsCaptureBorderView::OnViewVi
@@ -76,7 +72,6 @@ void ContentsCaptureBorderView::OnViewVi
void ContentsCaptureBorderView::OnViewIsDeleting(views::View* observed_view) {
view_bounds_observer_.Reset();
@@ -390,7 +389,7 @@
}
void ContentsCaptureBorderView::OnPaint(gfx::Canvas* canvas) {
@@ -77,15 +72,8 @@ void ContentsCaptureBorderView::OnPaint(
@@ -99,15 +94,8 @@ void ContentsCaptureBorderView::OnPaint(
const float corner_radius =
ContentsContainerOutline::kCornerRadius - half_thickness;
@@ -0,0 +1,64 @@
--- a/chrome/browser/ui/views/toolbar/toolbar_view.cc
+++ b/chrome/browser/ui/views/toolbar/toolbar_view.cc
@@ -390,14 +390,11 @@ void ToolbarView::Init() {
PrefService* const prefs = browser_->profile()->GetPrefs();
std::unique_ptr<ExtensionsToolbarDesktop> extensions_container;
- std::unique_ptr<ToolbarDivider> toolbar_divider;
// Do not create the extensions or browser actions container if it is a guest
// profile (only regular and incognito profiles host extensions).
if (!browser_->profile()->IsGuestSession()) {
extensions_container = std::make_unique<ExtensionsToolbarDesktop>(browser_);
-
- toolbar_divider = std::make_unique<ToolbarDivider>();
}
std::unique_ptr<MediaToolbarButtonView> media_button;
@@ -484,10 +481,6 @@ void ToolbarView::Init() {
extensions_container_);
}
- if (toolbar_divider) {
- toolbar_divider_ = AddChildView(std::move(toolbar_divider));
- }
-
if (!features::IsWebUIPinnedToolbarActionsEnabled()) {
pinned_toolbar_actions_container_ = AddChildView(
std::make_unique<PinnedToolbarActionsContainer>(browser_view_, this));
@@ -1599,13 +1592,6 @@ void ToolbarView::InitLayout() {
.WithOrder(kToolbarActionsFlexOrder));
}
- if (toolbar_divider_) {
- toolbar_divider_->SetProperty(
- views::kMarginsKey,
- gfx::Insets::VH(
- 0, GetLayoutConstant(LayoutConstant::kToolbarDividerSpacing)));
- }
-
constexpr int kToolbarFlexOrderStart = 1;
// TODO(crbug.com/40929989): Ignore containers till issue addressed.
@@ -1669,11 +1655,6 @@ void ToolbarView::LayoutCommon() {
}
app_menu_button_->SetTrailingMargin(
extend_buttons_to_edge ? interior_margin.right() : 0);
-
- if (toolbar_divider_ && extensions_container_) {
- views::ManualLayoutUtil(layout_manager_)
- .SetViewHidden(toolbar_divider_, !extensions_container_->GetVisible());
- }
// Cast button visibility is controlled externally.
}
--- a/chrome/browser/ui/views/toolbar/pinned_toolbar_actions_container.cc
+++ b/chrome/browser/ui/views/toolbar/pinned_toolbar_actions_container.cc
@@ -167,6 +167,7 @@ PinnedToolbarActionsContainer::PinnedToo
GetLayoutConstant(LayoutConstant::kToolbarIconDefaultMargin),
0, GetLayoutConstant(LayoutConstant::kToolbarDividerSpacing)));
toolbar_divider_ = AddChildView(std::move(toolbar_divider));
+ toolbar_divider_->SetVisible(false);
// Initialize the pinned action buttons.
action_view_controller_ = std::make_unique<views::ActionViewController>();
+28 -34
View File
@@ -36,7 +36,7 @@
</message>
--- a/chrome/browser/ui/webui/settings/settings_localized_strings_provider.cc
+++ b/chrome/browser/ui/webui/settings/settings_localized_strings_provider.cc
@@ -517,6 +517,7 @@ void AddAppearanceStrings(content::WebUI
@@ -518,6 +518,7 @@ void AddAppearanceStrings(content::WebUI
{"systemMode", IDS_NTP_CUSTOMIZE_CHROME_COLOR_SCHEME_MODE_SYSTEM_LABEL},
{"openNewTabNextToActive", IDS_SETTINGS_NEW_TAB_NEXT_TO_ACTIVE_BUTTON},
{"cycleTabsInMRUOrder", IDS_SETTINGS_CYCLE_TABS_IN_MRU_ORDER},
@@ -80,7 +80,7 @@
bool is_active,
bool is_highlighted,
bool round_bottom_left_window_corner,
@@ -159,6 +160,7 @@ class ContentsContainerView : public vie
@@ -158,6 +159,7 @@ class ContentsContainerView : public vie
const views::SizeBounds& size_bounds) const override;
bool is_in_split_ = false;
@@ -90,7 +90,7 @@
--- a/chrome/browser/ui/views/frame/contents_container_view.cc
+++ b/chrome/browser/ui/views/frame/contents_container_view.cc
@@ -183,20 +183,24 @@ std::vector<views::View*> ContentsContai
@@ -186,20 +186,24 @@ std::vector<views::View*> ContentsContai
}
void ContentsContainerView::UpdateBorderAndOverlay(bool is_in_split,
@@ -117,7 +117,7 @@
SetBorder(nullptr);
ClearBorderRoundedCorners();
@@ -208,15 +212,27 @@ void ContentsContainerView::UpdateBorder
@@ -209,22 +213,33 @@ void ContentsContainerView::UpdateBorder
}
}
} else {
@@ -146,11 +146,9 @@
+ } else {
+ container_outline_->SetVisible(false);
+ }
+
if (capture_contents_border_widget_) {
static_cast<ContentsCaptureBorderView*>(
capture_contents_border_widget_->GetContentsView())
@@ -225,7 +241,7 @@ void ContentsContainerView::UpdateBorder
if (capture_contents_border_view_) {
capture_contents_border_view_->SetIsInSplit(true);
}
}
#if BUILDFLAG(IS_CHROMEOS)
@@ -159,23 +157,35 @@
// Ensures correct window rounded corners after updating contents rounded
// corners in UpdateBorderRoundedCorners()/ClearBorderRoundedCorners().
GetWidget()->non_client_view()->frame_view()->UpdateWindowRoundedCorners();
@@ -247,11 +263,12 @@ void ContentsContainerView::UpdateBorder
@@ -244,21 +259,18 @@ void ContentsContainerView::UpdateBorder
const gfx::RoundedCornersF container_rounded_corners(
generic_radius, generic_radius, lower_right_radius, lower_left_radius);
- const float inner_generic_radius = generic_radius - kSplitViewContentPadding;
- const float inner_lower_left_radius =
- lower_left_radius - kSplitViewContentPadding;
- const float inner_lower_right_radius =
- lower_right_radius - kSplitViewContentPadding;
+ const int inner_padding = is_in_split_ ? kSplitViewContentPadding : 0;
+ const float inner_generic_radius = generic_radius - inner_padding;
const float inner_lower_left_radius =
- lower_left_radius - kSplitViewContentPadding;
+ lower_left_radius - inner_padding;
const float inner_lower_right_radius =
- lower_right_radius - kSplitViewContentPadding;
+ lower_right_radius - inner_padding;
+ const float inner_lower_left_radius = lower_left_radius - inner_padding;
+ const float inner_lower_right_radius = lower_right_radius - inner_padding;
const gfx::RoundedCornersF inner_rounded_corners(
inner_generic_radius, inner_generic_radius,
@@ -369,7 +386,7 @@ void ContentsContainerView::ClearBorderR
inner_lower_right_radius, inner_lower_left_radius);
container_outline_->SetCornerRadii(container_rounded_corners);
- if (capture_contents_border_widget_) {
- static_cast<ContentsCaptureBorderView*>(
- capture_contents_border_widget_->GetContentsView())
- ->SetCornerRadii(container_rounded_corners);
+ if (capture_contents_border_view_) {
+ capture_contents_border_view_->SetCornerRadii(container_rounded_corners);
}
// Update devtools rounded corners. Note, devtools exists behind the contents
@@ -366,7 +378,7 @@ void ContentsContainerView::ClearBorderR
void ContentsContainerView::ChildVisibilityChanged(View* child) {
if ((child == new_tab_footer_view_ || child == devtools_web_view_) &&
@@ -184,7 +194,7 @@
UpdateBorderRoundedCorners();
}
}
@@ -387,7 +404,7 @@ void ContentsContainerView::Layout(PassK
@@ -391,7 +403,7 @@ views::View::Views ContentsContainerView
void ContentsContainerView::OnViewBoundsChanged(View* observed_view) {
if (observed_view == contents_view_) {
UpdateDevToolsDockedPlacement();
@@ -193,22 +203,6 @@
UpdateBorderRoundedCorners();
}
}
@@ -513,10 +530,15 @@ void ContentsContainerView::CreateCaptur
capture_contents_border_widget_->Init(std::move(params));
auto contents_capture_border_view =
std::make_unique<ContentsCaptureBorderView>(nullptr);
+ auto* contents_capture_border_view_ptr = contents_capture_border_view.get();
capture_contents_border_widget_->SetContentsView(
std::move(contents_capture_border_view));
capture_contents_border_widget_->SetVisibilityChangedAnimationsEnabled(false);
capture_contents_border_widget_->SetOpacity(0.50f);
+ contents_capture_border_view_ptr->SetIsInSplit(should_round_contents_);
+ if (should_round_contents_) {
+ UpdateBorderRoundedCorners();
+ }
}
void ContentsContainerView::UpdateCaptureContentsBorderLocation() {
--- a/chrome/browser/ui/views/frame/multi_contents_view.h
+++ b/chrome/browser/ui/views/frame/multi_contents_view.h
@@ -169,6 +169,7 @@ class MultiContentsView
@@ -1,6 +1,6 @@
--- a/chrome/app/generated_resources.grd
+++ b/chrome/app/generated_resources.grd
@@ -7883,6 +7883,9 @@ Keep your key file in a safe place. You
@@ -7973,6 +7973,9 @@ Keep your key file in a safe place. You
<message name="IDS_NTP_CUSTOMIZE_CHROME_CHANGE_THEME_LABEL" desc="The label for the action button for changing Chrome theme in the New Tab Page customize chrome side panel.">
Change theme
</message>
+6 -6
View File
@@ -172,7 +172,7 @@
#include "chrome/browser/ui/intent_picker_tab_helper.h"
#include "chrome/browser/ui/layout_constants.h"
#include "chrome/browser/ui/omnibox/omnibox_view.h"
@@ -554,8 +555,7 @@ void ToolbarView::Init() {
@@ -544,8 +545,7 @@ void ToolbarView::Init() {
#else
// DevTools profiles are OffTheRecord, so hide it there.
show_avatar_toolbar_button = browser_->profile()->IsIncognitoProfile() ||
@@ -182,8 +182,8 @@
#endif
const std::string sab_value = base::CommandLine::ForCurrentProcess()->
@@ -630,6 +630,57 @@ void ToolbarView::Init() {
home_->SetVisible(show_home_button_.GetValue());
@@ -634,6 +634,57 @@ void ToolbarView::Init() {
UpdateGlicButtonVisibility();
}
+ show_back_button_.Init(
@@ -240,7 +240,7 @@
InitLayout();
for (auto* button : std::array<views::Button*, 5>{back_, forward_, reload_,
@@ -1859,6 +1910,35 @@ void ToolbarView::OnShowHomeButtonChange
@@ -1884,6 +1935,35 @@ void ToolbarView::OnShowHomeButtonChange
}
}
@@ -297,7 +297,7 @@
void OnTouchUiChanged();
void NewTabButtonPressed(const ui::Event& event);
@@ -433,6 +445,18 @@ class ToolbarView : public views::Access
@@ -435,6 +447,18 @@ class ToolbarView : public views::Access
// Controls whether or not a home button should be shown on the toolbar.
BooleanPrefMember show_home_button_;
@@ -573,7 +573,7 @@
// The container (and extensions-menu button) should not be visible if we have
--- a/chrome/app/generated_resources.grd
+++ b/chrome/app/generated_resources.grd
@@ -10797,6 +10797,9 @@ Keep your key file in a safe place. You
@@ -10887,6 +10887,9 @@ Keep your key file in a safe place. You
<message name="IDS_ACCNAME_FIND" desc="The accessible name for the find button.">
Find
</message>
@@ -1,6 +1,6 @@
--- a/chrome/browser/ui/views/frame/browser_view.cc
+++ b/chrome/browser/ui/views/frame/browser_view.cc
@@ -4928,6 +4928,18 @@ int BrowserView::NonClientHitTest(const
@@ -4944,6 +4944,18 @@ int BrowserView::NonClientHitTest(const
}
}
@@ -60,7 +60,7 @@
} // namespace
////////////////////////////////////////////////////////////////////////////////
@@ -1240,6 +1208,44 @@ bool ToolbarView::GetAppMenuFocused() co
@@ -1277,6 +1245,44 @@ bool ToolbarView::GetAppMenuFocused() co
return app_menu_button_ && app_menu_button_->HasFocus();
}
@@ -105,7 +105,7 @@
void ToolbarView::ShowIntentPickerBubble(
std::vector<IntentPickerBubbleView::AppInfo> app_info,
bool show_stay_in_chrome,
@@ -1276,11 +1282,6 @@ void ToolbarView::ShowBookmarkBubble(con
@@ -1313,11 +1319,6 @@ void ToolbarView::ShowBookmarkBubble(con
already_bookmarked);
}
@@ -87,7 +87,7 @@
};
--- a/chrome/app/generated_resources.grd
+++ b/chrome/app/generated_resources.grd
@@ -13749,6 +13749,9 @@ Check your passwords anytime in <ph name
@@ -13853,6 +13853,9 @@ Check your passwords anytime in <ph name
<message name="IDS_EXTENSIONS_INSTALL_LOCATION_SHARED_MODULE" desc="The text explaining the the installation of the extension was because of extensions that depend on this shared module">
Installed because of dependent extension(s).
</message>
+4
View File
@@ -188,6 +188,7 @@ helium/core/hibernate-tab-context-menu.patch
helium/core/disable-side-panel-flyover.patch
helium/core/custom-profile-avatar.patch
helium/core/close-tabs-to-left.patch
helium/core/custom-keyboard-shortcuts.patch
helium/settings/settings-page-icons.patch
helium/settings/move-search-suggest.patch
@@ -209,6 +210,7 @@ helium/settings/enable-quad9-doh-option.patch
helium/settings/reorder-settings-menu.patch
helium/settings/add-search-engine-button.patch
helium/settings/custom-profile-avatar-ui.patch
helium/settings/custom-keyboard-shortcuts-page.patch
helium/hop/setup.patch
helium/hop/disable-password-manager.patch
@@ -224,6 +226,7 @@ helium/ui/location-bar-page-action.patch
helium/ui/tabs.patch
helium/ui/tab-strip-controls.patch
helium/ui/toolbar.patch
helium/ui/remove-toolbar-dividers.patch
helium/ui/toolbar-window-frame-hit-test.patch
helium/ui/toolbar-button-prefs.patch
helium/ui/omnibox.patch
@@ -277,6 +280,7 @@ helium/ui/remove-autofill-link-to-password-manager.patch
helium/ui/fix-caption-button-bounds.patch
helium/ui/find-bar.patch
helium/ui/remove-zoom-action.patch
helium/ui/custom-keyboard-shortcuts-wiring.patch
helium/ui/layout/migrate-prefs.patch
helium/ui/layout/core.patch
@@ -1,6 +1,6 @@
--- a/chrome/browser/ui/views/frame/browser_view.cc
+++ b/chrome/browser/ui/views/frame/browser_view.cc
@@ -744,6 +744,9 @@ class BrowserView::ExclusiveAccessContex
@@ -745,6 +745,9 @@ class BrowserView::ExclusiveAccessContex
void UpdateExclusiveAccessBubble(
const ExclusiveAccessBubbleParams& params,
ExclusiveAccessBubbleHideCallback first_hide_callback) override {
@@ -1,6 +1,6 @@
--- a/chrome/browser/ui/views/toolbar/toolbar_view.cc
+++ b/chrome/browser/ui/views/toolbar/toolbar_view.cc
@@ -589,6 +589,17 @@ void ToolbarView::Init() {
@@ -586,6 +586,17 @@ void ToolbarView::Init() {
browser_->profile()->IsGuestSession() ||
browser_->profile()->IsRegularProfile();
#endif
@@ -1,6 +1,6 @@
--- a/chrome/browser/about_flags.cc
+++ b/chrome/browser/about_flags.cc
@@ -4654,10 +4654,12 @@ const FeatureEntry::FeatureVariation
@@ -4685,10 +4685,12 @@ const FeatureEntry::FeatureVariation
#include "chrome/browser/ungoogled_flag_choices.h"
#include "chrome/browser/bromite_flag_choices.h"
#include "chrome/browser/ungoogled_platform_flag_choices.h"
@@ -1,6 +1,6 @@
--- a/chrome/browser/about_flags.cc
+++ b/chrome/browser/about_flags.cc
@@ -4650,7 +4650,13 @@ const FeatureEntry::FeatureVariation
@@ -4681,7 +4681,13 @@ const FeatureEntry::FeatureVariation
// calculate and verify checksum.
//
// When adding a new choice, add it to the end of the list.
@@ -2277,7 +2277,7 @@
--- a/components/enterprise/browser/reporting/chrome_profile_request_generator.cc
+++ b/components/enterprise/browser/reporting/chrome_profile_request_generator.cc
@@ -311,18 +311,12 @@ void ChromeProfileRequestGenerator::OnAg
@@ -313,18 +313,12 @@ void ChromeProfileRequestGenerator::OnAg
profile_signals.built_in_dns_client_enabled);
profile_signals_report->set_chrome_remote_desktop_app_blocked(
profile_signals.chrome_remote_desktop_app_blocked);
@@ -40,7 +40,7 @@
# Disallow depending on content.
--- a/components/contextual_tasks/internal/BUILD.gn
+++ b/components/contextual_tasks/internal/BUILD.gn
@@ -50,6 +50,7 @@ source_set("internal") {
@@ -51,6 +51,7 @@ source_set("internal") {
"//components/sync/model",
"//components/url_formatter",
"//net",
+1 -1
View File
@@ -1 +1 @@
1
3