Compare commits

...

252 Commits

Author SHA1 Message Date
wukko c0b9568b65 revision: bump to 2 (#919) 2026-02-16 21:21:37 +00:00
wukko 941352d902 helium/ui/vertical: tab indicator reposition & minor fixes (#918) 2026-02-17 03:11:50 +06:00
wukko 4cf9165668 helium/ui/vertical: fix top & bottom gaps
fixes perceived bottom margin to new tab button & between top actions in collapsed state. now tabs, buttons, and new tab button have visually the same margin.
2026-02-17 03:07:53 +06:00
wukko 4963889d71 helium/ui/vertical/bottom: fix disabled state text color
previously the text color would change on window unfocus
2026-02-17 03:05:41 +06:00
wukko 01a6615e60 helium/ui/vertical/tab: show indicator before title
fixes jiggle on hover
2026-02-17 03:04:55 +06:00
wukko a6994c688e helium/ui/vertical: draw a rounded corner on top of contents (#912)
instead of rounding the contents which causes a hole on linux & windows
2026-02-16 23:36:28 +06:00
wukko 23908b348c helium/ui: remove all layout separators, not just the top one (#908) 2026-02-16 14:30:03 +00:00
jj 1a3f947eb8 utils/name-substitution: replace fake async with process pool (#909)
before: real 0m46.312s
after: real 0m14.080s
2026-02-16 13:02:46 +01:00
wukko 9aed4b3a85 helium/ui: disable ink ripple effect on all platforms & webui (#907) 2026-02-16 17:59:40 +06:00
wukko 024340269c update: helium 0.9.1 (#860)
chromium m145, vertical tabs and layout switching (#864),
other minor improvements

Co-authored-by: jj <log@riseup.net>
2026-02-15 18:01:57 +06:00
wukko b662c376d1 revision: reset to 1 2026-02-15 17:52:39 +06:00
wukko 13e5ba2196 helium/ui/layout/settings: use enum instead of magic numbers 2026-02-15 17:52:28 +06:00
wukko df2f950984 patches: refresh for chromium 145.0.7632.75 2026-02-15 17:29:39 +06:00
wukko 838688ad33 merge: update to ungoogled-chromium 145.0.7632.75 2026-02-15 17:23:04 +06:00
jj 3b6fd05352 utils/namesub: ignore known-useless directories (#886)
before: real 1m6.983s, user 1m6.178s sys 0m0.783s
after: real 0m46.058s, user 0m45.383s, sys 0m0.650s
2026-02-15 17:18:13 +06:00
wukko 5642bceece helium/ui: vertical tabs, layout switching, unflag compact layout (#864) 2026-02-15 17:14:42 +06:00
wukko 8d2c72bdda helium/ui: fix pwa toolbar height on macos 2026-02-15 16:56:33 +06:00
jj ef21369a09 upstream-fixes/vertical: remove test hunks from backports 2026-02-15 10:47:32 +00:00
jj 09de5cf3fd upstream-fixes/vertical: backport disabling split view for tab groups 2026-02-15 10:27:35 +00:00
wukko 35b5c49350 helium/ui/vertical: fix top container button padding
fixes unexpected 1px "border" around the button
2026-02-15 16:01:44 +06:00
wukko 7fc527c933 upstream-fixes/vertical: don't reset inexistent tab strip
prevents a crash when vertical collapse state changes
2026-02-15 14:55:43 +06:00
wukko 9e55d51f84 upstream-fixes/vertical: keep vertical drag alive across capture handoff 2026-02-15 14:55:13 +06:00
jj 378ebe1d22 patches/upstream-fixes: re-backport reland of lazily-load-tabstrip
also add r1573180, which lazily-load-tabstrips depends on
2026-02-14 21:38:36 +00:00
wukko 18fb49be09 helium/ui/layout: don't use magical numbers & refactor 2026-02-14 22:55:03 +06:00
wukko 02af40f670 helium/ui/layout: update vertical option to say "experimental"
not even beta yet imo
2026-02-14 04:38:49 +06:00
wukko 36ec10ebbc helium/ui: fix GetTabStripHeight() in browser view with vertical tabs
fixes window controls position on macos
2026-02-14 04:38:09 +06:00
wukko 13390812d1 upstream-fixes: backport & optimize more vertical tabs functionality
- patches were manually optimized for m145, lots of hours lost here.
- all tabs are now properly draggable and all crashes have been eliminated.
- previously backported patches were revised & renamed for consistency.
- all of this will go away with m146 (hopefully?).

Co-authored-by: dumbmoron <log@riseup.net>
2026-02-14 04:01:23 +06:00
Blaise 230b8485a4 Update to Chromium 145.0.7632.75 2026-02-13 15:05:44 -06:00
wukko 63caeac89d helium/ui/layout: rename traditional layout to "Classic"
sounds more classy
2026-02-12 00:25:26 +06:00
wukko bdffe08340 helium/ui/vertical: fix alignment of top buttons in collapsed state
also fix the top button insets & remove unused projects button
2026-02-12 00:15:46 +06:00
wukko 22a84c5105 helium/ui/vertical: round the leading top corner 2026-02-11 22:22:11 +06:00
wukko bdd66ca1c0 helium/ui/vertical: notify layout on exclusion width change
prevents stuck window controls gaps in fullscreen on macos
2026-02-11 17:26:47 +06:00
wukko 941e0a2ac1 helium/ui/vertical: don't push uncollapsed top container to second row 2026-02-11 17:24:53 +06:00
wukko dcfeb0daa9 helium/ui/vertical: tinted colors & smaller icon for new tab button 2026-02-11 17:07:04 +06:00
wukko d081925071 helium/ui/layout/compact: fix dangling tab strip pointer
it became dangling on parent destruction, which triggered a check & caused a crash on linux during window closure
2026-02-11 16:01:45 +06:00
wukko 8a9652acd5 upstream-fixes: backport a bunch of vertical tabs CLs
mostly stability improvements to prevent crashing
2026-02-11 02:11:49 +06:00
wukko 0440e3a923 helium/ui/layout: add ui layout options to main browser context menu 2026-02-09 21:57:37 +06:00
wukko cb05352645 helium/ui/layout: create a settings entry for managing browser layout 2026-02-09 21:57:37 +06:00
wukko bd375e6c4f helium/ui: unflag compact layout & create a layout state controller
Also replaced the helium-cat-fixed-address-bar flag with helium-compact-location-width.
The fixed width is more comfortable to use, so it's now default.
2026-02-09 21:57:37 +06:00
wukko 51ef564b48 helium/ui/location-bar: always hide the icon text
the text will only be shown on security (no ssl) warnings

moved from the compact layout patch
2026-02-09 21:57:32 +06:00
wukko da2d921f8f helium/ui/omnibox: increase min characters in main patch
moved from compact layout patch
2026-02-09 17:44:22 +06:00
wukko d868911b55 helium/ui: initial vertical tabs layout 2026-02-06 17:42:37 +06:00
wukko 6594e9f332 helium/ui: LayoutInset for full toolbar margin, rename compact UI patch 2026-02-06 17:38:06 +06:00
jj 80ad3fc0c6 helium/extstore-fixups: expect Google prefix for chrome (#863)
"Chrome" is translated as "Google Chrome" in some locales, so we need to
replace the whole thing with Helium if that happens
2026-02-06 10:26:35 +00:00
wukko 0776559aef patches: refresh for chromium 145.0.7632.45 2026-02-06 02:39:27 +06:00
wukko 0691459d2c merge: update to ungoogled-chromium 145.0.7632.45 2026-02-05 15:51:35 +06:00
Blaise ae9fe23a5f Update to Chromium 145.0.7632.45 2026-02-04 16:17:58 -06:00
jj aacb18d4fd revision: bump to 5 (#859) 2026-02-04 20:56:56 +01:00
wukko b6378d5d93 merge: update to chromium 144.0.7559.132 (#856) 2026-02-05 01:34:12 +06:00
jj 9377353176 cirrus: unpack deps even if not using tarball 2026-02-04 19:00:04 +00:00
wukko 695726d37a patches: refresh for 144.0.7559.132 2026-02-04 11:43:46 +06:00
wukko bb19cfa083 merge: update to ungoogled-chromium 144.0.7559.132 2026-02-04 10:59:31 +06:00
Blaise 7607c88d3f Update to Chromium 144.0.7559.132 2026-02-03 14:20:17 -06:00
jj af7ab99ba4 helium/onboarding: remove HasPrefPath() exception (#846)
this check was mostly intended to not break services access for
pre-onboarding users. onboarding was introduced a long time ago (way
before pre-0.0.1), so this is not a real concern anymore.

it was still possible to make ShouldAccessServices() return `true` by
toggling services.enabled off and on in onboarding; this change should
make it so that it's not possible anymore (meaning the user has to
navigate to the next step before services are truly enabled).
2026-02-02 12:07:29 +06:00
wukko 298971df7f helium/core/onboarding-page: bump grd id allocation (#845) 2026-02-01 17:56:49 +01:00
jj ead83f7e78 merge: introduce onboarding get/install extension APIs (#842)
type EnablementMap = Record<ExtensionId, boolean>
Event `extension-state-changed` -> EnablementMap
and method `getExtensions()` -> Promise<EnablementMap>
- indicates whether the extension is enabled or not.

Method `installExtension(id: string)` -> Promise<void>
- enables or installs an extension (with user prompt)
- if unsuccessful, throws { code: number, error: string }
  where `code` is extensions::webstore_install::Result

also:
- ran clang-format on most of the patch
- removed NTP background color stuff since it's not used
- cleaned up unneeded includes in both .h and .cc files
2026-02-01 12:38:34 +01:00
jj 3e78654f40 helium/onboarding: remove UseStringsJs(), comment trusted-types
we don't use strings.js (yet?) so we can safely disable it.
also add a comment explaining why we disable `trusted-types`.
2026-02-01 11:01:18 +00:00
jj cd196d63c7 helium/onboarding: introduce get/install extension APIs
type EnablementMap = Record<ExtensionId, boolean>
Event `extension-state-changed` -> EnablementMap
and method `getExtensions()` -> Promise<EnablementMap>
- indicates whether the extension is enabled or not.

Method `installExtension(id: string)` -> Promise<void>
- enables or installs an extension (with user prompt)
- if unsuccessful, throws { code: number, error: string }
  where `code` is extensions::webstore_install::Result

also:
- ran clang-format on most of the patch
- removed NTP background color stuff since it's not used
- cleaned up unneeded includes in both .h and .cc files
2026-02-01 11:01:15 +00:00
jj 6f43432519 helium/onboarding: make whole services button be clickable (#841)
the <a> made it so that it does something only when text was clicked
2026-02-01 12:00:18 +01:00
Spikers d20aad643e Disable Federated Credential Management (FedCM) by default (#3625) 2026-01-28 21:04:09 -06:00
wukko 985688b9a9 revision: bump to 4 (#834) 2026-01-28 20:05:28 +00:00
jj 50167df4d4 deps: use helium ublock fork, update to 1.69.0-2 2026-01-28 19:56:05 +00:00
Daniel Richard G. 8e4b1b1204 Add quilt(1) backup option to make_domsub_script.py
This allows files modified by the script to be backed up using quilt's
convention for saving a copy of files prior to patching them. The
backup is recorded as a virtual patch file, that can then be popped
off the stack (using "quilt pop -f") like any other patch.
2026-01-28 20:21:43 +01:00
jj 24c34d93f7 utils/extraction: add support for .zip relative path stripping 2026-01-28 15:17:21 +00:00
wukko e00d3ef9e3 merge: update to chromium 144.0.7559.109 (#831) 2026-01-28 21:07:15 +06:00
wukko 6325cb4b30 patches: refresh for 144.0.7559.109 2026-01-28 16:41:01 +06:00
wukko 84dbbf159c merge: update to ungoogled-chromium 144.0.7559.109 2026-01-28 13:02:02 +06:00
Blaise d006f5961a Update to Chromium 144.0.7559.109 2026-01-27 21:42:07 -06:00
PF4Public 1031fdae23 Update copyright year in LICENSE file (#3627) 2026-01-27 21:34:12 -06:00
wukko 6a97b1949d patches: remove bromite's canvas noise patch (#825)
superseded by helium noise
2026-01-26 15:38:41 +00:00
wukko efd166b84f helium/ui/location-bar: shrink page action and fix its colors (#824)
disabled tonal coloring, forced the minimized state, and removed
leftover code from intent chip -> page action migration in M144
2026-01-26 15:34:52 +00:00
wukko 8d8052b9d5 helium/core/search: use default search icon in omnibox (#823)
reduces visual noise and prevents ugly search engine favicons from
breaking the visual uniformity and contrast. there's enough indication
to tell what search engine you're using without the favicon.
2026-01-26 15:30:54 +00:00
wukko cbcffd188c helium/core/component-updates: allow WidevineCdm installer (#822)
this allows for the widevine component to be sideloaded on some
platforms
2026-01-26 15:20:31 +00:00
wukko b1c7c7ec55 helium/core/search: break default search engine favicons (#821)
prevents unnecessary favicon requests when opening the search engines
page in settings. we use our own offline assets on that page, so this
has no visual impact.
2026-01-26 21:15:37 +06:00
wukko 53d84da528 helium/ui/pdf-viewer: adaptive sidenav width (#815)
fixes awkwardly narrow navigation view
2026-01-25 13:12:14 +00:00
jj effc1998db helium/ublock: remove migration logic from webstore uBlock (#810)
we introduced component-based uB0 in 0.4.8, and so had to migrate any
existing prefs from the webstore extension to our component-based
extension

4 milestones and 4 months later, I think we can safely drop this logic,
since the vast majority of users should have their preferences already
migrated
2026-01-25 11:10:48 +01:00
jj a59d037abf github/templates: specify issue prerequisite for PRs (#802) 2026-01-23 12:06:08 +00:00
wukko 99df2f5ce0 helium/ui/toolbar: don't show split controls if not pinned (#801)
i assume this button is shown in chromium because there's no clear
indication of what tab is focused, but helium shows it directly in the
tab strip (#800). if the user wants the toolbar button for split
controls to be visible, it can be pinned, and it'll behave just like it
used to.
2026-01-23 12:02:37 +00:00
wukko 43a4670139 helium/ui/tabs: improve split tabs ux (#800)
- show a selection stroke around the currently selected half
- allow tabs to be clicked & focused individually
- space out tabs for cleaner visuals
2026-01-23 11:58:20 +00:00
wukko 9fa95f14d5 helium/core/shortcuts: add "new split view" to mac app menu (#799)
surfaces the existing keyboard shortcut in a familiar place
2026-01-23 11:46:51 +00:00
jj 1fffbef8d8 helium/ui: hide live caption button in PiP (#787)
Fixes #272
2026-01-23 17:31:28 +06:00
wukko d69044982f helium/ui/cat: fix extra margin between window controls & toolbar (#795) 2026-01-23 12:45:32 +06:00
wukko a8f0ed3382 revision: bump to 3 (#792) 2026-01-21 15:19:40 +00:00
wukko 4c8f19152a update: chromium 144.0.7559.96 (#788) 2026-01-21 21:13:02 +06:00
wukko fd840637d0 patches: refresh for chromium 144.0.7559.96 2026-01-21 14:00:22 +06:00
wukko fab928a47d merge: update to ungoogled-chromium 144.0.7559.96 2026-01-21 13:04:38 +06:00
Blaise 4ab4dc360d Update to Chromium 144.0.7559.96 2026-01-20 17:05:22 -06:00
jj 2faa7811ca helium/bangs: only replace user_text if the result is longer (#786)
The intent of this `if` is to allow the user to select a suggested query
from bang history, but it previously always overwrote |user_text_| even
if it was longer (which is not possible if the user is selecting a
suggestion, as it will always be longer than currently-typed text).

Because |fill_into_edit| is trimmed, it also removed the trailing space
that is desired if the user was inputting a completely new query.

Make it so that |user_text_| is only replaced if it will result in an
expansion.

Fixes #726
2026-01-20 19:28:49 +00:00
jj 3e38464b94 helium/bangs: remove strict match check in MaybeStripKeyword (#785)
i can't remember what this was added for, and bangs seem to be working
fine even without it. so let's just yank it out since it seems to be
causing problems.

Fixes #146
Fixes #784
2026-01-20 19:43:24 +01:00
wukko d842e99049 helium/ui: fix caption button bounds on macos (#779)
also removed a patch for old layout which is no longer used
2026-01-20 14:06:21 +00:00
jj 894352c8d5 helium/core: don't expose mv3-only features to ublock component (#778)
fixes #677
2026-01-19 15:59:50 +00:00
wukko e88afce78d helium/core/exclude-flags: exclude new layout kill switches (#777)
related: #776 

we don't patch the old layout, so disabling the new one could have
unpredicted consequences
2026-01-19 15:56:20 +00:00
wukko 3777d75236 helium/ui: remove patches for the old browser layout (#776)
it's no longer used (as of 144) and was removed in upstream's main.
patching dead code makes no sense.
2026-01-19 21:52:17 +06:00
jj a3d44e6cc1 helium/core: add component to remove webstore nags (#772)
this component can be also used later for compatibility fixes with
alternative extension stores like opera/edge store

fixes #551
2026-01-19 12:18:35 +06:00
jj 55438d5cbc helium/settings: add "add search engine" button (#769) 2026-01-18 14:52:07 +01:00
jj 1135b4aa89 helium/ui: fix zoom and pwa action behavior (#771)
should work as expected once again
2026-01-18 10:52:38 +00:00
wukko 39cd99cc8d revision: bump to 2 (#768) 2026-01-18 01:50:15 +06:00
jj 8ca6ce276b helium/cat: prevent profile button from being collapsed (#767)
Fixes #440
Fixes (maybe) #657
2026-01-17 20:06:57 +01:00
jj 6af846d7a3 domain_regex.list: exclude chromiumapp.org from substitution
fixes #545 (related: ungoogled-software/ungoogled-chromium#3597)

used by chromium for extension oauth flow. chromium just intercepts the request and takes the token
2026-01-17 12:00:31 +00:00
jj 7d014c2076 domain_substitution.list: regenerate
not sure how that happened, looks like a botched merge
cb4f6ca17b
2026-01-17 11:40:19 +00:00
wukko 7cc336dcb2 update: helium 0.8.1 (chromium 144.0.7559.59) (#751) 2026-01-17 02:05:04 +06:00
wukko d57e242e5e revision: reset to 1 2026-01-17 01:58:27 +06:00
wukko 26252d38c2 helium/core: introduce helium noise, redo anti-fingerprinting
Chromium's canvas noising was mostly removed in 3 parts, which
landed in 144:
1. https://crrev.com/1537919
2. https://crrev.com/1538396
3. https://crrev.com/1538814

Prior to 144, Helium relied on Chromium's implementation of Canvas
noising for fingerprinting protection, as it was the best option at
the time. Now that it's no longer available, we had to either revert
the removal, or come up with our own implementation.

Helium Noise is something in-between: it builds on top of Chromium's
implementation, but removes extras and extends it further.

Key highlights of this implementation:
- Completely independent, doesn't rely on any remaining bits of
  Chromium's deprecated implementation.
- Noise isn't locked to just Canvas, it's built with extensibility
  in mind, so we can implement fingerprint deception for more browser
  APIs in the future.
- Noise generates unique BrowserContext tokens per feature
  (kCanvas, kAudio, etc) to prevent (highly unlikely) correlation. Aka
  the way it should be implemented.
- Canvas is noised only during readback, just like in Chromium's
  implementation.
- Canvas noising works without hardware acceleration unlike Chromium's
  implementation.

I've also updated AudioContext fingerprint deception to use Helium Noise,
just like Canvas. This should fix #249, because AudioContext fingerprint
is now consistent within an origin and BrowserContext. More testing is
needed, as I'm unable to replicate the original issue on previous builds.
2026-01-17 01:58:20 +06:00
wukko d9282c041e devutils/lint_tests: add DEPS to license header ignores 2026-01-17 01:36:06 +06:00
wukko edea8fe4f7 helium/ui/caption-bounds: fix caption bounds width on old macos 2026-01-17 01:33:23 +06:00
wukko ff09b25f95 helium/core/exclude-flags: remove irrelevant flags added in M144 2026-01-17 01:32:40 +06:00
wukko cb4f6ca17b patches: update and refresh for chromium 144.0.7559.59 2026-01-17 01:32:29 +06:00
wukko 2f826d1ee9 merge: update to ungoogled-chromium 144.0.7559.59 2026-01-12 13:32:42 +06:00
Blaise e8f5addcff Update to Chromium 144.0.7559.59 2026-01-08 08:38:22 -06:00
wukko b6e5b77e31 revision: bump to 10 (#729) 2026-01-07 09:33:12 +00:00
wukko 5903dd18e8 chromium: update to 143.0.7499.192 (#728)
fixes CVE-2026-0628 (TBD)
2026-01-07 15:28:37 +06:00
Blaise 868121c2fc Update to Chromium 143.0.7499.192 2026-01-06 14:24:49 -06:00
jj 0c355bda1b helium/ui: add proper error when extension services are disabled (#718) 2026-01-06 12:14:50 +06:00
wukko 00501e2311 revision: bump to 9 (#699)
pretty embarrassing but i think the 2px diff in #698 makes a big
difference
2026-01-02 19:57:16 +00:00
wukko 114aca58c5 deps: update onboarding (#698) 2026-01-02 19:45:18 +00:00
wukko 8b563c0d01 revision: bump to 8 (#697) 2026-01-02 18:43:02 +00:00
wukko 824cf71ff3 deps: rename extras into deps & update onboarding (#696)
extras were never extra, so this fixes the possible confusion
2026-01-03 00:38:29 +06:00
wukko 63be29609d deps: update onboarding 2026-01-03 00:24:08 +06:00
wukko d1cdab8975 repo: extras.ini -> deps.ini 2026-01-03 00:21:37 +06:00
jj b5c22404c6 ci/bump-platform: export versions, add platform-specific hooks (#688) 2025-12-31 18:47:01 +01:00
wukko d6f4210a41 patches/ungoogled: remove irrelevant/outdated/duplicate patches (#680)
- `inox-patchset/disable-missing-key-warning.patch`: same behavior as
`debian/disable-google-api-warning.patch`, but one level lower. makes no
sense to keep both.
- `ungoogled-chromium/remove-disable-setuid-sandbox-as-bad-flag.patch`:
irrelevant to helium, and also it is a bad flag
- `ungoogled-chromium/enable-page-saving-on-more-pages.patch`: outdated
or initially useless
- `ungoogled-chromium/disable-download-quarantine.patch`: i understand
why ungoogled has this patch, but helium should allow the OS to
vet/quarantine downloaded files. this is not related to safe browsing.
- `ungoogled-chromium/fix-distilled-icons.patch`: weird workaround +
helium doesn't ship a reading mode, the only place where this could've
been potentially used
- `ungoogled-chromium/add-flag-for-tabsearch-button.patch`: helium hides
the tab search button by default, with an option to enable it in the
toolbar
- `ungoogled-chromium/add-flag-for-qr-generator.patch`: outdated and
irrelevant, the qr code generation entrypoint hasn't been in the address
bar for many years
- `ungoogled-chromium/add-flag-to-disable-sharing-hub.patch`: same as qr
code generator, the sharing hub entry point hasn't been in the address
bar for many years
- `ungoogled-chromium/enable-extra-locales.patch`: irrelevant to helium.
basically extra bloat, considering regular chrome doesn't ship these
2025-12-30 23:55:45 +06:00
jj a939d1d8b0 revision: bump to 7 (#651) 2025-12-20 17:03:53 +01:00
wukko 76fbefad51 merge: update to chromium 143.0.7499.169 (#644) 2025-12-19 13:18:55 +06:00
wukko 95a1030f70 merge: update to ungoogled-chromium 143.0.7499.169 2025-12-19 10:46:35 +06:00
Blaise 7375679377 Update to Chromium 143.0.7499.169 2025-12-18 14:54:01 -06:00
wukko 2ee49a1059 helium/ui: shrink pdf viewer's ui (#634)
- shrunk the toolbar padding
- shrunk the side panel with thumbnails
- fixed different font sizes in the toolbar
- made file title a bit smaller, reduced its margin
- remade the stroke of the selected thumbnail

as a result, a lot more content fits on the screen at once!
2025-12-18 23:58:34 +06:00
wukko 1be2432a9a revision: bump to 6 (#633)
bumping asap to get the security patch out fast
2025-12-17 14:27:41 +06:00
wukko 5d96434aa0 merge: update to chromium 143.0.7499.146 (#632) 2025-12-17 14:14:30 +06:00
wukko 56d1a136ab patches: refresh for chromium 143.0.7499.146 2025-12-17 12:07:35 +06:00
wukko 688af14009 merge: update to ungoogled-chromium 143.0.7499.146 2025-12-17 11:37:41 +06:00
Blaise 1341de3a37 Update to Chromium 143.0.7499.146 2025-12-16 14:14:37 -06:00
wukko 4e6eda294f revision: bump to 5 (#623) 2025-12-15 13:46:38 +00:00
wukko f32b04755e helium/ui: fix pwa toolbar & location bar layout (#620) 2025-12-15 08:56:28 +00:00
wukko 75d044b9a6 helium/ui/tabs: fix in-place pinned tab muting/unmuting (#619)
fixes #586
2025-12-15 14:53:17 +06:00
wukko 0ec967b7d6 helium/ui/cat: fix layout breakage when exiting fullscreen, again (#616) 2025-12-14 16:01:08 +06:00
wukko 5354646288 revision: bump to 4 (#607) 2025-12-12 16:46:36 +00:00
jj f03eea9638 extras: update onboarding (#605) 2025-12-12 17:12:54 +01:00
wukko 42e783c0bb merge: update to chromium 143.0.7499.109 (#601) 2025-12-12 18:14:27 +06:00
wukko 4cfbfe2710 patches: refresh for chromium 143.0.7499.109
removed upstream-fixes/fix-macos-fullscreen-ui-breakage.patch because it's been merged into M143 upstream :D
2025-12-12 18:11:24 +06:00
wukko 7c51e1f0f6 merge: update to ungoogled-chromium 143.0.7499.109 2025-12-12 18:11:24 +06:00
wukko b45d47cf07 extras: update onboarding (#603)
adds accommodations for the services schema & component updates
2025-12-12 12:08:40 +00:00
wukko c4482c5655 helium/core/services: component updates and schema 1 changelog (#591) 2025-12-12 18:00:15 +06:00
wukko 8930f2ae91 helium/core/services: add description & first changelog 2025-12-12 17:56:36 +06:00
wukko 714939df2c helium/core/components: descriptive helium services state error
now components show an error about disabled helium services if autoupdating is disabled
2025-12-12 17:35:32 +06:00
wukko db5ddc92c1 helium/core/components: restrict installation to an allowed set
just CRLSet for now. more to come in the future as we progressively vet them
2025-12-12 17:35:32 +06:00
wukko e64526ce10 helium/core: component updates via helium services
managed by the same toggle as general browser updates
2025-12-12 17:35:27 +06:00
wukko b82e2921d4 helium/core: add helium services versioning & update alerts (#599) 2025-12-12 15:34:03 +06:00
wukko a16ae4bd88 helium/core/services-nag: update strings 2025-12-12 14:00:23 +06:00
wukko 07018baf2e helium/core/services: polish the schema update notification
- adjusted padding, margins, and border radius
- made the title stand out more
- updated related strings
- removed the extra description, feels unnecessary to me
2025-12-12 13:59:46 +06:00
jj f4937943ca helium/core/onboarding: format and add "acceptLatestSchema" call 2025-12-11 23:43:48 +00:00
jj d27f87f754 helium/core: add helium services versioning/changelog
also move stringprintf import in helpers to correct patch
2025-12-11 23:43:48 +00:00
jj a2b3cd02bb devutils/lint: fix all_new_headers_have_correct_guard test 2025-12-11 23:43:48 +00:00
Blaise 20915c82d9 Update to Chromium 143.0.7499.109 2025-12-10 13:46:06 -06:00
wukko 7c45f2fcd6 revision: bump to 3 (#587) 2025-12-09 16:12:11 +00:00
wukko 8cb698e496 helium/ui/cat: fix order of early CAT layout return (#583)
fixes #576
2025-12-09 21:32:33 +06:00
wukko 009a2e74c7 helium/ui/cat: fix crash when opening the guest window (#577)
extensions container is nullptr there, so trying to set its flex property was causing a crash
2025-12-09 15:54:48 +06:00
wukko b06b34b5e9 revision: bump to 2 (#573) 2025-12-07 14:55:31 +06:00
wukko b102956f52 revision: bump to 2 2025-12-07 14:52:24 +06:00
jj 1676a4071e patches/spellcheck: update error to mention helium services (#572) 2025-12-07 09:40:46 +01:00
jj 89699b019b patches/disable-crash-reporter: re-enable crashpad on Linux 2025-12-04 17:13:40 +00:00
wukko 9b49458bc2 helium/ui: keep pinned extensions in CAT & reduce grab handle (#562) 2025-12-04 21:15:46 +06:00
wukko b3733ec6aa helium/cat: remove tab strip grab handle
cuz it takes up too much of precious space
2025-12-04 16:20:56 +06:00
wukko ac863716dd helium/cat: prevent pinned extensions from shrinking 2025-12-04 16:20:25 +06:00
wukko 05ab79d610 helium/ui/grab-handle: slightly reduce the size 2025-12-04 15:51:18 +06:00
wukko e67c0db58f patches: move everything from contrib to root dir (#557)
now all chromium patches in all helium repos follow
the same dir pattern: `<vendor>/<group>/<...>/<patch>`

and there's no longer a "contrib" dir which was admittedly
kind of confusing
2025-12-04 01:43:34 +06:00
wukko 8041351f2b merge: update to chromium 143.0.7499.40 (#544) 2025-12-03 23:38:34 +06:00
wukko 2fd8ab8736 revision: reset to 1 2025-12-03 23:22:46 +06:00
wukko bb720ee09f helium/settings: remove dead sections from profiles page
prevents dead section flickering on page init
2025-12-03 23:20:20 +06:00
wukko 3175ba89bd helium/ui: merge two caption button bounds patches
and remove the windows (os) workaround cuz the new layout doesn't use it
2025-12-03 23:20:20 +06:00
wukko 1d218c894b helium/ui/cat: reduce horizontal toolbar margin 2025-12-03 23:20:20 +06:00
wukko 3e07bd785f helium/ui: fix caption bounds (only on macos for now)
merged the related patch from macOS repo into this one and added new changes. it makes sense to keep it here as it's a "main helium" kind of change, not some platform quirk.

i'm not sure whether macOS 15 bounds are correct, however, so this will probably be patched up more in the future.
2025-12-03 23:20:19 +06:00
wukko a3072fedab upstream-fixes: fix broken fullscreen ui on macos
caption buttons bounds were incorrectly interpreted and this patch (crrev.com/1538756) fixes it by always using hard-coded constants
2025-12-03 23:20:19 +06:00
wukko a749a3e3e2 helium/ui: fix toolbar padding due to upstream changes
...again
2025-12-03 23:20:19 +06:00
wukko d145111dd0 helium/core/exclude-flags: remove irrelevant flags added in M143 2025-12-03 23:20:19 +06:00
wukko 2ce45ab9f2 patches: refresh and update for chromium 143.0.7499.40 2025-12-03 23:20:19 +06:00
wukko ab9a39c516 merge: update to ungoogled-chromium 143.0.7499.40 2025-12-03 23:19:47 +06:00
Blaise 7b77584e8c Update to Chromium 143.0.7499.40 2025-12-02 14:14:43 -06:00
jj bcf3330b42 patches/fixes: clean up obsolete upstream fixes
These are not needed anymore AFAICT, ungoogled-chromium
builds fine for me on Linux and macOS without them.
2025-11-30 20:26:37 +00:00
jj a2d63db83b patches/bangs: accept trailing bangs with enter key (#530) 2025-11-29 16:14:40 +01:00
wukko b3f08938ce revision: bump to 9 (#534) 2025-11-29 16:56:06 +06:00
jj 4a95606bfa helium/appearance: re-enable gtk/qt buttons (#531)
the agnostic theme will still be the default, but this
will re-enable the use gtk/qt buttons for whoever wants
to use the GTK/QT themes for whatever reason

fixes imputnet/helium-linux#74
2025-11-29 15:50:41 +06:00
wukko 76462eb66c helium: add an option to use MRU order when tabbing thru tabs (#529)
closes #111
2025-11-28 14:26:40 +01:00
wukko ec8480c3f5 helium/settings: add behavior section to the appearance page (#528)
- made the appearance subpage open first by default when opening the settings page
- moved all behavioral toggles to the new section within the appearance page
- renamed the appearance page to "Appearance and behavior"
- replaced the palette icon with a more diverse one
- moved helium/ui/settings-page-icons.patch to helium/settings/settings-page-icons.patch
- cleaned up patch order inside helium/core/open-new-tabs-next-to-active-tab-option.patch to be more readable
2025-11-28 19:14:24 +06:00
Sheng c94c96e62e Fix zip compression level (#3555) 2025-11-27 09:17:28 -06:00
wukko fa41ca5fca patches: merge extra & core into contrib, clean up files (#527)
merged extra & core folders into one "contrib" folder

removed useless/outdated patches:
- upstream-fixes/hardware_destructive_interference_size.patch
- iridium-browser/mime_util-force-text-x-suse-ymp-to-be-downloaded.patch
- iridium-browser/Remove-EV-certificates.patch
- inox-patchset/0016-chromium-sandbox-pie.patch
- upstream-fixes/glue_core_pools.patch

merged patches:
- iridium-browser/safe_browsing-disable-incident-reporting.patch and iridium-browser/safe_browsing-disable-reporting-of-safebrowsing-over.patch into iridium-browser/safe-browsing-disable-reporting.patch

renamed patches:
- removed sequence numbers from inox patch filenames
2025-11-27 17:53:54 +06:00
wukko 9df88459b8 helium/core: override browser protocol in copied url and tab card (#526) 2025-11-26 15:27:56 +01:00
wukko 7e1d9dd767 upstream-fixes/macos-widget: update to prevent parent overlap (#523)
fixes the main window being clipped by the menu bar

partial copy of chromium/chromium@4f0076b
2025-11-26 11:01:02 +01:00
wukko ccb227dc03 helium/ui: remove zoom page action (#519)
cleans up space, eliminates "zoom shaming". i just like scaling down
websites without being constantly reminded about it. safari behaves the
same way as helium does with this change, and no one complains, so i
guess it's fine :3
2025-11-26 00:23:42 +06:00
wukko 94fa070851 helium/ui/tabs: tab muting, move indicator to left (#517)
- enabled the tab muting feature by default
- fixed the UX issue with the alert indicator and the close button
  swapping places on hover
- increased the minimum width for close buttons to prevent mute &
  close buttons from overlapping each other
- removed the fade animation from the indicator

closes #324
2025-11-24 20:46:58 +06:00
jj 1a266da9a3 devutils/lint: add rule to detect whitespace-only changes (#510) 2025-11-24 14:38:36 +06:00
wukko 6312142913 helium/ui/toolbar: remove cookie controls from pwa toolbar (#509) 2025-11-23 11:35:35 +00:00
wukko 64ef95a6eb helium/core: disable ntp footer (#508)
fixes #237
2025-11-23 17:31:14 +06:00
jj a7e5433e7c helium/override-protocol: use helium:// in omnibox suggestions (#505) 2025-11-22 13:33:13 +00:00
jj 4f803de791 helium/cat: elide location icon text when in CAT mode (#506) 2025-11-22 13:37:50 +01:00
jj aebf0a4387 devutils/platform_patches: update shared patches instead of deleting
Instead of deleting copies of generic patches when unmerging them
from platform patches, move them back into the shared repository.

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

fixes #465
2025-11-15 19:59:29 +00:00
jj 80dfd780db gitattributes: remap patches to c++ (#464) 2025-11-15 13:53:18 +00:00
jj c9a0eaf2c0 helium/cat: make common icons always stay unburgered 2025-11-14 22:16:56 +00:00
jj 9f7755dbd7 helium/core: fix chrome.instanceID.getID() hanging (#449) 2025-11-13 20:00:13 +01:00
Kurt Fitzner 110cab3432 Update README.md to include Ubuntu distribution (#3536) 2025-11-13 07:52:14 -06:00
wukko 0f9df28d13 merge: update to chromium 142.0.7444.162 (#433) 2025-11-13 03:07:23 +06:00
wukko 060fa834e5 revision: bump to 5 2025-11-13 03:01:27 +06:00
wukko be47d96c1f patches: refresh for 142.0.7444.162 2025-11-13 03:00:09 +06:00
wukko f049404ad5 merge: update to ungoogled-chromium 142.0.7444.162 2025-11-13 02:46:38 +06:00
jj 232f940dbd ungoogled/existing-switches: fix webrtc switch flag values (#426)
fixes #425
2025-11-12 20:41:07 +00:00
wukko b3d929f6e2 helium/ui: new experimental layout, refactor tabs & omnibox (#427)
- added new experimental one-line top container UI layout behind `#helium-cat-ui` flag
- updated tab groups ui: fixed margins, updated header colors to be less blinding, and moved the line to top to prevent visual clashing with the location bar
- fixed the tab strip alignment on windows, linux, and in fullscreen mode on macos
- reduced tabs' outer margins & width
- refactored omnibox sizing, removed the glitchy border, fixed the macos-specific positioning issue by applying a fresh upstream fix
- refactored `layout-constants` to be more flexible for new ui layouts
2025-11-13 02:36:13 +06:00
wukko 5f296ba37d helium/ui: finally align the tab strip with toolbar buttons
on windows, linux, and fullscreen on mac
2025-11-13 01:58:15 +06:00
wukko 3668280470 upstream-fixes: fix misplaced omnibox popup due to rect constrains
fixes imputnet/helium-macos/issues/67
2025-11-13 01:58:15 +06:00
wukko 673aaf7698 helium/ui/tabs: update tab group ui, fix ntp button overlap, fix padding
- tab group header is now positioned properly
- tab group header is now colored like bookmarked tab groups
- moved tab underline to top to prevent visual clashing with the location bar, made it skinnier
- new tab button no longer sits on top of tabs, caused by minified outer margins of tabs
- fixed padding inside tabs to be visually 6px everywhere
2025-11-13 01:58:15 +06:00
wukko 9113a4cda7 helium/ui/omnibox: refactor sizing, remove stroke 2025-11-13 01:58:14 +06:00
wukko e9de843abe helium/ui: add experimental compact (one-line) toolbar 2025-11-13 01:58:06 +06:00
Blaise 367118d103 Update to Chromium 142.0.7444.162 2025-11-11 13:21:42 -06:00
wukko 8da7b370f7 helium/ui/tabs: reduce outer margins & width 2025-11-08 20:17:12 +06:00
wukko 06a3ebf3d3 helium/ui/layout-constants: refactor to avoid value duplication
and simplify future maintenance
2025-11-08 20:16:42 +06:00
wukko 4991dcc364 revision: bump to 4 (#415) 2025-11-07 20:31:51 +00:00
wukko 7222174274 helium/toolbar: options for hiding back, reload, and menu buttons (#414)
also:
- refactored related patches
- reordered & sorted toolbar options in the customization side panel
- added "customize helium" option to browser window's context menu
2025-11-08 02:27:05 +06:00
wukko 2315522ef2 helium/core: add "customize helium" option to window's context menu 2025-11-08 02:22:54 +06:00
wukko dc61f5cf4f helium/toolbar: add prefs for hiding back, reload, and main menu buttons 2025-11-08 02:22:47 +06:00
wukko 8486eb8436 helium: merge toolbar prefs, move to ui 2025-11-07 19:06:33 +06:00
jj 537ba368e9 helium/core: return "Google Chrome" as browser brand (#408) 2025-11-07 12:10:20 +00:00
jj 61c7f706eb helium/devtools: fix building with sync ripped out (#409) 2025-11-07 12:55:41 +01:00
jj ee6294e217 patches/upstream-fixes: fix warning when building with py3.14 (#410) 2025-11-07 10:16:07 +01:00
wukko e3bcfa4148 merge: update to chromium 142.0.7444.134 (#402) 2025-11-07 01:06:43 +06:00
wukko 4700d1bc7e patches: refresh and update for 142.0.7444.134
`force-eu-search-features.patch` had notable changes for [7102578](https://chromium-review.googlesource.com/c/chromium/src/+/7102578)
2025-11-07 00:11:50 +06:00
wukko 617bd4b75e merge: update to ungoogled-chromium 142.0.7444.134 2025-11-07 00:11:46 +06:00
wukko 7b31f0b137 extras: update onboarding to 202511061712 (#407) 2025-11-06 17:52:26 +00:00
jj 7815dd5522 helium/devtools: remove "account" section from settings (#405)
Fixes #400
2025-11-06 17:10:15 +00:00
jj 48577b920b helium/core: fix ublock origin being re-enabled when updated (#404) 2025-11-06 17:10:39 +01:00
Blaise a264ac047d Update to Chromium 142.0.7444.134 2025-11-06 06:07:35 -06:00
wukko eaf2714853 helium/ui: add window frame hit test to toolbar (#395)
allows for the toolbar to be the handle for window dragging.
prerequisite for vertical tabs and other UI experiments 👀
2025-11-04 18:12:30 +06:00
wukko cc1db76e65 ungoogled/existing-switches: fix order of webrtc policy pref (#390) 2025-11-04 13:39:10 +06:00
jj ae476a674c patches/upstream-fixes: add fix for connectors_service_ CHECK 2025-11-03 15:44:30 +00:00
Andreas Stieger 74779ebab4 add openSUSE instructions (#3527) 2025-11-02 12:57:24 -06:00
Mrugesh Mohapatra 70627f67f4 github: add well-known funding file for ownership verification (#364) 2025-11-02 17:28:46 +06:00
323 changed files with 24069 additions and 7115 deletions
+3 -4
View File
@@ -36,7 +36,7 @@ validate_with_source_task:
rm -rf chromium_download_cache
mkdir chromium_download_cache
# Attempt to download tarball
./utils/downloads.py retrieve -i extras.ini -c chromium_download_cache &
./utils/downloads.py retrieve -i deps.ini -c chromium_download_cache &
if ! ./utils/downloads.py retrieve -i downloads.ini -c chromium_download_cache ; then
# If tarball is not available, attempt a clone
./utils/clone.py -o chromium_src
@@ -48,10 +48,9 @@ validate_with_source_task:
wait
unpack_source_script: |
if [ ! -d chromium_src ]; then
for file in downloads extras; do
./utils/downloads.py unpack -i $file.ini -c chromium_download_cache chromium_src
done
./utils/downloads.py unpack -i downloads.ini -c chromium_download_cache chromium_src
fi
./utils/downloads.py unpack -i deps.ini -c chromium_download_cache chromium_src
validate_patches_script:
- ./devutils/validate_patches.py -l chromium_src -v
validate_lists_script:
+1
View File
@@ -0,0 +1 @@
*.patch linguist-language=C++
@@ -0,0 +1 @@
https://helium.computer/funding.json
+2 -2
View File
@@ -1,7 +1,7 @@
For your pull request to not get closed without review, please confirm that:
- [ ] An issue exists where the maintainers agreed that this should be implemented.
If such issue did not exist before, I opened one.
- [ ] An issue exists where the maintainers agreed that this should be implemented
(an approved feature request, or confirmed bug).
- [ ] I tested that my contribution works locally, and does not break anything,
otherwise I have marked my PR as draft.
- [ ] If my contribution is non-trivial, I did not use AI to write most of it.
+17 -1
View File
@@ -13,6 +13,14 @@ runs:
shell: bash
run: sudo apt install quilt
- name: Clear disk space
shell: bash
run: |
sudo rm -rf /usr/lib/jvm \
/usr/lib/google-cloud-sdk \
/usr/lib/dotnet \
/usr/share/swift
- name: Bump revision and make PR
shell: bash
env:
@@ -36,6 +44,7 @@ runs:
# get versions and compare them after submodule update
version_before=$(get_version)
export version_before
pushd "$HELIUM_DIR"
git fetch origin main
@@ -56,10 +65,11 @@ runs:
fi
version_after=$(get_version)
export version_after
mkdir -p build/{src,download_cache}
for file in "$HELIUM_DIR/downloads.ini" "$HELIUM_DIR/extras.ini" "$PLATFORM_DIR/downloads.ini"; do
for file in "$HELIUM_DIR/downloads.ini" "$HELIUM_DIR/deps.ini" "$PLATFORM_DIR/downloads.ini"; do
if ! [ -f "$file" ]; then continue; fi
run_upstream utils/downloads.py retrieve \
@@ -86,6 +96,12 @@ runs:
git config user.name "helium-bot"
git config user.email "helium-bot@imput.net"
git add -u patches helium-chromium revision.txt
PLATFORM_HOOK="$PLATFORM_DIR/.github/bump-hook.sh"
if [ -f "$PLATFORM_HOOK" ]; then
"$PLATFORM_HOOK";
fi
if ! git status | tail -1 | grep -q 'nothing to commit'; then
git commit -m "$TITLE"
git push origin update
+1 -1
View File
@@ -1,6 +1,6 @@
BSD 3-Clause License
Copyright (c) 2015-2023, The ungoogled-chromium Authors
Copyright (c) 2015-2026, The ungoogled-chromium Authors
All rights reserved.
Redistribution and use in source and binary forms, with or without
+1 -1
View File
@@ -1 +1 @@
142.0.7444.59
145.0.7632.75
+6 -5
View File
@@ -7,17 +7,18 @@ sha256 = 00a87050fa3f941d04d67fb5763991e0b8ea399a88b505ab0e56dd263f06864c
output_path = ./third_party/search_engines_data/resources_internal
[onboarding]
version = 202509241653
version = 202601021937
url = https://github.com/imputnet/helium-onboarding/releases/download/%(version)s/helium-onboarding-%(version)s.tar.gz
download_filename = onboarding-page-%(version)s.tar.gz
sha256 = fb23110d391419fbbbe2c8f7c3d96765b9b50aa1c20025343ab7f8bd59f9e7ab
sha256 = c8a1f906cf6461179d4fd311c529f0f8e01fb21b63ef179f593a24190c5dca80
output_path = ./components/helium_onboarding
# If you are bumping this, you *NEED* to re-strip the assets.json
# file *every time* by using `devutils/clear-ublock-assets.js`.
[ublock_origin]
version = 1.67.0
url = https://github.com/imputnet/ublock-origin-crx/releases/download/%(version)s/uBlock0_%(version)s.crx
sha256 = 969eaaa4e0b1893a35e1c5767c33bcfcc62737667644c97f644ff3c84677aff7
version = 1.69.0-2
url = https://github.com/imputnet/uBlock/releases/download/%(version)s/uBlock0_%(version)s.chromium.zip
sha256 = fdc0607538082b409833acd2a80f3a2d657b2af70813a9a8e8e5c7a9938f7e29
download_filename = ublock-origin-%(version)s.zip
output_path = third_party/ublock
strip_leading_dirs = uBlock0.chromium
+29 -7
View File
@@ -5,7 +5,7 @@
from third_party import unidiff
LICENSE_HEADER_IGNORES = ["html", "license", "readme"]
LICENSE_HEADER_IGNORES = ["html", "license", "readme", "deps"]
patches_dir = None
series = None
@@ -16,6 +16,10 @@ def _read_text(path):
return filter(str, f.read().splitlines())
def _read_patch(path):
return unidiff.PatchSet('\n'.join(_read_text(path)))
def _init(root):
global patches_dir
global series
@@ -59,8 +63,7 @@ def c_all_new_files_have_license_header():
if 'helium' not in patch:
continue
patch_set = unidiff.PatchSet('\n'.join(_read_text(patch)))
added_files = filter(lambda f: f.is_added_file, patch_set)
added_files = filter(lambda f: f.is_added_file, _read_patch(patch))
for file in added_files:
if any(p in file.path.lower() for p in LICENSE_HEADER_IGNORES):
@@ -75,8 +78,8 @@ def c_all_new_headers_have_correct_guard():
if 'helium' not in patch:
continue
patch_set = unidiff.PatchSet('\n'.join(_read_text(patch)))
added_files = filter(lambda f: f.is_added_file and f.path.endswith('.h'), patch_set)
added_files = filter(lambda f: f.is_added_file and f.path.endswith('.h'),
_read_patch(patch))
for file in added_files:
expected_macro_name = file.path.upper() \
@@ -98,11 +101,11 @@ def c_all_new_headers_have_correct_guard():
for _line in file[0]:
line = str(_line)
if '#ifndef' in line:
if expected["ifndef"] in line:
assert found["define"] is None
assert found["ifndef"] is None
found["ifndef"] = line
elif '#define' in line:
elif expected["define"] in line:
assert found["ifndef"] is not None
assert found["define"] is None
found["define"] = line
@@ -112,3 +115,22 @@ def c_all_new_headers_have_correct_guard():
assert value == f"+{expected[macro_type]}\n", \
f"Patch {patch} has unexpected {macro_type} in {file.path}:" \
f"{value_print}, expecting: {expected[macro_type]}"
def d_no_whitespace_only_changes():
for patch in series:
if 'helium' not in patch:
continue
for file in _read_patch(patch):
for hunk in file:
seen_nonws = False
for line in hunk:
line = str(line)
if line.startswith('+') or line.startswith('-'):
seen_nonws = seen_nonws or len(line.rstrip()) > 1
assert seen_nonws, \
f"Patch {patch} contains hunk consisting of "\
f"only whitespace characters in {file.path}: {hunk}"
+1 -1
View File
@@ -66,7 +66,6 @@ PRUNING_EXCLUDE_PATTERNS = [
'third_party/icu/android/icudtl.dat',
'third_party/icu/common/icudtb.dat',
# Exclusion for rollup v4.0+
'third_party/devtools-frontend/src/node_modules/@rollup/wasm-node/dist/wasm-node/bindings_wasm_bg.wasm',
'third_party/node/node_modules/@rollup/wasm-node/dist/wasm-node/bindings_wasm_bg.wasm',
# Exclusion for performance tracing
'third_party/perfetto/src/trace_processor/importers/proto/atoms.descriptor',
@@ -105,6 +104,7 @@ PRUNING_EXCLUDE_PATTERNS = [
'*.js',
'*.json',
'*.txt',
'*.binarypb',
'*.xtb'
]
+12 -15
View File
@@ -1,10 +1,6 @@
#!/usr/bin/env python3
# -*- coding: utf-8 -*-
# Copyright 2025 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.
# Copyright (c) 2019 The ungoogled-chromium Authors. All rights reserved.
# Use of this source code is governed by a BSD-style license that can be
# found in the LICENSE.ungoogled_chromium file.
@@ -67,19 +63,19 @@ def _dir_empty(path):
return False
def _rename_files_with_dirs(root_dir, sorted_file_iter):
def _rename_files_with_dirs(root_dir, source_dir, sorted_file_iter):
'''
Moves a list of sorted files back to the upstream repo, removing empty directories along the way
Moves a list of sorted files back to their original location,
removing empty directories along the way
'''
past_parent = None
upstream_path = Path(os.path.dirname(os.path.realpath(__file__))) / '../patches'
for partial_path in sorted_file_iter:
complete_path = Path(root_dir, partial_path)
complete_upstream_path = Path(upstream_path, partial_path)
complete_source_path = Path(source_dir, partial_path)
try:
complete_path.rename(complete_upstream_path)
complete_path.rename(complete_source_path)
except FileNotFoundError:
get_logger().warning('Could not remove prepended patch: %s', complete_path)
get_logger().warning('Could not move prepended patch: %s', complete_path)
if past_parent != complete_path.parent:
while past_parent and _dir_empty(past_parent):
past_parent.rmdir()
@@ -91,7 +87,7 @@ def _rename_files_with_dirs(root_dir, sorted_file_iter):
complete_path = complete_path.parent
def unmerge_platform_patches(platform_patches_dir):
def unmerge_platform_patches(platform_patches_dir, prepend_patches_dir):
'''
Undo merge_platform_patches(), adding any new patches from series.merged as necessary
@@ -105,8 +101,8 @@ def unmerge_platform_patches(platform_patches_dir):
filter(len,
(platform_patches_dir / _SERIES_PREPEND).read_text(encoding=ENCODING).splitlines()))
# Move prepended files to original location, preserving changes, and clean up
_rename_files_with_dirs(platform_patches_dir, sorted(prepend_series))
# Move prepended files back to original location, preserving changes
_rename_files_with_dirs(platform_patches_dir, prepend_patches_dir, sorted(prepend_series))
# Determine positions of blank spaces in series.orig
if not (platform_patches_dir / _SERIES_ORIG).exists():
@@ -175,10 +171,11 @@ def main():
repo_dir = Path(__file__).resolve().parent.parent
success = False
prepend_patches_dir = repo_dir / 'patches'
if args.command == 'merge':
success = merge_platform_patches(args.platform_patches, repo_dir / 'patches')
success = merge_platform_patches(args.platform_patches, prepend_patches_dir)
elif args.command == 'unmerge':
success = unmerge_platform_patches(args.platform_patches)
success = unmerge_platform_patches(args.platform_patches, prepend_patches_dir)
else:
raise NotImplementedError(args.command)
+1 -1
View File
@@ -97,7 +97,7 @@ class _NotInRepoError(RuntimeError):
class _DepsNodeVisitor(ast.NodeVisitor):
_valid_syntax_types = (ast.mod, ast.expr_context, ast.boolop, ast.Assign, ast.Add, ast.Name,
ast.Dict, ast.Str, ast.NameConstant, ast.List, ast.BinOp)
ast.Dict, ast.Constant, ast.List, ast.BinOp)
_allowed_callables = ('Var', )
def visit_Call(self, node): #pylint: disable=invalid-name
+1 -1
View File
@@ -2,7 +2,7 @@ fonts(\\*?)\.googleapis(\\*?)\.com#f0ntz\g<1>.9oo91e8p1\g<2>.qjz9zk
google([A-Za-z\-]*?\\*?)\.com(?!mon)#9oo91e\g<1>.qjz9zk
gstatic([A-Za-z\-]*?\\*?)\.com#95tat1c\g<1>.qjz9zk
chrome([A-Za-z\-]*?\\*?)\.com(?!ponent)#ch40me\g<1>.qjz9zk
chromium([A-Za-z\-]*?\\*?)\.org#ch40m1um\g<1>.qjz9zk
chromium(?!app)([A-Za-z\-]*?\\*?)\.org#ch40m1um\g<1>.qjz9zk
mozilla([A-Za-z\-]*?\\*?)\.org#m0z111a\g<1>.qjz9zk
facebook([A-Za-z\-]*?\\*?)\.com#f8c3b00k\g<1>.qjz9zk
appspot([A-Za-z\-]*?\\*?)\.com#8pp2p8t\g<1>.qjz9zk
+1496 -446
View File
File diff suppressed because it is too large Load Diff
@@ -2735,7 +2735,7 @@ along with this program. If not, see <http://www.gnu.org/licenses/>.
+#endif // BRAVE_UTILITY_IMPORTER_BRAVE_EXTERNAL_PROCESS_IMPORTER_BRIDGE_H_
--- /dev/null
+++ b/chrome/utility/importer/chrome_importer.cc
@@ -0,0 +1,437 @@
@@ -0,0 +1,436 @@
+/* Copyright (c) 2019 The Brave Authors. All rights reserved.
+ * This Source Code Form is subject to the terms of the Mozilla Public
+ * License, v. 2.0. If a copy of the MPL was not distributed with this file,
@@ -3103,8 +3103,7 @@ along with this program. If not, see <http://www.gnu.org/licenses/>.
+ if (!usage.favicon_url.is_valid())
+ continue; // Don't bother importing favicons with invalid URLs.
+
+ std::vector<uint8_t> data;
+ s.ColumnBlobAsVector(1, &data);
+ std::vector<uint8_t> data = s.ColumnBlobAsVector(1);
+ if (data.empty())
+ continue; // Data definitely invalid.
+
@@ -177,7 +177,7 @@ along with this program. If not, see <http://www.gnu.org/licenses/>.
} // namespace user_data_importer
--- a/tools/metrics/histograms/metadata/sql/histograms.xml
+++ b/tools/metrics/histograms/metadata/sql/histograms.xml
@@ -40,6 +40,7 @@ chromium-metrics-reviews@google.com.
@@ -49,6 +49,7 @@ chromium-metrics-reviews@google.com.
<variant name="DBSCSessions" summary="DBSCSessions"/>
<variant name="DIPS" summary="DIPS"/>
<variant name="DownloadRecord" summary="DownloadRecord"/>
@@ -207,7 +207,7 @@ along with this program. If not, see <http://www.gnu.org/licenses/>.
} // namespace user_data_importer
--- a/chrome/common/importer/profile_import_process_param_traits_macros.h
+++ b/chrome/common/importer/profile_import_process_param_traits_macros.h
@@ -20,11 +20,11 @@
@@ -23,11 +23,11 @@
#if BUILDFLAG(IS_WIN)
IPC_ENUM_TRAITS_MIN_MAX_VALUE(user_data_importer::ImporterType,
user_data_importer::TYPE_UNKNOWN,
@@ -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
@@ -4266,6 +4266,9 @@ inline constexpr char kServiceWorkerToCo
@@ -4290,6 +4290,9 @@ inline constexpr char kServiceWorkerToCo
inline constexpr char kSharedWorkerBlobURLFixEnabled[] =
"worker.shared_worker_blob_url_fix_enabled";
@@ -256,7 +256,7 @@ along with this program. If not, see <http://www.gnu.org/licenses/>.
inline constexpr char kClearWindowNameForNewBrowsingContextGroup[] =
--- a/chrome/browser/extensions/api/settings_private/prefs_util.cc
+++ b/chrome/browser/extensions/api/settings_private/prefs_util.cc
@@ -1164,6 +1164,8 @@ const PrefsUtil::TypedPrefMap& PrefsUtil
@@ -1144,6 +1144,8 @@ const PrefsUtil::TypedPrefMap& PrefsUtil
settings_api::PrefType::kBoolean;
(*s_allowlist)[::prefs::kImportDialogSearchEngine] =
settings_api::PrefType::kBoolean;
@@ -267,15 +267,15 @@ along with this program. If not, see <http://www.gnu.org/licenses/>.
// Supervised Users. This setting is queried in our Tast tests (b/241943380).
--- a/chrome/browser/ui/webui/settings/settings_ui.cc
+++ b/chrome/browser/ui/webui/settings/settings_ui.cc
@@ -62,6 +62,7 @@
#include "chrome/browser/ui/webui/settings/font_handler.h"
#include "chrome/browser/ui/webui/settings/hats_handler.h"
#include "chrome/browser/ui/webui/settings/import_data_handler.h"
@@ -57,6 +57,7 @@
#include "chrome/browser/ui/webui/settings/about_handler.h"
#include "chrome/browser/ui/webui/settings/accessibility_main_handler.h"
#include "chrome/browser/ui/webui/settings/appearance_handler.h"
+#include "chrome/browser/ui/webui/settings/brave_import_data_handler.h"
#include "chrome/browser/ui/webui/settings/metrics_reporting_handler.h"
#include "chrome/browser/ui/webui/settings/on_startup_handler.h"
#include "chrome/browser/ui/webui/settings/password_manager_handler.h"
@@ -201,6 +202,7 @@ void SettingsUI::RegisterProfilePrefs(
#include "chrome/browser/ui/webui/settings/browser_lifetime_handler.h"
#include "chrome/browser/ui/webui/settings/downloads_handler.h"
#include "chrome/browser/ui/webui/settings/font_handler.h"
@@ -210,6 +211,7 @@ void SettingsUI::RegisterProfilePrefs(
registry->RegisterBooleanPref(prefs::kImportDialogHistory, true);
registry->RegisterBooleanPref(prefs::kImportDialogSavedPasswords, true);
registry->RegisterBooleanPref(prefs::kImportDialogSearchEngine, true);
@@ -283,7 +283,7 @@ along with this program. If not, see <http://www.gnu.org/licenses/>.
}
SettingsUI::SettingsUI(content::WebUI* web_ui)
@@ -230,7 +232,7 @@ SettingsUI::SettingsUI(content::WebUI* w
@@ -239,7 +241,7 @@ SettingsUI::SettingsUI(content::WebUI* w
AddSettingsPageUIHandler(std::make_unique<DownloadsHandler>(profile));
AddSettingsPageUIHandler(std::make_unique<ExtensionControlHandler>());
AddSettingsPageUIHandler(std::make_unique<FontHandler>(profile));
@@ -294,7 +294,7 @@ along with this program. If not, see <http://www.gnu.org/licenses/>.
#if BUILDFLAG(IS_WIN)
--- a/chrome/browser/ui/webui/settings/settings_localized_strings_provider.cc
+++ b/chrome/browser/ui/webui/settings/settings_localized_strings_provider.cc
@@ -900,6 +900,8 @@ void AddImportDataStrings(content::WebUI
@@ -1025,6 +1025,8 @@ void AddImportDataStrings(content::WebUI
{"importHistory", IDS_SETTINGS_IMPORT_HISTORY_CHECKBOX},
{"importFavorites", IDS_SETTINGS_IMPORT_FAVORITES_CHECKBOX},
{"importPasswords", IDS_SETTINGS_IMPORT_PASSWORDS_CHECKBOX},
@@ -319,7 +319,7 @@ along with this program. If not, see <http://www.gnu.org/licenses/>.
</div>
--- a/chrome/browser/ui/BUILD.gn
+++ b/chrome/browser/ui/BUILD.gn
@@ -1237,6 +1237,10 @@ static_library("ui") {
@@ -1255,6 +1255,10 @@ static_library("ui") {
"webui/settings/accessibility_main_handler.h",
"webui/settings/appearance_handler.cc",
"webui/settings/appearance_handler.h",
@@ -330,7 +330,7 @@ along with this program. If not, see <http://www.gnu.org/licenses/>.
"webui/settings/browser_lifetime_handler.cc",
"webui/settings/browser_lifetime_handler.h",
"webui/settings/captions_handler.cc",
@@ -1391,6 +1395,13 @@ static_library("ui") {
@@ -1415,6 +1419,13 @@ static_library("ui") {
]
}
@@ -412,7 +412,7 @@ along with this program. If not, see <http://www.gnu.org/licenses/>.
// Corresponds to the "id" column of the "visits" SQL table.
--- a/components/history/core/browser/visit_database.cc
+++ b/components/history/core/browser/visit_database.cc
@@ -119,6 +119,8 @@ VisitSource VisitSourceFromInt(int value
@@ -123,6 +123,8 @@ VisitSource VisitSourceFromInt(int value
case SOURCE_SAFARI_IMPORTED:
case SOURCE_ACTOR:
case SOURCE_OS_MIGRATION_IMPORTED:
@@ -423,7 +423,7 @@ along with this program. If not, see <http://www.gnu.org/licenses/>.
// In cases of database corruption, SOURCE_BROWSED is a safe default value.
--- a/chrome/browser/importer/in_process_importer_bridge.cc
+++ b/chrome/browser/importer/in_process_importer_bridge.cc
@@ -53,6 +53,8 @@ history::VisitSource ConvertImporterVisi
@@ -52,6 +52,8 @@ history::VisitSource ConvertImporterVisi
return history::SOURCE_IE_IMPORTED;
case user_data_importer::VISIT_SOURCE_SAFARI_IMPORTED:
return history::SOURCE_SAFARI_IMPORTED;
@@ -434,7 +434,7 @@ along with this program. If not, see <http://www.gnu.org/licenses/>.
}
--- a/chrome/utility/BUILD.gn
+++ b/chrome/utility/BUILD.gn
@@ -92,6 +92,12 @@ static_library("utility") {
@@ -90,6 +90,12 @@ static_library("utility") {
sources += [
"importer/bookmarks_file_importer.cc",
"importer/bookmarks_file_importer.h",
@@ -449,17 +449,17 @@ along with this program. If not, see <http://www.gnu.org/licenses/>.
"importer/importer.cc",
--- a/chrome/utility/services.cc
+++ b/chrome/utility/services.cc
@@ -56,7 +56,9 @@
@@ -55,7 +55,9 @@
#if !BUILDFLAG(IS_ANDROID)
#include "chrome/common/importer/profile_import.mojom.h"
+#include "chrome/common/importer/chrome_profile_import.mojom.h"
#include "chrome/utility/importer/profile_import_impl.h"
+#include "chrome/utility/importer/brave_profile_import_impl.h"
#include "components/legion/oak_session_service/oak_session_service.h" // nogncheck
#include "components/mirroring/service/mirroring_service.h"
#include "services/passage_embeddings/passage_embeddings_service.h"
#include "services/proxy_resolver/proxy_resolver_factory_impl.h" // nogncheck
@@ -144,6 +146,13 @@ static_assert(BUILDFLAG(ENABLE_PRINTING)
@@ -137,6 +139,13 @@ static_assert(BUILDFLAG(ENABLE_PRINTING)
namespace {
@@ -473,14 +473,14 @@ along with this program. If not, see <http://www.gnu.org/licenses/>.
auto RunFilePatcher(mojo::PendingReceiver<patch::mojom::FilePatcher> receiver) {
return std::make_unique<patch::FilePatcherImpl>(std::move(receiver));
}
@@ -456,6 +465,7 @@ void RegisterMainThreadServices(mojo::Se
services.Add(ContentBookmarkParser);
@@ -431,6 +440,7 @@ void RegisterMainThreadServices(mojo::Se
services.Add(RunPassageEmbeddingsService);
#if !BUILDFLAG(IS_ANDROID)
+ services.Add(RunBraveProfileImporter);
services.Add(RunOakSessionService);
services.Add(RunProfileImporter);
services.Add(RunMirroringService);
services.Add(RunPassageEmbeddingsService);
--- a/chrome/utility/importer/external_process_importer_bridge.h
+++ b/chrome/utility/importer/external_process_importer_bridge.h
@@ -72,7 +72,7 @@ class ExternalProcessImporterBridge : pu
@@ -583,7 +583,7 @@ along with this program. If not, see <http://www.gnu.org/licenses/>.
// entire group has been collected and is ready to be written to the profile.
--- a/chrome/app/generated_resources.grd
+++ b/chrome/app/generated_resources.grd
@@ -11171,6 +11171,15 @@ Check your passwords anytime in <ph name
@@ -11478,6 +11478,15 @@ Check your passwords anytime in <ph name
Microsoft Edge
</message>
</if>
@@ -33,7 +33,7 @@ along with this program. If not, see <http://www.gnu.org/licenses/>.
#include "extensions/browser/blocklist_extension_prefs.h"
#include "extensions/browser/delayed_install_manager.h"
#include "extensions/browser/disable_reason.h"
@@ -540,6 +541,22 @@ void ExtensionRegistrar::AddComponentExt
@@ -550,6 +551,22 @@ void ExtensionRegistrar::AddComponentExt
}
AddExtension(extension);
+260
View File
@@ -0,0 +1,260 @@
Based on Brave's MRU tab cycling implementation, adapted for Helium.
This Source Code Form is subject to the terms of the Mozilla Public
License, v. 2.0. If a copy of the MPL was not distributed with this file,
You can obtain one at https://mozilla.org/MPL/2.0/.
Copyright (c) 2025, The Brave Authors
Copyright (c) 2025, The Helium Authors
Alternatively, the contents of this file may be used under the terms
of the GNU General Public License Version 3, as described below:
Copyright (C) 2025 The Helium Authors
This program is free software: you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation, either version 3 of the License, or
(at your option) any later version.
This program is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU General Public License for more details.
You should have received a copy of the GNU General Public License
along with this program. If not, see <http://www.gnu.org/licenses/>.
--- a/chrome/browser/ui/tabs/tab_strip_model.cc
+++ b/chrome/browser/ui/tabs/tab_strip_model.cc
@@ -54,6 +54,7 @@
#include "chrome/browser/ui/browser_commands.h"
#include "chrome/browser/ui/browser_finder.h"
#include "chrome/browser/ui/browser_window.h"
+#include "chrome/browser/ui/views/frame/browser_view.h"
#include "chrome/browser/ui/commerce/ui_utils.h"
#include "chrome/browser/ui/send_tab_to_self/send_tab_to_self_bubble.h"
#include "chrome/browser/ui/tabs/features.h"
@@ -4035,6 +4036,44 @@ TabStripSelectionChange TabStripModel::S
return selection;
}
+void TabStripModel::SelectMRUTab(TabRelativeDirection direction,
+ TabStripUserGestureDetails detail) {
+ if (mru_cycle_list_.empty()) {
+ Browser* browser = chrome::FindBrowserWithTab(GetWebContentsAt(0));
+ if (!browser) {
+ return;
+ }
+
+ for (int i = 0; i < count(); ++i) {
+ mru_cycle_list_.push_back(i);
+ }
+
+ std::sort(mru_cycle_list_.begin(), mru_cycle_list_.end(),
+ [this](int a, int b) {
+ return GetWebContentsAt(a)->GetLastActiveTimeTicks() >
+ GetWebContentsAt(b)->GetLastActiveTimeTicks();
+ });
+
+ if (BrowserView* browser_view = browser->window()->AsBrowserView()) {
+ browser_view->StartTabCycling();
+ }
+ }
+
+ if (direction == TabRelativeDirection::kNext) {
+ std::rotate(mru_cycle_list_.begin(), mru_cycle_list_.begin() + 1,
+ mru_cycle_list_.end());
+ } else {
+ std::rotate(mru_cycle_list_.rbegin(), mru_cycle_list_.rbegin() + 1,
+ mru_cycle_list_.rend());
+ }
+
+ ActivateTabAt(mru_cycle_list_[0], detail);
+}
+
+void TabStripModel::StopMRUCycling() {
+ mru_cycle_list_.clear();
+}
+
void TabStripModel::SelectRelativeTab(TabRelativeDirection direction,
TabStripUserGestureDetails detail) {
// This may happen during automated testing or if a user somehow buffers
--- a/chrome/browser/ui/tabs/tab_strip_model.h
+++ b/chrome/browser/ui/tabs/tab_strip_model.h
@@ -617,6 +617,10 @@ class TabStripModel {
TabStripUserGestureDetails detail = TabStripUserGestureDetails(
TabStripUserGestureDetails::GestureType::kOther));
+ // Stops cycling through tabs in MRU order when Ctrl is released.
+ // Used in BrowserView::StopTabCycling().
+ void StopMRUCycling();
+
// Moves the active in the specified direction. Respects group boundaries.
void MoveTabNext();
void MoveTabPrevious();
@@ -1183,6 +1187,11 @@ class TabStripModel {
kPrevious,
};
+ // Selects either the most recently used tab
+ // or the least recently used tab.
+ void SelectMRUTab(TabRelativeDirection direction,
+ TabStripUserGestureDetails detail);
+
// Selects either the next tab (kNext), or the previous tab (kPrevious).
void SelectRelativeTab(TabRelativeDirection direction,
TabStripUserGestureDetails detail);
@@ -1462,6 +1471,9 @@ class TabStripModel {
// The focused group. If no group is focused, this is nullopt.
std::optional<tab_groups::TabGroupId> focused_group_;
+ // List of tabs for MRU cycling
+ std::vector<int> mru_cycle_list_;
+
base::WeakPtrFactory<TabStripModel> weak_factory_{this};
};
--- a/chrome/browser/ui/views/frame/browser_view.cc
+++ b/chrome/browser/ui/views/frame/browser_view.cc
@@ -303,7 +303,10 @@
#include "ui/compositor/paint_recorder.h"
#include "ui/content_accelerators/accelerator_util.h"
#include "ui/display/screen.h"
+#include "ui/events/event.h"
+#include "ui/events/event_handler.h"
#include "ui/events/event_utils.h"
+#include "ui/events/keycodes/keyboard_codes.h"
#include "ui/gfx/animation/animation_runner.h"
#include "ui/gfx/canvas.h"
#include "ui/gfx/color_utils.h"
@@ -321,6 +324,7 @@
#include "ui/views/controls/button/menu_button.h"
#include "ui/views/controls/textfield/textfield.h"
#include "ui/views/controls/webview/webview.h"
+#include "ui/views/event_monitor.h"
#include "ui/views/interaction/element_tracker_views.h"
#include "ui/views/layout/fill_layout.h"
#include "ui/views/view.h"
@@ -822,6 +826,83 @@ class BrowserView::ExclusiveAccessContex
base::WeakPtrFactory<ExclusiveAccessContextImpl> weak_ptr_factory_{this};
};
+// Handles events during MRU tab cycling to start/stop tab cycling.
+class TabCyclingEventHandler : public ui::EventObserver,
+ public views::WidgetObserver {
+ public:
+ explicit TabCyclingEventHandler(BrowserView* browser_view)
+ : browser_view_(browser_view) {
+ Start();
+ }
+
+ ~TabCyclingEventHandler() override { Stop(); }
+
+ TabCyclingEventHandler(const TabCyclingEventHandler&) = delete;
+ TabCyclingEventHandler& operator=(const TabCyclingEventHandler&) = delete;
+
+ private:
+ // ui::EventObserver overrides:
+ void OnEvent(const ui::Event& event) override {
+ if (event.type() == ui::EventType::kKeyReleased &&
+ event.AsKeyEvent()->key_code() == ui::VKEY_CONTROL) {
+ // Ctrl key was released, stop the tab cycling.
+ Stop();
+ return;
+ }
+
+ if (event.type() == ui::EventType::kMousePressed) {
+ Stop();
+ }
+ }
+
+ // views::WidgetObserver overrides:
+ void OnWidgetActivationChanged(views::Widget* widget, bool active) override {
+ // We should stop cycling if other application gets active state.
+ if (!active) {
+ Stop();
+ }
+ }
+
+ // Handle browser widget closing while tab cycling is in-progress.
+ void OnWidgetClosing(views::Widget* widget) override { Stop(); }
+
+ void Start() {
+ // Add the event handler.
+ auto* widget = browser_view_->GetWidget();
+ if (widget->GetNativeWindow()) {
+ monitor_ = views::EventMonitor::CreateWindowMonitor(
+ this, widget->GetNativeWindow(),
+ {ui::EventType::kMousePressed, ui::EventType::kKeyReleased});
+ }
+ widget->AddObserver(this);
+ }
+
+ void Stop() {
+ if (!monitor_) {
+ // Already stopped.
+ return;
+ }
+
+ // Remove event handler.
+ auto* widget = browser_view_->GetWidget();
+ monitor_.reset();
+ widget->RemoveObserver(this);
+ browser_view_->StopTabCycling();
+ }
+
+ raw_ptr<BrowserView> browser_view_;
+ std::unique_ptr<views::EventMonitor> monitor_;
+};
+
+void BrowserView::StartTabCycling() {
+ tab_cycling_event_handler_ = std::make_unique<TabCyclingEventHandler>(this);
+}
+
+void BrowserView::StopTabCycling() {
+ tab_cycling_event_handler_.reset();
+ browser()->tab_strip_model()->StopMRUCycling();
+}
+
class BrowserView::AccessibilityModeObserver : public ui::AXModeObserver {
public:
explicit AccessibilityModeObserver(BrowserView* browser_view)
--- a/chrome/browser/ui/views/frame/browser_view.h
+++ b/chrome/browser/ui/views/frame/browser_view.h
@@ -85,6 +85,7 @@ class MultiContentsView;
class ProjectsPanelView;
class ScrimView;
class SidePanel;
+class TabCyclingEventHandler;
class TabDragTarget;
class TabSearchBubbleHost;
class TabStrip;
@@ -583,6 +584,10 @@ class BrowserView : public BrowserWindow
bool IsBorderlessModeEnabled() const override;
void ShowChromeLabs() override;
BrowserView* AsBrowserView() override;
+
+ void StartTabCycling();
+ void StopTabCycling();
+
SharingDialog* ShowSharingDialog(content::WebContents* contents,
SharingDialogData data) override;
void ShowUpdateChromeDialog() override;
@@ -884,6 +889,7 @@ class BrowserView : public BrowserWindow
friend class BrowserViewLayoutDelegateImpl;
friend class BrowserViewLayoutDelegateImplOld;
friend class BrowserViewLayoutDelegateImplBrowsertest;
+ friend class TabCyclingEventHandler;
friend class TopControlsSlideControllerTest;
FRIEND_TEST_ALL_PREFIXES(BrowserViewTest, BrowserView);
FRIEND_TEST_ALL_PREFIXES(BrowserViewTest, AccessibleWindowTitle);
@@ -1451,6 +1457,8 @@ class BrowserView : public BrowserWindow
TabStripAndWebAppViewsReparentedState::kMaxValue>
tab_strip_web_apps_reparented_state_;
+ std::unique_ptr<TabCyclingEventHandler> tab_cycling_event_handler_;
+
mutable base::WeakPtrFactory<BrowserView> weak_ptr_factory_{this};
};
@@ -10,7 +10,7 @@ Subject: Disable fetching of all field trials
--- a/chrome/browser/flags/android/java/src/org/chromium/chrome/browser/flags/ChromeFeatureList.java
+++ b/chrome/browser/flags/android/java/src/org/chromium/chrome/browser/flags/ChromeFeatureList.java
@@ -60,7 +60,7 @@ public abstract class ChromeFeatureList
@@ -62,7 +62,7 @@ public abstract class ChromeFeatureList
* |kFeaturesExposedToJava| in chrome/browser/flags/android/chrome_feature_list.cc
*/
public static String getFieldTrialParamByFeature(String featureName, String paramName) {
@@ -19,7 +19,7 @@ Subject: Disable fetching of all field trials
}
/**
@@ -72,8 +72,7 @@ public abstract class ChromeFeatureList
@@ -74,8 +74,7 @@ public abstract class ChromeFeatureList
*/
public static boolean getFieldTrialParamByFeatureAsBoolean(
String featureName, String paramName, boolean defaultValue) {
@@ -29,7 +29,7 @@ Subject: Disable fetching of all field trials
}
/**
@@ -85,8 +84,7 @@ public abstract class ChromeFeatureList
@@ -87,8 +86,7 @@ public abstract class ChromeFeatureList
*/
public static int getFieldTrialParamByFeatureAsInt(
String featureName, String paramName, int defaultValue) {
@@ -39,7 +39,7 @@ Subject: Disable fetching of all field trials
}
/**
@@ -98,8 +96,7 @@ public abstract class ChromeFeatureList
@@ -100,8 +98,7 @@ public abstract class ChromeFeatureList
*/
public static double getFieldTrialParamByFeatureAsDouble(
String featureName, String paramName, double defaultValue) {
@@ -9,7 +9,7 @@
--- a/chrome/browser/BUILD.gn
+++ b/chrome/browser/BUILD.gn
@@ -2609,6 +2609,7 @@ static_library("browser") {
@@ -2548,6 +2548,7 @@ static_library("browser") {
"//third_party/libyuv",
"//third_party/metrics_proto",
"//third_party/re2",
@@ -19,7 +19,7 @@
"//third_party/widevine/cdm:headers",
--- a/chrome/browser/about_flags.cc
+++ b/chrome/browser/about_flags.cc
@@ -191,6 +191,7 @@
@@ -187,6 +187,7 @@
#include "components/translate/core/common/translate_util.h"
#include "components/trusted_vault/features.h"
#include "components/ui_devtools/switches.h"
@@ -44,7 +44,7 @@
#endif // CHROME_BROWSER_BROMITE_FLAG_ENTRIES_H_
--- a/content/browser/BUILD.gn
+++ b/content/browser/BUILD.gn
@@ -302,6 +302,7 @@ source_set("browser") {
@@ -298,6 +298,7 @@ source_set("browser") {
"//third_party/re2",
"//third_party/snappy",
"//third_party/sqlite",
@@ -62,7 +62,7 @@
#include "components/viz/common/switches.h"
#include "components/viz/host/gpu_client.h"
#include "components/viz/host/host_frame_sink_manager.h"
@@ -3591,6 +3592,8 @@ void RenderProcessHostImpl::PropagateBro
@@ -3730,6 +3731,8 @@ void RenderProcessHostImpl::PropagateBro
switches::kEnableWebGLImageChromium,
switches::kEnableWebGPUDeveloperFeatures,
switches::kFileUrlPathAlias,
@@ -73,7 +73,7 @@
switches::kForceHighContrast,
--- a/content/child/BUILD.gn
+++ b/content/child/BUILD.gn
@@ -110,6 +110,7 @@ target(link_target_type, "child") {
@@ -109,6 +109,7 @@ target(link_target_type, "child") {
"//third_party/blink/public/common:buildflags",
"//third_party/blink/public/strings",
"//third_party/ced",
@@ -83,7 +83,7 @@
"//ui/events/blink",
--- a/content/child/runtime_features.cc
+++ b/content/child/runtime_features.cc
@@ -41,6 +41,7 @@
@@ -42,6 +42,7 @@
#include "third_party/blink/public/common/loader/referrer_utils.h"
#include "third_party/blink/public/common/switches.h"
#include "third_party/blink/public/platform/web_runtime_features.h"
@@ -91,7 +91,7 @@
#include "ui/accessibility/accessibility_features.h"
#include "ui/base/ui_base_features.h"
#include "ui/events/blink/blink_features.h"
@@ -483,6 +484,10 @@ void SetRuntimeFeaturesFromCommandLine(c
@@ -488,6 +489,10 @@ void SetRuntimeFeaturesFromCommandLine(c
true},
{wrf::EnableWebAudioBypassOutputBufferingOptOut,
blink::switches::kWebAudioBypassOutputBufferingOptOut, true},
@@ -116,7 +116,7 @@
--- a/third_party/blink/renderer/core/dom/document.cc
+++ b/third_party/blink/renderer/core/dom/document.cc
@@ -41,6 +41,7 @@
@@ -40,6 +40,7 @@
#include "base/i18n/time_formatting.h"
#include "base/metrics/histogram_functions.h"
#include "base/notreached.h"
@@ -124,7 +124,7 @@
#include "base/task/single_thread_task_runner.h"
#include "base/time/time.h"
#include "base/trace_event/trace_event.h"
@@ -1087,6 +1088,11 @@ Document::Document(const DocumentInit& i
@@ -1089,6 +1090,11 @@ Document::Document(const DocumentInit& i
TRACE_EVENT_WITH_FLOW0("blink", "Document::Document", TRACE_ID_LOCAL(this),
TRACE_EVENT_FLAG_FLOW_OUT);
DCHECK(agent_);
@@ -136,7 +136,7 @@
if (base::FeatureList::IsEnabled(features::kDelayAsyncScriptExecution) &&
features::kDelayAsyncScriptExecutionDelayByDefaultParam.Get()) {
script_runner_delayer_->Activate();
@@ -1224,6 +1230,14 @@ const Position Document::PositionAdjuste
@@ -1222,6 +1228,14 @@ const Position Document::PositionAdjuste
return Position::BeforeNode(*shadow_host);
}
@@ -153,7 +153,7 @@
selector_query_cache_ = MakeGarbageCollected<SelectorQueryCache>();
--- a/third_party/blink/renderer/core/dom/document.h
+++ b/third_party/blink/renderer/core/dom/document.h
@@ -574,6 +574,10 @@ class CORE_EXPORT Document : public Cont
@@ -570,6 +570,10 @@ class CORE_EXPORT Document : public Cont
has_xml_declaration_ = has_xml_declaration ? 1 : 0;
}
@@ -164,7 +164,7 @@
V8VisibilityState visibilityState() const;
String visibilityStateAsString() const;
bool IsPageVisible() const;
@@ -2795,6 +2799,9 @@ class CORE_EXPORT Document : public Cont
@@ -2821,6 +2825,9 @@ class CORE_EXPORT Document : public Cont
base::ElapsedTimer start_time_;
@@ -176,19 +176,17 @@
// - ScriptSchedulingType::kInOrder
--- a/third_party/blink/renderer/core/dom/element.cc
+++ b/third_party/blink/renderer/core/dom/element.cc
@@ -3190,6 +3190,11 @@ DOMRectList* Element::getClientRects() {
DCHECK(element_layout_object);
GetDocument().AdjustQuadsForScrollAndAbsoluteZoom(quads,
*element_layout_object);
+ if (RuntimeEnabledFeatures::FingerprintingClientRectsNoiseEnabled()) {
+ for (gfx::QuadF& quad : quads) {
@@ -3440,6 +3440,9 @@ Vector<gfx::RectF> Element::GetClientRec
}
Vector<gfx::RectF> result;
for (auto& quad : quads) {
+ if (RuntimeEnabledFeatures::FingerprintingClientRectsNoiseEnabled()) {
+ quad.Scale(GetDocument().GetNoiseFactorX(), GetDocument().GetNoiseFactorY());
+ }
+ }
return MakeGarbageCollected<DOMRectList>(quads);
}
@@ -3217,6 +3222,9 @@ gfx::RectF Element::GetBoundingClientRec
result.emplace_back(quad.BoundingBox());
}
return result;
@@ -3469,6 +3472,9 @@ gfx::RectF Element::GetBoundingClientRec
DCHECK(element_layout_object);
GetDocument().AdjustRectForScrollAndAbsoluteZoom(result,
*element_layout_object);
@@ -200,7 +198,7 @@
--- a/third_party/blink/renderer/core/dom/range.cc
+++ b/third_party/blink/renderer/core/dom/range.cc
@@ -1655,6 +1655,12 @@ DOMRectList* Range::getClientRects() con
@@ -1656,6 +1656,12 @@ DOMRectList* Range::getClientRects() con
Vector<gfx::QuadF> quads;
GetBorderAndTextQuads(quads);
@@ -213,7 +211,7 @@
return MakeGarbageCollected<DOMRectList>(quads);
}
@@ -1662,7 +1668,11 @@ DOMRect* Range::getBoundingClientRect()
@@ -1663,7 +1669,11 @@ DOMRect* Range::getBoundingClientRect()
// TODO(crbug.com/1499981): This should be removed once synchronized scrolling
// impact is understood.
SyncScrollAttemptHeuristic::DidAccessScrollOffset();
@@ -228,9 +226,9 @@
// TODO(editing-dev): We should make
--- a/third_party/blink/renderer/core/html/canvas/text_metrics.cc
+++ b/third_party/blink/renderer/core/html/canvas/text_metrics.cc
@@ -106,6 +106,24 @@ const ShapeResult* ShapeWord(const TextR
@@ -90,6 +90,24 @@ TextMetrics::TextMetrics(const Font* fon
Update(font, direction, baseline, align, text, text_painter);
}
} // namespace
+void TextMetrics::Shuffle(const double factor) {
+ // x-direction
@@ -255,7 +253,7 @@
const V8CanvasTextBaseline::Enum baseline,
--- a/third_party/blink/renderer/core/html/canvas/text_metrics.h
+++ b/third_party/blink/renderer/core/html/canvas/text_metrics.h
@@ -111,6 +111,8 @@ class CORE_EXPORT TextMetrics final : pu
@@ -110,6 +110,8 @@ class CORE_EXPORT TextMetrics final : pu
float x_position_;
};
@@ -266,7 +264,7 @@
const TextDirection& direction,
--- 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
@@ -108,6 +108,9 @@
@@ -103,6 +103,9 @@
// https://github.com/include-what-you-use/include-what-you-use/issues/1122
// IWYU pragma: no_include "base/numerics/clamped_math.h"
@@ -276,20 +274,14 @@
namespace blink {
class MemoryManagedPaintCanvas;
@@ -1252,13 +1255,26 @@ TextMetrics* BaseRenderingContext2D::mea
@@ -1171,9 +1174,22 @@ TextMetrics* BaseRenderingContext2D::mea
TextDirection direction =
ToTextDirection(state.GetDirection(), host, computed_style);
- return MakeGarbageCollected<TextMetrics>(
- font, direction, state.GetTextBaseline().AsEnum(),
- state.GetTextAlign().AsEnum(), text,
+ TextMetrics* text_metrics = MakeGarbageCollected<TextMetrics>(
+ font, direction, GetState().GetTextBaseline().AsEnum(),
+ GetState().GetTextAlign().AsEnum(), text,
RuntimeEnabledFeatures::CanvasTextNgEnabled(
host->GetTopExecutionContext())
? &host->GetPlainTextPainter()
: nullptr);
font, direction, state.GetTextBaseline(), state.GetTextAlign(), text,
host->GetPlainTextPainter());
+
+ // Scale text metrics if enabled
+ if (RuntimeEnabledFeatures::FingerprintingCanvasMeasureTextNoiseEnabled()) {
@@ -308,7 +300,7 @@
String BaseRenderingContext2D::lang() const {
--- a/third_party/blink/renderer/platform/BUILD.gn
+++ b/third_party/blink/renderer/platform/BUILD.gn
@@ -1815,6 +1815,7 @@ component("platform") {
@@ -1809,6 +1809,7 @@ component("platform") {
"//components/paint_preview/common",
"//components/search_engines:search_engine_utils",
"//components/translate/core/language_detection",
@@ -318,7 +310,7 @@
"//components/webrtc:net_address_utils",
--- a/third_party/blink/renderer/platform/exported/web_runtime_features.cc
+++ b/third_party/blink/renderer/platform/exported/web_runtime_features.cc
@@ -73,4 +73,12 @@ void WebRuntimeFeatures::EnableLocalNetw
@@ -72,4 +72,12 @@ void WebRuntimeFeatures::EnableLocalNetw
RuntimeEnabledFeatures::SetLocalNetworkAccessWebRTCEnabled(enable);
}
@@ -343,7 +335,7 @@
#include "third_party/skia/include/core/SkImage.h"
--- a/third_party/blink/renderer/platform/runtime_enabled_features.json5
+++ b/third_party/blink/renderer/platform/runtime_enabled_features.json5
@@ -2344,6 +2344,12 @@
@@ -2541,6 +2541,12 @@
status: "stable",
},
{
@@ -17,7 +17,7 @@ with limited CPU/memory resources and it is disabled by default.
--- a/chrome/browser/BUILD.gn
+++ b/chrome/browser/BUILD.gn
@@ -2283,6 +2283,7 @@ static_library("browser") {
@@ -2226,6 +2226,7 @@ static_library("browser") {
"//components/net_log",
"//components/network_hints/common:mojo_bindings",
"//components/network_session_configurator/browser",
@@ -32,8 +32,8 @@ with limited CPU/memory resources and it is disabled by default.
#ifndef CHROME_BROWSER_BROMITE_FLAG_CHOICES_H_
#define CHROME_BROWSER_BROMITE_FLAG_CHOICES_H_
+const FeatureEntry::Choice kMaxConnectionsPerHostChoices[] = {
+ {features::kMaxConnectionsPerHostChoiceDefault, "", ""},
+ {features::kMaxConnectionsPerHostChoice15, switches::kMaxConnectionsPerHost, "15"},
+ {flags_ui::kGenericExperimentChoiceDefault, "", ""},
+ {"15", switches::kMaxConnectionsPerHost, "15"},
+};
#endif // CHROME_BROWSER_BROMITE_FLAG_CHOICES_H_
--- a/chrome/browser/bromite_flag_entries.h
@@ -65,7 +65,7 @@ with limited CPU/memory resources and it is disabled by default.
#include "base/synchronization/waitable_event.h"
#include "base/task/sequenced_task_runner.h"
#include "base/task/single_thread_task_runner.h"
@@ -115,6 +117,7 @@
@@ -116,6 +118,7 @@
#include "components/metrics/metrics_service.h"
#include "components/metrics_services_manager/metrics_services_manager.h"
#include "components/metrics_services_manager/metrics_services_manager_client.h"
@@ -73,7 +73,7 @@ with limited CPU/memory resources and it is disabled by default.
#include "components/network_time/network_time_tracker.h"
#include "components/os_crypt/async/browser/os_crypt_async.h"
#include "components/permissions/permissions_client.h"
@@ -149,6 +152,7 @@
@@ -152,6 +155,7 @@
#include "extensions/common/constants.h"
#include "media/media_buildflags.h"
#include "mojo/public/cpp/bindings/pending_receiver.h"
@@ -81,7 +81,7 @@ with limited CPU/memory resources and it is disabled by default.
#include "printing/buildflags/buildflags.h"
#include "services/network/public/cpp/features.h"
#include "services/network/public/cpp/network_switches.h"
@@ -417,6 +421,18 @@ void BrowserProcessImpl::Init() {
@@ -464,6 +468,18 @@ void BrowserProcessImpl::Init() {
pref_change_registrar_.Add(metrics::prefs::kMetricsReportingEnabled,
base::BindRepeating(&ApplyMetricsReportingPolicy));
@@ -93,61 +93,26 @@ with limited CPU/memory resources and it is disabled by default.
+ << " expected integer; got (\"" << switch_value << "\" instead)";
+ }
+ if (max_connections_per_host != 0) {
+ net::ClientSocketPoolManager::set_max_sockets_per_group(
+ net::ClientSocketPoolManager::set_max_sockets_per_group_for_test(
+ net::HttpNetworkSession::NORMAL_SOCKET_POOL, max_connections_per_host);
+ }
+
DCHECK(!webrtc_event_log_manager_);
webrtc_event_log_manager_ = WebRtcEventLogManager::CreateSingletonInstance();
--- a/chrome/browser/flag_descriptions.cc
+++ b/chrome/browser/flag_descriptions.cc
@@ -2671,6 +2671,10 @@ const char kLogJsConsoleMessagesDescript
--- a/chrome/browser/flag_descriptions.h
+++ b/chrome/browser/flag_descriptions.h
@@ -2712,6 +2712,10 @@ inline constexpr char kLogJsConsoleMessa
"Enable logging JS console messages in system logs, please note that they "
"may contain PII.";
+const char kMaxConnectionsPerHostName[] = "Maximum connections per host";
+const char kMaxConnectionsPerHostDescription[] =
+inline constexpr char kMaxConnectionsPerHostName[] = "Maximum connections per host";
+inline constexpr char kMaxConnectionsPerHostDescription[] =
+ "Customize maximum allowed connections per host. ungoogled-chromium flag, Bromite feature.";
+
const char kMediaRouterCastAllowAllIPsName[] =
inline constexpr char kMediaRouterCastAllowAllIPsName[] =
"Connect to Cast devices on all IP addresses";
const char kMediaRouterCastAllowAllIPsDescription[] =
--- a/chrome/browser/flag_descriptions.h
+++ b/chrome/browser/flag_descriptions.h
@@ -1567,6 +1567,9 @@ extern const char kLockTopControlsOnLarg
extern const char kLogJsConsoleMessagesName[];
extern const char kLogJsConsoleMessagesDescription[];
+extern const char kMaxConnectionsPerHostName[];
+extern const char kMaxConnectionsPerHostDescription[];
+
extern const char kMediaRouterCastAllowAllIPsName[];
extern const char kMediaRouterCastAllowAllIPsDescription[];
--- a/components/network_session_configurator/common/network_features.cc
+++ b/components/network_session_configurator/common/network_features.cc
@@ -8,4 +8,7 @@
namespace features {
+const char kMaxConnectionsPerHostChoiceDefault[] = "6",
+ kMaxConnectionsPerHostChoice15[] = "15";
+
} // namespace features
--- a/components/network_session_configurator/common/network_features.h
+++ b/components/network_session_configurator/common/network_features.h
@@ -10,6 +10,10 @@
namespace features {
+NETWORK_SESSION_CONFIGURATOR_EXPORT extern const char kMaxConnectionsPerHostChoiceDefault[],
+ kMaxConnectionsPerHostChoice6[],
+ kMaxConnectionsPerHostChoice15[];
+
} // namespace features
#endif // COMPONENTS_NETWORK_SESSION_CONFIGURATOR_COMMON_NETWORK_FEATURES_H_
inline constexpr char kMediaRouterCastAllowAllIPsDescription[] =
--- a/components/network_session_configurator/common/network_switch_list.h
+++ b/components/network_session_configurator/common/network_switch_list.h
@@ -19,6 +19,10 @@ NETWORK_SWITCH(kEnableUserAlternateProto
@@ -159,5 +124,5 @@ with limited CPU/memory resources and it is disabled by default.
+NETWORK_SWITCH(kMaxConnectionsPerHost, "max-connections-per-host")
+
// Ignores certificate-related errors.
NETWORK_SWITCH(kIgnoreCertificateErrors, "ignore-certificate-errors")
// Note: In tests using net::EmbeddedTestServer with a custom hostname not
// covered by the default test certs, using this switch is usually incorrect.
@@ -1,34 +0,0 @@
From c89ce946e5328ca8a7df923d421e904bb6bfe9b6 Mon Sep 17 00:00:00 2001
From: Jan Engelhardt <jengelh@inai.de>
Date: Tue, 7 Jul 2015 18:28:46 +0200
Subject: [PATCH 63/76] safe_browsing: disable reporting of safebrowsing
override
Disables reporting of the safebrowsing override, i.e. the report sent
if a user decides to visit a page that was flagged as "insecure".
This prevents trk:148 (phishing) and trk:149 (malware).
---
components/safe_browsing/content/browser/client_side_detection_service.cc | 5 +++++
1 file changed, 5 insertions(+)
--- a/components/safe_browsing/content/browser/client_side_detection_service.cc
+++ b/components/safe_browsing/content/browser/client_side_detection_service.cc
@@ -281,6 +281,10 @@ void ClientSideDetectionService::StartCl
return;
}
+#if 1
+ if (!callback.is_null())
+ std::move(callback).Run(GURL(request->url()), false, std::nullopt, std::nullopt);
+#else
std::string request_data;
request->SerializeToString(&request_data);
@@ -363,6 +367,7 @@ void ClientSideDetectionService::StartCl
&WebUIContentInfoSingleton::AddToClientPhishingRequestsSent,
base::Unretained(WebUIContentInfoSingleton::GetInstance()),
std::move(request), access_token));
+#endif
}
void ClientSideDetectionService::HandlePhishingVerdict(
@@ -1,69 +0,0 @@
# Disable some background communication with clients2.google.com
--- a/chrome/browser/chrome_content_browser_client.cc
+++ b/chrome/browser/chrome_content_browser_client.cc
@@ -2790,24 +2790,6 @@ void ChromeContentBrowserClient::AppendE
command_line->AppendSwitchASCII(switches::kMetricsClientID,
client_info->client_id);
}
-#elif BUILDFLAG(IS_POSIX)
-#if !BUILDFLAG(IS_ANDROID)
- pid_t pid;
- if (crash_reporter::GetHandlerSocket(nullptr, &pid)) {
- command_line->AppendSwitchASCII(
- crash_reporter::switches::kCrashpadHandlerPid,
- base::NumberToString(pid));
- }
-#endif
- std::string switch_value;
- std::unique_ptr<metrics::ClientInfo> client_info =
- GoogleUpdateSettings::LoadMetricsClientInfo();
- if (client_info) {
- switch_value = client_info->client_id;
- }
- switch_value.push_back(',');
- switch_value.append(chrome::GetChannelName(chrome::WithExtendedStable(true)));
- command_line->AppendSwitchASCII(switches::kEnableCrashReporter, switch_value);
#endif
if (logging::DialogsAreSuppressed()) {
--- a/components/crash/core/app/crashpad.cc
+++ b/components/crash/core/app/crashpad.cc
@@ -72,6 +72,12 @@ void InitializeDatabasePath(const base::
}
bool InitializeCrashpadImpl(bool initial_client,
+ const std::string& a, const std::string& b, const base::FilePath& c,
+ const std::vector<std::string>& d, bool e, const std::vector<base::FilePath>& f) {
+ return false;
+}
+[[maybe_unused]]
+bool DeadInitializeCrashpadImpl(bool initial_client,
const std::string& process_type,
const std::string& user_data_dir,
const base::FilePath& exe_path,
--- a/components/gwp_asan/client/gwp_asan.cc
+++ b/components/gwp_asan/client/gwp_asan.cc
@@ -344,6 +344,11 @@ GWP_ASAN_EXPORT std::optional<AllocatorS
// Exported for testing.
GWP_ASAN_EXPORT std::optional<AllocatorSettings> GetAllocatorSettings(
+ const base::Feature& a, bool b, std::string_view c) {
+ return std::nullopt;
+}
+[[maybe_unused]]
+std::optional<AllocatorSettings> DeadGetAllocatorSettings(
const base::Feature& feature,
bool boost_sampling,
std::string_view process_type) {
--- a/third_party/crashpad/crashpad/client/crashpad_client_linux.cc
+++ b/third_party/crashpad/crashpad/client/crashpad_client_linux.cc
@@ -747,8 +747,6 @@ void CrashpadClient::CrashWithoutDump(co
// static
void CrashpadClient::SetFirstChanceExceptionHandler(
FirstChanceHandler handler) {
- DCHECK(SignalHandler::Get());
- SignalHandler::Get()->SetFirstChanceHandler(handler);
}
// static
@@ -3,7 +3,7 @@ author: Michael Gilbert <mgilbert@debian.org>
--- a/chrome/browser/ui/startup/infobar_utils.cc
+++ b/chrome/browser/ui/startup/infobar_utils.cc
@@ -188,10 +188,6 @@ void AddInfoBarsIfNecessary(BrowserWindo
@@ -180,10 +180,6 @@ void AddInfoBarsIfNecessary(BrowserWindo
infobars::ContentInfoBarManager* infobar_manager =
infobars::ContentInfoBarManager::FromWebContents(web_contents);
@@ -1,326 +0,0 @@
# NOTE: Changes made:
# * Added flag --fingerprinting-canvas-image-data-noise to enable/disable
# Canvas image data fingerprinting deception
# * Removed WebGLDebugRendererInfo disabling in favor of an alternative
# implementation in ungoogled-chromium/disable-webgl-renderer-info.patch
# * Tweak subchannel noise generation to require fewer random number generation
From: csagan5 <32685696+csagan5@users.noreply.github.com>
Date: Sat, 24 Mar 2018 05:18:03 +0100
Subject: Canvas: fingerprinting mitigations for image data and webGL
Disable webGL renderer info and modify the color data returned by ToBlob,
ToDataURL and getImageData so that it will contain randomly manipulated
pixels (maximum 10) that slightly change the color of the R,G,B components
without a visible effect.
Credits to Slaviro (https://github.com/Slaviro) for coming up with a better
approach to change color components.
---
.../platform/graphics/image_data_buffer.cc | 5 +
.../platform/graphics/static_bitmap_image.cc | 154 +++++++++++++++++++++
.../platform/graphics/static_bitmap_image.h | 2 +
4 files changed, 163 insertions(+), 2 deletions(-)
--- a/chrome/browser/bromite_flag_entries.h
+++ b/chrome/browser/bromite_flag_entries.h
@@ -16,4 +16,8 @@
flag_descriptions::kMaxConnectionsPerHostName,
flag_descriptions::kMaxConnectionsPerHostDescription,
kOsAll, MULTI_VALUE_TYPE(kMaxConnectionsPerHostChoices)},
+ {"fingerprinting-canvas-image-data-noise",
+ "Enable Canvas image data fingerprint deception",
+ "Slightly modifies at most 10 pixels in Canvas image data extracted via JS APIs. ungoogled-chromium flag, Bromite feature.",
+ kOsAll, SINGLE_VALUE_TYPE(switches::kFingerprintingCanvasImageDataNoise)},
#endif // CHROME_BROWSER_BROMITE_FLAG_ENTRIES_H_
--- a/content/browser/renderer_host/render_process_host_impl.cc
+++ b/content/browser/renderer_host/render_process_host_impl.cc
@@ -3594,6 +3594,7 @@ void RenderProcessHostImpl::PropagateBro
switches::kFileUrlPathAlias,
switches::kFingerprintingClientRectsNoise,
switches::kFingerprintingCanvasMeasureTextNoise,
+ switches::kFingerprintingCanvasImageDataNoise,
switches::kForceDeviceScaleFactor,
switches::kForceDisplayColorProfile,
switches::kForceHighContrast,
--- a/content/child/runtime_features.cc
+++ b/content/child/runtime_features.cc
@@ -488,6 +488,8 @@ void SetRuntimeFeaturesFromCommandLine(c
switches::kFingerprintingClientRectsNoise, true},
{wrf::EnableFingerprintingCanvasMeasureTextNoise,
switches::kFingerprintingCanvasMeasureTextNoise, true},
+ {wrf::EnableFingerprintingCanvasImageDataNoise,
+ switches::kFingerprintingCanvasImageDataNoise, true},
};
for (const auto& mapping : switchToFeatureMapping) {
--- a/third_party/blink/public/platform/web_runtime_features.h
+++ b/third_party/blink/public/platform/web_runtime_features.h
@@ -73,6 +73,7 @@ class BLINK_PLATFORM_EXPORT WebRuntimeFe
static void EnableFingerprintingClientRectsNoise(bool);
static void EnableFingerprintingCanvasMeasureTextNoise(bool);
+ static void EnableFingerprintingCanvasImageDataNoise(bool);
WebRuntimeFeatures() = delete;
};
--- 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
@@ -558,6 +558,9 @@ ImageData* BaseRenderingContext2D::getIm
snapshot->PaintImageForCurrentFrame().GetSkImageInfo().bounds();
DCHECK(!bounds.intersect(SkIRect::MakeXYWH(sx, sy, sw, sh)));
}
+ if (read_pixels_successful && RuntimeEnabledFeatures::FingerprintingCanvasImageDataNoiseEnabled()) {
+ StaticBitmapImage::ShuffleSubchannelColorData(image_data_pixmap.addr(), image_data_pixmap.info(), sx, sy);
+ }
}
return image_data;
--- a/third_party/blink/renderer/platform/BUILD.gn
+++ b/third_party/blink/renderer/platform/BUILD.gn
@@ -1757,7 +1757,9 @@ component("platform") {
"//third_party/blink/renderer:non_test_config",
]
- include_dirs = []
+ include_dirs = [
+ "//third_party/skia/include/private", # For shuffler in graphics/static_bitmap_image.cc
+ ]
allow_circular_includes_from = [
"//third_party/blink/renderer/platform/blob",
--- a/third_party/blink/renderer/platform/exported/web_runtime_features.cc
+++ b/third_party/blink/renderer/platform/exported/web_runtime_features.cc
@@ -81,4 +81,8 @@ void WebRuntimeFeatures::EnableFingerpri
RuntimeEnabledFeatures::SetFingerprintingCanvasMeasureTextNoiseEnabled(enable);
}
+void WebRuntimeFeatures::EnableFingerprintingCanvasImageDataNoise(bool enable) {
+ RuntimeEnabledFeatures::SetFingerprintingCanvasImageDataNoiseEnabled(enable);
+}
+
} // namespace blink
--- a/third_party/blink/renderer/platform/graphics/static_bitmap_image.cc
+++ b/third_party/blink/renderer/platform/graphics/static_bitmap_image.cc
@@ -4,6 +4,8 @@
#include "third_party/blink/renderer/platform/graphics/static_bitmap_image.h"
+#include "base/rand_util.h"
+#include "base/logging.h"
#include "base/numerics/checked_math.h"
#include "gpu/command_buffer/client/gles2_interface.h"
#include "third_party/blink/renderer/platform/graphics/accelerated_static_bitmap_image.h"
@@ -11,11 +13,13 @@
#include "third_party/blink/renderer/platform/graphics/image_observer.h"
#include "third_party/blink/renderer/platform/graphics/paint/paint_image.h"
#include "third_party/blink/renderer/platform/graphics/unaccelerated_static_bitmap_image.h"
+#include "third_party/blink/renderer/platform/runtime_enabled_features.h"
#include "third_party/blink/renderer/platform/transforms/affine_transform.h"
#include "third_party/skia/include/core/SkCanvas.h"
#include "third_party/skia/include/core/SkImage.h"
#include "third_party/skia/include/core/SkPaint.h"
#include "third_party/skia/include/core/SkSurface.h"
+#include "third_party/skia/src/core/SkColorData.h"
#include "ui/gfx/geometry/skia_conversions.h"
#include "v8/include/v8.h"
@@ -114,4 +118,154 @@ void StaticBitmapImage::DrawHelper(cc::P
ToSkiaRectConstraint(draw_options.clamping_mode));
}
+// set the component to maximum-delta if it is >= maximum, or add to existing color component (color + delta)
+#define shuffleComponent(color, max, delta) ( (color) >= (max) ? ((max)-(delta)) : ((color)+(delta)) )
+
+#define writable_addr(T, p, stride, x, y) (T*)((const char *)p + y * stride + x * sizeof(T))
+
+void StaticBitmapImage::ShuffleSubchannelColorData(const void *addr, const SkImageInfo& info, int srcX, int srcY) {
+ auto w = info.width() - srcX, h = info.height() - srcY;
+
+ // skip tiny images; info.width()/height() can also be 0
+ if ((w < 8) || (h < 8)) {
+ return;
+ }
+
+ // generate the first random number here
+ double shuffleX = base::RandDouble();
+
+ // cap maximum pixels to change
+ auto pixels = (w + h) / 128;
+ if (pixels > 10) {
+ pixels = 10;
+ } else if (pixels < 2) {
+ pixels = 2;
+ }
+
+ auto colorType = info.colorType();
+ auto fRowBytes = info.minRowBytes(); // stride
+
+ DLOG(INFO) << "BRM: ShuffleSubchannelColorData() w=" << w << " h=" << h << " colorType=" << colorType << " fRowBytes=" << fRowBytes;
+
+ // second random number (for y/height)
+ double shuffleY = base::RandDouble();
+
+ // calculate random coordinates using bisection
+ auto currentW = w, currentH = h;
+ for(;pixels >= 0; pixels--) {
+ int x = currentW * shuffleX, y = currentH * shuffleY;
+
+ // calculate randomisation amounts for each RGB component
+ uint8_t shuffleR = base::RandInt(0, 4);
+ uint8_t shuffleG = (shuffleR + x) % 4;
+ uint8_t shuffleB = (shuffleG + y) % 4;
+
+ // manipulate pixel data to slightly change the R, G, B components
+ switch (colorType) {
+ case kAlpha_8_SkColorType:
+ {
+ auto *pixel = writable_addr(uint8_t, addr, fRowBytes, x, y);
+ auto r = SkColorGetR(*pixel), g = SkColorGetG(*pixel), b = SkColorGetB(*pixel), a = SkColorGetA(*pixel);
+
+ r = shuffleComponent(r, UINT8_MAX-1, shuffleR);
+ g = shuffleComponent(g, UINT8_MAX-1, shuffleG);
+ b = shuffleComponent(b, UINT8_MAX-1, shuffleB);
+ // alpha is left unchanged
+
+ *pixel = SkColorSetARGB(a, r, g, b);
+ }
+ break;
+ case kGray_8_SkColorType:
+ {
+ auto *pixel = writable_addr(uint8_t, addr, fRowBytes, x, y);
+ *pixel = shuffleComponent(*pixel, UINT8_MAX-1, shuffleB);
+ }
+ break;
+ case kRGB_565_SkColorType:
+ {
+ auto *pixel = writable_addr(uint16_t, addr, fRowBytes, x, y);
+ unsigned r = SkPacked16ToR32(*pixel);
+ unsigned g = SkPacked16ToG32(*pixel);
+ unsigned b = SkPacked16ToB32(*pixel);
+
+ r = shuffleComponent(r, 31, shuffleR);
+ g = shuffleComponent(g, 63, shuffleG);
+ b = shuffleComponent(b, 31, shuffleB);
+
+ unsigned r16 = (r & SK_R16_MASK) << SK_R16_SHIFT;
+ unsigned g16 = (g & SK_G16_MASK) << SK_G16_SHIFT;
+ unsigned b16 = (b & SK_B16_MASK) << SK_B16_SHIFT;
+
+ *pixel = r16 | g16 | b16;
+ }
+ break;
+ case kARGB_4444_SkColorType:
+ {
+ auto *pixel = writable_addr(uint16_t, addr, fRowBytes, x, y);
+ auto a = SkGetPackedA4444(*pixel), r = SkGetPackedR4444(*pixel), g = SkGetPackedG4444(*pixel), b = SkGetPackedB4444(*pixel);
+
+ r = shuffleComponent(r, 15, shuffleR);
+ g = shuffleComponent(g, 15, shuffleG);
+ b = shuffleComponent(b, 15, shuffleB);
+ // alpha is left unchanged
+
+ unsigned a4 = (a & 0xF) << SK_A4444_SHIFT;
+ unsigned r4 = (r & 0xF) << SK_R4444_SHIFT;
+ unsigned g4 = (g & 0xF) << SK_G4444_SHIFT;
+ unsigned b4 = (b & 0xF) << SK_B4444_SHIFT;
+
+ *pixel = r4 | b4 | g4 | a4;
+ }
+ break;
+ case kRGBA_8888_SkColorType:
+ {
+ auto *pixel = writable_addr(uint32_t, addr, fRowBytes, x, y);
+ auto a = SkGetPackedA32(*pixel), r = SkGetPackedR32(*pixel), g = SkGetPackedG32(*pixel), b = SkGetPackedB32(*pixel);
+
+ r = shuffleComponent(r, UINT8_MAX-1, shuffleR);
+ g = shuffleComponent(g, UINT8_MAX-1, shuffleG);
+ b = shuffleComponent(b, UINT8_MAX-1, shuffleB);
+ // alpha is left unchanged
+
+ *pixel = (a << SK_A32_SHIFT) | (r << SK_R32_SHIFT) |
+ (g << SK_G32_SHIFT) | (b << SK_B32_SHIFT);
+ }
+ break;
+ case kBGRA_8888_SkColorType:
+ {
+ auto *pixel = writable_addr(uint32_t, addr, fRowBytes, x, y);
+ auto a = SkGetPackedA32(*pixel), b = SkGetPackedR32(*pixel), g = SkGetPackedG32(*pixel), r = SkGetPackedB32(*pixel);
+
+ r = shuffleComponent(r, UINT8_MAX-1, shuffleR);
+ g = shuffleComponent(g, UINT8_MAX-1, shuffleG);
+ b = shuffleComponent(b, UINT8_MAX-1, shuffleB);
+ // alpha is left unchanged
+
+ *pixel = (a << SK_BGRA_A32_SHIFT) | (r << SK_BGRA_R32_SHIFT) |
+ (g << SK_BGRA_G32_SHIFT) | (b << SK_BGRA_B32_SHIFT);
+ }
+ break;
+ default:
+ // the remaining formats are not expected to be used in Chromium
+ LOG(WARNING) << "BRM: ShuffleSubchannelColorData(): Ignoring pixel format";
+ return;
+ }
+
+ // keep bisecting or reset current width/height as needed
+ if (x == 0) {
+ currentW = w;
+ } else {
+ currentW = x;
+ }
+ if (y == 0) {
+ currentH = h;
+ } else {
+ currentH = y;
+ }
+ }
+}
+
+#undef writable_addr
+#undef shuffleComponent
+
} // namespace blink
--- a/third_party/blink/renderer/platform/graphics/static_bitmap_image.h
+++ b/third_party/blink/renderer/platform/graphics/static_bitmap_image.h
@@ -39,6 +39,8 @@ class PLATFORM_EXPORT StaticBitmapImage
StaticBitmapImage(ImageOrientation orientation) : orientation_(orientation) {}
+ static void ShuffleSubchannelColorData(const void *addr, const SkImageInfo& info, int srcX, int srcY);
+
bool IsStaticBitmapImage() const override { return true; }
// Methods overridden by all sub-classes
--- a/third_party/blink/renderer/platform/image-encoders/image_encoder.cc
+++ b/third_party/blink/renderer/platform/image-encoders/image_encoder.cc
@@ -13,6 +13,8 @@
#include <stdio.h> // Needed by jpeglib.h
#include "jpeglib.h" // for JPEG_MAX_DIMENSION
+#include "third_party/blink/renderer/platform/graphics/static_bitmap_image.h"
+#include "third_party/blink/renderer/platform/runtime_enabled_features.h"
#include "third_party/libwebp/src/src/webp/encode.h" // for WEBP_MAX_DIMENSION
namespace blink {
@@ -44,6 +46,10 @@ bool ImageEncoder::Encode(Vector<unsigne
const SkPixmap& src,
ImageEncodingMimeType mime_type,
double quality) {
+ if (RuntimeEnabledFeatures::FingerprintingCanvasImageDataNoiseEnabled()) {
+ // shuffle subchannel color data within the pixmap
+ StaticBitmapImage::ShuffleSubchannelColorData(src.writable_addr(), src.info(), 0, 0);
+ }
switch (mime_type) {
case kMimeTypeJpeg: {
SkJpegEncoder::Options options;
--- a/third_party/blink/renderer/platform/runtime_enabled_features.json5
+++ b/third_party/blink/renderer/platform/runtime_enabled_features.json5
@@ -2350,6 +2350,9 @@
name: "FingerprintingCanvasMeasureTextNoise",
},
{
+ name: "FingerprintingCanvasImageDataNoise",
+ },
+ {
name: "Fledge",
status: "stable",
base_feature: "none",
@@ -1,12 +0,0 @@
--- a/chrome/browser/ui/startup/google_api_keys_infobar_delegate.cc
+++ b/chrome/browser/ui/startup/google_api_keys_infobar_delegate.cc
@@ -17,9 +17,6 @@
// static
void GoogleApiKeysInfoBarDelegate::Create(
infobars::ContentInfoBarManager* infobar_manager) {
- infobar_manager->AddInfoBar(
- CreateConfirmInfoBar(std::unique_ptr<ConfirmInfoBarDelegate>(
- new GoogleApiKeysInfoBarDelegate())));
}
GoogleApiKeysInfoBarDelegate::GoogleApiKeysInfoBarDelegate() = default;
@@ -1,17 +0,0 @@
--- a/sandbox/linux/BUILD.gn
+++ b/sandbox/linux/BUILD.gn
@@ -299,6 +299,14 @@ if (is_linux || is_chromeos) {
"suid/process_util_linux.c",
"suid/sandbox.c",
]
+
+ cflags = [
+ "-fPIE",
+ ]
+
+ ldflags = [
+ "-pie",
+ ]
}
}
@@ -1,31 +0,0 @@
From d32e222a2706cb59f9855b9cf4330f88d1af5435 Mon Sep 17 00:00:00 2001
From: Jan Engelhardt <jengelh@inai.de>
Date: Thu, 2 Apr 2015 12:44:23 +0200
Subject: [PATCH 41/66] Remove EV certificates
The team chose to let EV certificates appear just like normal
certificates. The web of trust is considered a failure in itself, so
do not give users a false sense of extra security with EV certs.
Instead, let them appear just like regular ones.
--- a/net/cert/ev_root_ca_metadata.cc
+++ b/net/cert/ev_root_ca_metadata.cc
@@ -36,7 +36,17 @@ struct EVMetadata {
const std::string_view policy_oids[kMaxOIDsPerCA];
};
-#include "net/data/ssl/chrome_root_store/chrome-ev-roots-inc.cc"
+static const EVMetadata kEvRootCaMetadata[] = {
+ // need some dummy thing to make compiler happy, because
+ // arraysize() is implemented as a convoluted template rather than
+ // the traditional sizeof(x)/sizeof(*x)
+ { { { 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff,
+ 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff } },
+ {
+ "0",
+ }
+ }
+};
#endif // defined(PLATFORM_USES_CHROMIUM_EV_METADATA)
} // namespace
@@ -1,21 +0,0 @@
From d3dcad96b3c2091026c3a81054bb3ce56538a702 Mon Sep 17 00:00:00 2001
From: Jan Engelhardt <jengelh@inai.de>
Date: Thu, 29 Jan 2015 10:46:40 +0100
Subject: [PATCH 16/66] mime_util: force text/x-suse-ymp to be downloaded
YMP files (YaST One Click Install) are plaintext XML, but also not
very interesting in themselves. Force them to be stored.
---
components/mime_util/mime_util.cc | 1 +
1 file changed, 1 insertion(+)
--- a/third_party/blink/common/mime_util/mime_util.cc
+++ b/third_party/blink/common/mime_util/mime_util.cc
@@ -88,6 +88,7 @@ constexpr auto kUnsupportedTextTypes =
"text/x-csv",
"text/x-vcf",
"text/rtf",
+ "text/x-suse-ymp",
"text/comma-separated-values",
"text/csv",
"text/tab-separated-values",
@@ -1,21 +0,0 @@
--- a/chrome/browser/ui/views/frame/tab_strip_region_view.cc
+++ b/chrome/browser/ui/views/frame/tab_strip_region_view.cc
@@ -84,6 +84,7 @@ class FrameGrabHandle : public views::Vi
// Reserve some space for the frame to be grabbed by, even if the tabstrip
// is full.
// TODO(tbergquist): Define this relative to the NTB insets again.
+ if (base::CommandLine::ForCurrentProcess()->HasSwitch("remove-grab-handle")) return gfx::Size(0, 0);
return gfx::Size(42, 0);
}
};
--- a/chrome/browser/ungoogled_flag_entries.h
+++ b/chrome/browser/ungoogled_flag_entries.h
@@ -68,4 +68,8 @@
"Disable QR Generator",
"Disables the QR generator for sharing page links. ungoogled-chromium flag",
kOsDesktop, FEATURE_VALUE_TYPE(kDisableQRGenerator)},
+ {"remove-grab-handle",
+ "Remove Grab Handle",
+ "Removes the reserved empty space in the tabstrip for moving the window. ungoogled-chromium flag",
+ kOsDesktop, SINGLE_VALUE_TYPE("remove-grab-handle")},
#endif // CHROME_BROWSER_UNGOOGLED_FLAG_ENTRIES_H_
@@ -1,49 +0,0 @@
--- a/chrome/browser/ui/qrcode_generator/qrcode_generator_bubble_controller.cc
+++ b/chrome/browser/ui/qrcode_generator/qrcode_generator_bubble_controller.cc
@@ -13,6 +13,7 @@
#include "chrome/common/pref_names.h"
#include "components/prefs/pref_change_registrar.h"
#include "components/prefs/pref_service.h"
+#include "components/sharing_message/features.h"
#include "content/public/browser/web_contents.h"
#include "url/gurl.h"
@@ -38,7 +39,7 @@ QRCodeGeneratorBubbleController::~QRCode
// static
bool QRCodeGeneratorBubbleController::IsGeneratorAvailable(const GURL& url) {
- if (!url.SchemeIsHTTPOrHTTPS()) {
+ if (!url.SchemeIsHTTPOrHTTPS() || base::FeatureList::IsEnabled(kDisableQRGenerator)) {
return false;
}
--- a/chrome/browser/ungoogled_flag_entries.h
+++ b/chrome/browser/ungoogled_flag_entries.h
@@ -64,4 +64,8 @@
"Remove Tabsearch Button",
"Removes the tabsearch button from the tabstrip. ungoogled-chromium flag",
kOsDesktop, SINGLE_VALUE_TYPE("remove-tabsearch-button")},
+ {"disable-qr-generator",
+ "Disable QR Generator",
+ "Disables the QR generator for sharing page links. ungoogled-chromium flag",
+ kOsDesktop, FEATURE_VALUE_TYPE(kDisableQRGenerator)},
#endif // CHROME_BROWSER_UNGOOGLED_FLAG_ENTRIES_H_
--- a/components/sharing_message/features.cc
+++ b/components/sharing_message/features.cc
@@ -6,6 +6,8 @@
#include "build/build_config.h"
+BASE_FEATURE(kDisableQRGenerator, "DisableQRGenerator", base::FEATURE_DISABLED_BY_DEFAULT);
+
BASE_FEATURE(kClickToCall, base::FEATURE_DISABLED_BY_DEFAULT);
BASE_FEATURE(kMobilePromoOnDesktop, base::FEATURE_DISABLED_BY_DEFAULT);
--- a/components/sharing_message/features.h
+++ b/components/sharing_message/features.h
@@ -34,4 +34,5 @@ MobilePromoOnDesktopPromoType MobileProm
// notification arm, false otherwise.
bool IsMobilePromoOnDesktopNotificationsEnabled();
+BASE_DECLARE_FEATURE(kDisableQRGenerator);
#endif // COMPONENTS_SHARING_MESSAGE_FEATURES_H_
@@ -1,72 +0,0 @@
--- a/chrome/browser/ui/browser_command_controller.cc
+++ b/chrome/browser/ui/browser_command_controller.cc
@@ -1633,7 +1633,8 @@ void BrowserCommandController::InitComma
command_updater_.UpdateCommandEnabled(IDC_WINDOW_CLOSE_OTHER_TABS,
normal_window);
- const bool enable_tab_search_commands = browser_->is_type_normal();
+ const bool enable_tab_search_commands = browser_->is_type_normal() &&
+ !base::CommandLine::ForCurrentProcess()->HasSwitch("remove-tabsearch-button");
command_updater_.UpdateCommandEnabled(IDC_TAB_SEARCH,
enable_tab_search_commands);
command_updater_.UpdateCommandEnabled(IDC_TAB_SEARCH_CLOSE,
--- a/chrome/browser/ui/ui_features.cc
+++ b/chrome/browser/ui/ui_features.cc
@@ -4,6 +4,7 @@
#include "chrome/browser/ui/ui_features.h"
+#include "base/command_line.h"
#include "base/feature_list.h"
#include "base/metrics/field_trial_params.h"
#include "base/time/time.h"
@@ -613,6 +614,10 @@ static std::string GetCountryCode() {
}
bool HasTabSearchToolbarButton() {
+ if (base::CommandLine::ForCurrentProcess()->HasSwitch("remove-tabsearch-button")) {
+ return false;
+ }
+
static const bool is_tab_search_moving = [] {
if (GetCountryCode() == "us" &&
base::FeatureList::IsEnabled(
--- a/chrome/browser/ui/views/frame/browser_view.cc
+++ b/chrome/browser/ui/views/frame/browser_view.cc
@@ -5088,6 +5088,7 @@ void BrowserView::AddedToWidget() {
toolbar_->Init();
+ if (!base::CommandLine::ForCurrentProcess()->HasSwitch("remove-tabsearch-button"))
if (GetIsNormalType()) {
if (features::HasTabSearchToolbarButton()) {
tab_search_bubble_host_ = std::make_unique<TabSearchBubbleHost>(
--- a/chrome/browser/ui/views/frame/tab_strip_region_view.cc
+++ b/chrome/browser/ui/views/frame/tab_strip_region_view.cc
@@ -4,6 +4,7 @@
#include "chrome/browser/ui/views/frame/tab_strip_region_view.h"
+#include "base/command_line.h"
#include "base/functional/bind.h"
#include "base/strings/utf_string_conversions.h"
#include "base/task/single_thread_task_runner.h"
@@ -209,6 +210,7 @@ TabStripRegionView::TabStripRegionView(s
std::unique_ptr<TabStripActionContainer> tab_strip_action_container;
std::unique_ptr<ProductSpecificationsButton> product_specifications_button;
if (browser &&
+ !base::CommandLine::ForCurrentProcess()->HasSwitch("remove-tabsearch-button") &&
(browser->GetType() == BrowserWindowInterface::Type::TYPE_NORMAL)) {
if (features::HasTabSearchToolbarButton()) {
tab_strip_action_container = std::make_unique<TabStripActionContainer>(
--- a/chrome/browser/ungoogled_flag_entries.h
+++ b/chrome/browser/ungoogled_flag_entries.h
@@ -60,4 +60,8 @@
"Clear data on exit",
"Clears all browsing data on exit. ungoogled-chromium flag",
kOsDesktop, FEATURE_VALUE_TYPE(features::kClearDataOnExit)},
+ {"remove-tabsearch-button",
+ "Remove Tabsearch Button",
+ "Removes the tabsearch button from the tabstrip. ungoogled-chromium flag",
+ kOsDesktop, SINGLE_VALUE_TYPE("remove-tabsearch-button")},
#endif // CHROME_BROWSER_UNGOOGLED_FLAG_ENTRIES_H_
@@ -1,29 +0,0 @@
--- a/chrome/browser/sharing_hub/sharing_hub_features.cc
+++ b/chrome/browser/sharing_hub/sharing_hub_features.cc
@@ -4,6 +4,7 @@
#include "chrome/browser/sharing_hub/sharing_hub_features.h"
+#include "base/command_line.h"
#include "build/build_config.h"
#include "chrome/browser/profiles/profile.h"
#include "chrome/common/pref_names.h"
@@ -36,6 +37,7 @@ bool ScreenshotsDisabledByPolicy(content
} // namespace
bool SharingHubOmniboxEnabled(content::BrowserContext* context) {
+ if (base::CommandLine::ForCurrentProcess()->HasSwitch("disable-sharing-hub")) return false;
#if BUILDFLAG(IS_CHROMEOS)
return false;
#else
--- a/chrome/browser/ungoogled_flag_entries.h
+++ b/chrome/browser/ungoogled_flag_entries.h
@@ -96,4 +96,8 @@
"Custom HTTP Accept Header",
"Set a custom value for the Accept header which is sent by the browser with every HTTP request. (e.g. `text/html,application/xhtml+xml,application/xml;q=0.9,image/webp,*/*;q=0.8`). ungoogled-chromium flag.",
kOsAll, ORIGIN_LIST_VALUE_TYPE("http-accept-header", "")},
+ {"disable-sharing-hub",
+ "Disable Sharing Hub",
+ "Disables the sharing hub button. ungoogled-chromium flag.",
+ kOsDesktop, SINGLE_VALUE_TYPE("disable-sharing-hub")},
#endif // CHROME_BROWSER_UNGOOGLED_FLAG_ENTRIES_H_
@@ -1,247 +0,0 @@
# Disables file download quarantining
--- a/components/download/internal/common/base_file.cc
+++ b/components/download/internal/common/base_file.cc
@@ -26,7 +26,6 @@
#include "components/download/public/common/download_interrupt_reasons_utils.h"
#include "components/download/public/common/download_item.h"
#include "components/download/public/common/download_stats.h"
-#include "components/services/quarantine/quarantine.h"
#include "crypto/hash.h"
#include "crypto/secure_hash.h"
@@ -538,94 +537,10 @@ DownloadInterruptReason BaseFile::Publis
}
#endif // BUILDFLAG(IS_ANDROID)
-namespace {
-
-DownloadInterruptReason QuarantineFileResultToReason(
- quarantine::mojom::QuarantineFileResult result) {
- switch (result) {
- case quarantine::mojom::QuarantineFileResult::OK:
- return DOWNLOAD_INTERRUPT_REASON_NONE;
- case quarantine::mojom::QuarantineFileResult::VIRUS_INFECTED:
- return DOWNLOAD_INTERRUPT_REASON_FILE_VIRUS_INFECTED;
- case quarantine::mojom::QuarantineFileResult::SECURITY_CHECK_FAILED:
- return DOWNLOAD_INTERRUPT_REASON_FILE_SECURITY_CHECK_FAILED;
- case quarantine::mojom::QuarantineFileResult::BLOCKED_BY_POLICY:
- return DOWNLOAD_INTERRUPT_REASON_FILE_BLOCKED;
- case quarantine::mojom::QuarantineFileResult::ACCESS_DENIED:
- return DOWNLOAD_INTERRUPT_REASON_FILE_ACCESS_DENIED;
-
- case quarantine::mojom::QuarantineFileResult::FILE_MISSING:
- // Don't have a good interrupt reason here. This return code means that
- // the file at |full_path_| went missing before QuarantineFile got to
- // look at it. Not expected to happen, but we've seen instances where a
- // file goes missing immediately after BaseFile closes the handle.
- //
- // Intentionally using a different error message than
- // SECURITY_CHECK_FAILED in order to distinguish the two.
- return DOWNLOAD_INTERRUPT_REASON_FILE_FAILED;
-
- case quarantine::mojom::QuarantineFileResult::ANNOTATION_FAILED:
- // This means that the mark-of-the-web couldn't be applied. The file is
- // already on the file system under its final target name.
- //
- // Causes of failed annotations typically aren't transient. E.g. the
- // target file system may not support extended attributes or alternate
- // streams. We are going to allow these downloads to progress on the
- // assumption that failures to apply MOTW can't reliably be introduced
- // remotely.
- return DOWNLOAD_INTERRUPT_REASON_NONE;
- }
- return DOWNLOAD_INTERRUPT_REASON_FILE_FAILED;
-}
-
-} // namespace
-
// static
GURL BaseFile::GetEffectiveAuthorityURL(const GURL& source_url,
const GURL& referrer_url) {
- if (source_url.is_valid()) {
- // http{,s} has an authority and are supported.
- if (source_url.SchemeIsHTTPOrHTTPS())
- return source_url;
-
- // If the download source is file:// ideally we should copy the MOTW from
- // the original file, but given that Chrome/Chromium places strict
- // restrictions on which schemes can reference file:// URLs, this code is
- // going to assume that at this point it's okay to treat this download as
- // being from the local system.
- if (source_url.SchemeIsFile())
return source_url;
-
- // ftp:// has an authority.
- if (source_url.SchemeIs(url::kFtpScheme))
- return source_url;
-
- if (source_url.SchemeIs(url::kBlobScheme))
- return url::Origin::Create(source_url).GetURL();
- }
-
- if (referrer_url.is_valid() && referrer_url.SchemeIsHTTPOrHTTPS())
- return referrer_url;
-
- return GURL();
-}
-
-void BaseFile::OnFileQuarantined(
- quarantine::mojom::QuarantineFileResult result) {
- DCHECK(on_annotation_done_callback_);
- quarantine_service_.reset();
- std::move(on_annotation_done_callback_)
- .Run(QuarantineFileResultToReason(result));
-}
-
-void BaseFile::OnQuarantineServiceError(const GURL& source_url,
- const GURL& referrer_url) {
-#if BUILDFLAG(IS_WIN)
- OnFileQuarantined(quarantine::SetInternetZoneIdentifierDirectly(
- full_path_, source_url, referrer_url));
-#else // !BUILDFLAG(IS_WIN)
- NOTREACHED() << "In-process quarantine service should not have failed.";
-#endif // !BUILDFLAG(IS_WIN)
}
void BaseFile::AnnotateWithSourceInformation(
@@ -635,32 +550,8 @@ void BaseFile::AnnotateWithSourceInforma
const std::optional<url::Origin>& request_initiator,
mojo::PendingRemote<quarantine::mojom::Quarantine> remote_quarantine,
OnAnnotationDoneCallback on_annotation_done_callback) {
- GURL authority_url = GetEffectiveAuthorityURL(source_url, referrer_url);
- if (!remote_quarantine) {
-#if BUILDFLAG(IS_WIN)
- quarantine::mojom::QuarantineFileResult result =
- quarantine::SetInternetZoneIdentifierDirectly(full_path_, authority_url,
- referrer_url);
-#else
- quarantine::mojom::QuarantineFileResult result =
- quarantine::mojom::QuarantineFileResult::ANNOTATION_FAILED;
-#endif
- std::move(on_annotation_done_callback)
- .Run(QuarantineFileResultToReason(result));
- } else {
- quarantine_service_.Bind(std::move(remote_quarantine));
-
- on_annotation_done_callback_ = std::move(on_annotation_done_callback);
-
- quarantine_service_.set_disconnect_handler(base::BindOnce(
- &BaseFile::OnQuarantineServiceError, weak_factory_.GetWeakPtr(),
- authority_url, referrer_url));
-
- quarantine_service_->QuarantineFile(
- full_path_, authority_url, referrer_url, request_initiator, client_guid,
- base::BindOnce(&BaseFile::OnFileQuarantined,
- weak_factory_.GetWeakPtr()));
- }
+ std::move(on_annotation_done_callback)
+ .Run(DOWNLOAD_INTERRUPT_REASON_NONE);
}
} // namespace download
--- a/content/browser/BUILD.gn
+++ b/content/browser/BUILD.gn
@@ -140,7 +140,6 @@ source_set("browser") {
"//components/persistent_cache",
"//components/power_monitor",
"//components/services/filesystem:lib",
- "//components/services/quarantine",
"//components/services/storage",
"//components/services/storage:filesystem_proxy_factory",
"//components/services/storage/dom_storage:local_storage_proto",
--- a/content/browser/file_system_access/file_system_access_safe_move_helper.cc
+++ b/content/browser/file_system_access/file_system_access_safe_move_helper.cc
@@ -14,7 +14,6 @@
#include "base/task/thread_pool.h"
#include "base/thread_annotations.h"
#include "build/build_config.h"
-#include "components/services/quarantine/quarantine.h"
#include "content/browser/file_system_access/features.h"
#include "content/browser/file_system_access/file_system_access_error.h"
#include "content/public/browser/content_browser_client.h"
@@ -231,22 +230,9 @@ void FileSystemAccessSafeMoveHelper::Did
// not exist anymore. In case of error, the source file URL will point to a
// valid filesystem location.
base::OnceCallback<void(base::File::Error)> result_callback;
- if (RequireQuarantine()) {
- GURL referrer_url = manager_->is_off_the_record() ? GURL() : context_.url;
- mojo::Remote<quarantine::mojom::Quarantine> quarantine_remote;
- if (quarantine_connection_callback_) {
- quarantine_connection_callback_.Run(
- quarantine_remote.BindNewPipeAndPassReceiver());
- }
- result_callback =
- base::BindOnce(&FileSystemAccessSafeMoveHelper::DidFileDoQuarantine,
- weak_factory_.GetWeakPtr(), dest_url(), referrer_url,
- std::move(quarantine_remote));
- } else {
result_callback =
base::BindOnce(&FileSystemAccessSafeMoveHelper::DidFileSkipQuarantine,
weak_factory_.GetWeakPtr());
- }
manager_->DoFileSystemOperation(
FROM_HERE, &storage::FileSystemOperationRunner::Move,
std::move(result_callback), source_url(), dest_url(), options_,
@@ -263,7 +249,6 @@ void FileSystemAccessSafeMoveHelper::Did
void FileSystemAccessSafeMoveHelper::DidFileDoQuarantine(
const storage::FileSystemURL& target_url,
const GURL& referrer_url,
- mojo::Remote<quarantine::mojom::Quarantine> quarantine_remote,
base::File::Error result) {
DCHECK_CALLED_ON_VALID_SEQUENCE(sequence_checker_);
@@ -294,40 +279,9 @@ void FileSystemAccessSafeMoveHelper::Did
referrer_url.is_valid() && referrer_url.SchemeIsHTTPOrHTTPS()
? referrer_url
: GURL();
-
- if (quarantine_remote) {
- quarantine::mojom::Quarantine* raw_quarantine = quarantine_remote.get();
- raw_quarantine->QuarantineFile(
- target_url.path(), authority_url, referrer_url,
- // TODO(crbug.com/351165321): Consider propagating request_initiator
- // information here.
- /*request_initiator=*/std::nullopt,
- GetContentClient()
- ->browser()
- ->GetApplicationClientGUIDForQuarantineCheck(),
- mojo::WrapCallbackWithDefaultInvokeIfNotRun(
- base::BindOnce(&FileSystemAccessSafeMoveHelper::DidAnnotateFile,
- weak_factory_.GetWeakPtr(),
- std::move(quarantine_remote)),
- quarantine::mojom::QuarantineFileResult::ANNOTATION_FAILED));
- } else {
-#if BUILDFLAG(IS_WIN)
- base::ThreadPool::PostTaskAndReplyWithResult(
- FROM_HERE, {base::MayBlock()},
- base::BindOnce(&quarantine::SetInternetZoneIdentifierDirectly,
- target_url.path(), authority_url, referrer_url),
- base::BindOnce(&FileSystemAccessSafeMoveHelper::DidAnnotateFile,
- weak_factory_.GetWeakPtr(),
- std::move(quarantine_remote)));
-#else
- DidAnnotateFile(std::move(quarantine_remote),
- quarantine::mojom::QuarantineFileResult::ANNOTATION_FAILED);
-#endif
- }
}
void FileSystemAccessSafeMoveHelper::DidAnnotateFile(
- mojo::Remote<quarantine::mojom::Quarantine> quarantine_remote,
quarantine::mojom::QuarantineFileResult result) {
DCHECK_CALLED_ON_VALID_SEQUENCE(sequence_checker_);
--- a/content/browser/file_system_access/file_system_access_safe_move_helper.h
+++ b/content/browser/file_system_access/file_system_access_safe_move_helper.h
@@ -66,10 +66,8 @@ class CONTENT_EXPORT FileSystemAccessSaf
void DidFileDoQuarantine(
const storage::FileSystemURL& target_url,
const GURL& referrer_url,
- mojo::Remote<quarantine::mojom::Quarantine> quarantine_remote,
base::File::Error result);
void DidAnnotateFile(
- mojo::Remote<quarantine::mojom::Quarantine> quarantine_remote,
quarantine::mojom::QuarantineFileResult result);
void ComputeHashForSourceFile(HashCallback callback);
@@ -1,11 +0,0 @@
--- a/components/download/public/common/download_features.cc
+++ b/components/download/public/common/download_features.cc
@@ -38,7 +38,7 @@ BASE_FEATURE(kRefreshExpirationDate, bas
BASE_FEATURE(kDisplayInitiatorOrigin,
"DownloadsDisplayInitiatorOrigin",
- base::FEATURE_ENABLED_BY_DEFAULT);
+ base::FEATURE_DISABLED_BY_DEFAULT);
BASE_FEATURE(kDownloadNotificationServiceUnifiedAPI,
#if BUILDFLAG(IS_ANDROID)
@@ -1,112 +0,0 @@
# Enable extra locales not normally shipped with Chromium on desktop
--- a/build/config/locales.gni
+++ b/build/config/locales.gni
@@ -186,12 +186,6 @@ _non_android_locales = [ "cy" ]
# Setup |platform_pak_locales| for each platform.
platform_pak_locales = all_chrome_locales
-if (is_android) {
- platform_pak_locales -= _non_android_locales
- extended_locales -= _non_android_locales
-} else {
- platform_pak_locales -= extended_locales
-}
# The base list for all platforms except Android excludes the extended locales.
# Add or subtract platform specific locales below.
--- a/chrome/app/resources/locale_settings_linux.grd
+++ b/chrome/app/resources/locale_settings_linux.grd
@@ -4,11 +4,11 @@
<output filename="grit/platform_locale_settings.h" type="rc_header">
<emit emit_type='prepend'></emit>
</output>
- <if expr="is_android">
<output filename="platform_locale_settings_as.pak" type="data_package" lang="as" />
<output filename="platform_locale_settings_az.pak" type="data_package" lang="az" />
<output filename="platform_locale_settings_be.pak" type="data_package" lang="be" />
<output filename="platform_locale_settings_bs.pak" type="data_package" lang="bs" />
+ <output filename="platform_locale_settings_cy.pak" type="data_package" lang="cy" />
<output filename="platform_locale_settings_eu.pak" type="data_package" lang="eu" />
<output filename="platform_locale_settings_fr-CA.pak" type="data_package" lang="fr-CA" />
<output filename="platform_locale_settings_gl.pak" type="data_package" lang="gl" />
@@ -31,7 +31,6 @@
<output filename="platform_locale_settings_uz.pak" type="data_package" lang="uz" />
<output filename="platform_locale_settings_zh-HK.pak" type="data_package" lang="zh-HK" />
<output filename="platform_locale_settings_zu.pak" type="data_package" lang="zu" />
- </if>
<output filename="platform_locale_settings_af.pak" type="data_package" lang="af" />
<output filename="platform_locale_settings_am.pak" type="data_package" lang="am" />
<output filename="platform_locale_settings_ar.pak" type="data_package" lang="ar" />
--- a/chrome/app/resources/locale_settings_mac.grd
+++ b/chrome/app/resources/locale_settings_mac.grd
@@ -4,6 +4,33 @@
<output filename="grit/platform_locale_settings.h" type="rc_header">
<emit emit_type='prepend'></emit>
</output>
+ <output filename="platform_locale_settings_as.pak" type="data_package" lang="as" />
+ <output filename="platform_locale_settings_az.pak" type="data_package" lang="az" />
+ <output filename="platform_locale_settings_be.pak" type="data_package" lang="be" />
+ <output filename="platform_locale_settings_bs.pak" type="data_package" lang="bs" />
+ <output filename="platform_locale_settings_cy.pak" type="data_package" lang="cy" />
+ <output filename="platform_locale_settings_eu.pak" type="data_package" lang="eu" />
+ <output filename="platform_locale_settings_fr-CA.pak" type="data_package" lang="fr-CA" />
+ <output filename="platform_locale_settings_gl.pak" type="data_package" lang="gl" />
+ <output filename="platform_locale_settings_hy.pak" type="data_package" lang="hy" />
+ <output filename="platform_locale_settings_is.pak" type="data_package" lang="is" />
+ <output filename="platform_locale_settings_ka.pak" type="data_package" lang="ka" />
+ <output filename="platform_locale_settings_kk.pak" type="data_package" lang="kk" />
+ <output filename="platform_locale_settings_km.pak" type="data_package" lang="km" />
+ <output filename="platform_locale_settings_ky.pak" type="data_package" lang="ky" />
+ <output filename="platform_locale_settings_lo.pak" type="data_package" lang="lo" />
+ <output filename="platform_locale_settings_mk.pak" type="data_package" lang="mk" />
+ <output filename="platform_locale_settings_mn.pak" type="data_package" lang="mn" />
+ <output filename="platform_locale_settings_my.pak" type="data_package" lang="my" />
+ <output filename="platform_locale_settings_ne.pak" type="data_package" lang="ne" />
+ <output filename="platform_locale_settings_or.pak" type="data_package" lang="or" />
+ <output filename="platform_locale_settings_pa.pak" type="data_package" lang="pa" />
+ <output filename="platform_locale_settings_si.pak" type="data_package" lang="si" />
+ <output filename="platform_locale_settings_sq.pak" type="data_package" lang="sq" />
+ <output filename="platform_locale_settings_sr-Latn.pak" type="data_package" lang="sr-Latn" />
+ <output filename="platform_locale_settings_uz.pak" type="data_package" lang="uz" />
+ <output filename="platform_locale_settings_zh-HK.pak" type="data_package" lang="zh-HK" />
+ <output filename="platform_locale_settings_zu.pak" type="data_package" lang="zu" />
<output filename="platform_locale_settings_af.pak" type="data_package" lang="af" />
<output filename="platform_locale_settings_am.pak" type="data_package" lang="am" />
<output filename="platform_locale_settings_ar.pak" type="data_package" lang="ar" />
--- a/chrome/app/resources/locale_settings_win.grd
+++ b/chrome/app/resources/locale_settings_win.grd
@@ -4,6 +4,33 @@
<output filename="grit/platform_locale_settings.h" type="rc_header">
<emit emit_type='prepend'></emit>
</output>
+ <output filename="platform_locale_settings_as.pak" type="data_package" lang="as" />
+ <output filename="platform_locale_settings_az.pak" type="data_package" lang="az" />
+ <output filename="platform_locale_settings_be.pak" type="data_package" lang="be" />
+ <output filename="platform_locale_settings_bs.pak" type="data_package" lang="bs" />
+ <output filename="platform_locale_settings_cy.pak" type="data_package" lang="cy" />
+ <output filename="platform_locale_settings_eu.pak" type="data_package" lang="eu" />
+ <output filename="platform_locale_settings_fr-CA.pak" type="data_package" lang="fr-CA" />
+ <output filename="platform_locale_settings_gl.pak" type="data_package" lang="gl" />
+ <output filename="platform_locale_settings_hy.pak" type="data_package" lang="hy" />
+ <output filename="platform_locale_settings_is.pak" type="data_package" lang="is" />
+ <output filename="platform_locale_settings_ka.pak" type="data_package" lang="ka" />
+ <output filename="platform_locale_settings_kk.pak" type="data_package" lang="kk" />
+ <output filename="platform_locale_settings_km.pak" type="data_package" lang="km" />
+ <output filename="platform_locale_settings_ky.pak" type="data_package" lang="ky" />
+ <output filename="platform_locale_settings_lo.pak" type="data_package" lang="lo" />
+ <output filename="platform_locale_settings_mk.pak" type="data_package" lang="mk" />
+ <output filename="platform_locale_settings_mn.pak" type="data_package" lang="mn" />
+ <output filename="platform_locale_settings_my.pak" type="data_package" lang="my" />
+ <output filename="platform_locale_settings_ne.pak" type="data_package" lang="ne" />
+ <output filename="platform_locale_settings_or.pak" type="data_package" lang="or" />
+ <output filename="platform_locale_settings_pa.pak" type="data_package" lang="pa" />
+ <output filename="platform_locale_settings_si.pak" type="data_package" lang="si" />
+ <output filename="platform_locale_settings_sq.pak" type="data_package" lang="sq" />
+ <output filename="platform_locale_settings_sr-Latn.pak" type="data_package" lang="sr-Latn" />
+ <output filename="platform_locale_settings_uz.pak" type="data_package" lang="uz" />
+ <output filename="platform_locale_settings_zh-HK.pak" type="data_package" lang="zh-HK" />
+ <output filename="platform_locale_settings_zu.pak" type="data_package" lang="zu" />
<output filename="platform_locale_settings_af.pak" type="data_package" lang="af" />
<output filename="platform_locale_settings_am.pak" type="data_package" lang="am" />
<output filename="platform_locale_settings_ar.pak" type="data_package" lang="ar" />
@@ -1,77 +0,0 @@
# Add more URL schemes allowed for saving
--- a/chrome/browser/ui/browser_commands.cc
+++ b/chrome/browser/ui/browser_commands.cc
@@ -628,11 +628,6 @@ int GetContentRestrictions(const Browser
CoreTabHelper* core_tab_helper =
CoreTabHelper::FromWebContents(current_tab);
content_restrictions = core_tab_helper->content_restrictions();
- NavigationEntry* last_committed_entry =
- current_tab->GetController().GetLastCommittedEntry();
- if (!content::IsSavableURL(last_committed_entry->GetURL())) {
- content_restrictions |= CONTENT_RESTRICTION_SAVE;
- }
}
return content_restrictions;
}
@@ -2007,8 +2002,7 @@ bool CanSavePage(const Browser* browser)
policy::DownloadRestriction::ALL_FILES) {
return false;
}
- return !browser->is_type_devtools() &&
- !(GetContentRestrictions(browser) & CONTENT_RESTRICTION_SAVE);
+ return true;
}
void Print(BrowserWindowInterface* bwi) {
--- a/components/offline_pages/core/offline_page_model.cc
+++ b/components/offline_pages/core/offline_page_model.cc
@@ -21,7 +21,7 @@ OfflinePageModel::SavePageParams::~SaveP
// static
bool OfflinePageModel::CanSaveURL(const GURL& url) {
- return url.is_valid() && url.SchemeIsHTTPOrHTTPS();
+ return url.is_valid();
}
OfflinePageModel::OfflinePageModel() = default;
--- a/content/common/url_schemes.cc
+++ b/content/common/url_schemes.cc
@@ -24,13 +24,21 @@ namespace {
bool g_registered_url_schemes = false;
const char* const kDefaultSavableSchemes[] = {
+ url::kAboutScheme,
+ url::kBlobScheme,
+ url::kContentScheme,
url::kHttpScheme,
url::kHttpsScheme,
url::kFileScheme,
url::kFileSystemScheme,
kChromeDevToolsScheme,
kChromeUIScheme,
- url::kDataScheme
+ url::kDataScheme,
+ url::kJavaScriptScheme,
+ url::kMailToScheme,
+ url::kWsScheme,
+ url::kWssScheme,
+ kViewSourceScheme
};
// These lists are lazily initialized below and are leaked on shutdown to
--- a/content/public/common/url_utils.cc
+++ b/content/public/common/url_utils.cc
@@ -41,11 +41,7 @@ bool HasWebUIOrigin(const url::Origin& o
}
bool IsSavableURL(const GURL& url) {
- for (auto& scheme : GetSavableSchemes()) {
- if (url.SchemeIs(scheme))
- return true;
- }
- return false;
+ return true;
}
bool IsURLHandledByNetworkStack(const GURL& url) {
@@ -1,34 +0,0 @@
--- a/chrome/browser/ui/views/frame/tab_strip_region_view.cc
+++ b/chrome/browser/ui/views/frame/tab_strip_region_view.cc
@@ -302,12 +302,10 @@ TabStripRegionView::TabStripRegionView(s
new_tab_button_->GetViewAccessibility().SetName(
l10n_util::GetStringUTF16(IDS_ACCNAME_NEWTAB));
-#if BUILDFLAG(IS_LINUX)
// The New Tab Button can be middle-clicked on Linux.
new_tab_button_->SetTriggerableEventFlags(
new_tab_button_->GetTriggerableEventFlags() |
ui::EF_MIDDLE_MOUSE_BUTTON);
-#endif
}
reserved_grab_handle_space_ =
--- a/chrome/browser/ui/views/tabs/tab_strip.cc
+++ b/chrome/browser/ui/views/tabs/tab_strip.cc
@@ -2274,8 +2274,6 @@ void TabStrip::NewTabButtonPressed(const
const ui::MouseEvent& mouse = static_cast<const ui::MouseEvent&>(event);
if (mouse.IsOnlyMiddleMouseButton()) {
- if (ui::Clipboard::IsSupportedClipboardBuffer(
- ui::ClipboardBuffer::kSelection)) {
ui::Clipboard* clipboard = ui::Clipboard::GetForCurrentThread();
CHECK(clipboard)
<< "Clipboard instance is not available, cannot proceed with "
@@ -2286,7 +2284,6 @@ void TabStrip::NewTabButtonPressed(const
if (!clipboard_text.empty()) {
controller_->CreateNewTabWithLocation(clipboard_text);
}
- }
return;
}
}
@@ -1,14 +0,0 @@
--- a/components/dom_distiller/core/css/distilledpage_common.css
+++ b/components/dom_distiller/core/css/distilledpage_common.css
@@ -26,6 +26,11 @@
box-sizing: border-box;
}
+.material-icons {
+ font-family: Material Icons;
+ font-style: normal !important;
+}
+
/* Remove all margins and padding from certain element and add word wrap. */
blockquote,
@@ -1,12 +0,0 @@
# Remove the "--disable-setuid-sandbox" command line flag as a bad flag
--- a/chrome/browser/ui/startup/bad_flags_prompt.cc
+++ b/chrome/browser/ui/startup/bad_flags_prompt.cc
@@ -77,7 +77,6 @@ const char* const kBadFlags[] = {
sandbox::policy::switches::kDisableGpuSandbox,
sandbox::policy::switches::kDisableLandlockSandbox,
sandbox::policy::switches::kDisableSeccompFilterSandbox,
- sandbox::policy::switches::kDisableSetuidSandbox,
sandbox::policy::switches::kNoSandbox,
#if BUILDFLAG(IS_WIN)
sandbox::policy::switches::kAllowThirdPartyModules,
@@ -24,7 +24,7 @@
bool ValidateExtensionLocales(const base::FilePath& extension_path,
--- a/extensions/common/extension_l10n_util.cc
+++ b/extensions/common/extension_l10n_util.cc
@@ -18,14 +18,18 @@
@@ -17,14 +17,18 @@
#include "base/files/file_enumerator.h"
#include "base/files/file_util.h"
#include "base/json/json_file_value_serializer.h"
@@ -43,7 +43,7 @@
#include "extensions/common/constants.h"
#include "extensions/common/error_utils.h"
#include "extensions/common/extension.h"
@@ -38,6 +42,7 @@
@@ -37,6 +41,7 @@
#include "third_party/icu/source/common/unicode/uloc.h"
#include "third_party/zlib/google/compression_utils.h"
#include "ui/base/l10n/l10n_util.h"
@@ -51,7 +51,7 @@
namespace errors = extensions::manifest_errors;
namespace keys = extensions::manifest_keys;
@@ -114,6 +119,19 @@ std::optional<base::Value::Dict> LoadMes
@@ -113,6 +118,19 @@ std::optional<base::Value::Dict> LoadMes
return dictionary;
}
@@ -71,7 +71,7 @@
// Localizes manifest value of string type for a given key.
bool LocalizeManifestValue(const std::string& key,
const extensions::MessageBundle& messages,
@@ -361,13 +379,16 @@ bool LocalizeManifest(const extensions::
@@ -360,13 +378,16 @@ bool LocalizeManifest(const extensions::
bool LocalizeExtension(const base::FilePath& extension_path,
base::Value::Dict* manifest,
GzippedMessagesPermission gzip_permission,
@@ -90,7 +90,7 @@
gzip_permission, error));
if (!message_bundle && !error->empty())
@@ -505,6 +526,42 @@ extensions::MessageBundle* LoadMessageCa
@@ -504,6 +525,42 @@ extensions::MessageBundle* LoadMessageCa
return extensions::MessageBundle::Create(catalogs, error);
}
@@ -132,7 +132,7 @@
+
bool ValidateExtensionLocales(const base::FilePath& extension_path,
const base::Value::Dict& manifest,
std::string* error) {
std::u16string* error) {
--- a/extensions/browser/l10n_file_util.h
+++ b/extensions/browser/l10n_file_util.h
@@ -47,7 +47,8 @@ LoadMessageBundleSubstitutionMapFromPath
@@ -189,7 +189,7 @@
base::FilePath GetComputedHashesPath(const base::FilePath& extension_path);
--- a/extensions/common/file_util.cc
+++ b/extensions/common/file_util.cc
@@ -593,6 +593,25 @@ MessageBundle* LoadMessageBundle(
@@ -605,6 +605,25 @@ MessageBundle* LoadMessageBundle(
return message_bundle;
}
@@ -202,7 +202,7 @@
+ std::set<std::string> chrome_locales;
+ extension_l10n_util::GetAllLocales(&chrome_locales);
+
+ if (default_locale.empty() || !base::Contains(chrome_locales, default_locale)) {
+ if (default_locale.empty() || !chrome_locales.contains(default_locale)) {
+ *error = l10n_util::GetStringUTF8(
+ IDS_EXTENSION_LOCALES_NO_DEFAULT_LOCALE_SPECIFIED);
+ return nullptr;
@@ -217,7 +217,7 @@
.Append(kVerifiedContentsFilename);
--- a/extensions/browser/renderer_startup_helper.cc
+++ b/extensions/browser/renderer_startup_helper.cc
@@ -608,6 +608,18 @@ void RendererStartupHelper::GetMessageBu
@@ -731,6 +731,18 @@ void RendererStartupHelper::GetMessageBu
paths_to_load.push_back(imported_extension->path());
}
@@ -1,6 +1,6 @@
--- a/chrome/browser/extensions/api/storage/managed_value_store_cache.cc
+++ b/chrome/browser/extensions/api/storage/managed_value_store_cache.cc
@@ -97,9 +97,11 @@ class ManagedValueStoreCache::ExtensionT
@@ -98,9 +98,11 @@ class ManagedValueStoreCache::ExtensionT
// Loads the schemas of the |extensions| and passes a ComponentMap to
// Register().
@@ -13,7 +13,7 @@
raw_ptr<Profile> profile_;
policy::PolicyDomain policy_domain_;
@@ -178,6 +180,22 @@ bool ManagedValueStoreCache::ExtensionTr
@@ -179,6 +181,22 @@ bool ManagedValueStoreCache::ExtensionTr
return extension->manifest()->FindPath(manifest_keys::kStorageManagedSchema);
}
@@ -36,7 +36,7 @@
// static
void ManagedValueStoreCache::ExtensionTracker::LoadSchemasOnFileTaskRunner(
ExtensionSet extensions,
@@ -202,14 +220,21 @@ void ManagedValueStoreCache::ExtensionTr
@@ -208,14 +226,21 @@ void ManagedValueStoreCache::ExtensionTr
content::GetUIThreadTaskRunner({})->PostTask(
FROM_HERE, base::BindOnce(&ExtensionTracker::Register, self,
@@ -126,7 +126,7 @@
--- a/chrome/common/extensions/BUILD.gn
+++ b/chrome/common/extensions/BUILD.gn
@@ -83,6 +83,7 @@ source_set("extensions") {
@@ -82,6 +82,7 @@ source_set("extensions") {
"//components/url_formatter",
"//components/version_info",
"//extensions:extensions_resources",
@@ -134,7 +134,7 @@
"//extensions/common",
"//extensions/common:common_constants",
"//extensions/common:core_api_provider",
@@ -90,6 +91,7 @@ source_set("extensions") {
@@ -89,6 +90,7 @@ source_set("extensions") {
"//extensions/strings",
"//ui/gfx/geometry",
"//ui/message_center/public/cpp",
@@ -1,6 +1,6 @@
--- a/chrome/common/pref_names.h
+++ b/chrome/common/pref_names.h
@@ -1407,6 +1407,11 @@ inline constexpr char kExtensionCommands
@@ -1415,6 +1415,11 @@ inline constexpr char kExtensionCommands
inline constexpr char kPluginsAlwaysOpenPdfExternally[] =
"plugins.always_open_pdf_externally";
@@ -14,7 +14,7 @@
inline constexpr char kDefaultBrowserLastDeclined[] =
--- a/chrome/browser/ui/browser_ui_prefs.cc
+++ b/chrome/browser/ui/browser_ui_prefs.cc
@@ -77,6 +77,8 @@ void RegisterBrowserPrefs(PrefRegistrySi
@@ -80,6 +80,8 @@ void RegisterBrowserPrefs(PrefRegistrySi
registry->RegisterIntegerPref(prefs::kDefaultBrowserDeclinedCount, 0);
registry->RegisterTimePref(prefs::kDefaultBrowserFirstShownTime,
base::Time());
@@ -25,7 +25,7 @@
registry->RegisterIntegerPref(prefs::kPdfInfoBarTimesShown, 0);
--- a/chrome/browser/ui/startup/infobar_utils.cc
+++ b/chrome/browser/ui/startup/infobar_utils.cc
@@ -211,6 +211,11 @@ void AddInfoBarsIfNecessary(BrowserWindo
@@ -203,6 +203,11 @@ void AddInfoBarsIfNecessary(BrowserWindo
return;
}
@@ -63,7 +63,25 @@
return true;
--- a/chrome/browser/ui/startup/default_browser_prompt/default_browser_infobar_delegate.cc
+++ b/chrome/browser/ui/startup/default_browser_prompt/default_browser_infobar_delegate.cc
@@ -112,13 +112,15 @@ std::u16string DefaultBrowserInfoBarDele
@@ -7,14 +7,17 @@
#include <memory>
#include "base/types/pass_key.h"
+#include "chrome/browser/browser_process.h"
#include "chrome/browser/infobars/confirm_infobar_creator.h"
#include "chrome/browser/profiles/profile.h"
#include "chrome/browser/ui/startup/default_browser_prompt/default_browser_prompt_prefs.h"
+#include "chrome/common/pref_names.h"
#include "chrome/grit/branded_strings.h"
#include "chrome/grit/generated_resources.h"
#include "components/infobars/core/confirm_infobar_delegate.h"
#include "components/infobars/core/infobar.h"
#include "components/omnibox/browser/vector_icons.h"
+#include "components/prefs/pref_service.h"
#include "components/vector_icons/vector_icons.h"
#include "ui/base/l10n/l10n_util.h"
@@ -68,13 +71,15 @@ std::u16string DefaultBrowserInfoBarDele
}
int DefaultBrowserInfoBarDelegate::GetButtons() const {
@@ -82,7 +100,7 @@
}
bool DefaultBrowserInfoBarDelegate::Accept() {
@@ -155,6 +157,22 @@ bool DefaultBrowserInfoBarDelegate::Acce
@@ -86,6 +91,22 @@ bool DefaultBrowserInfoBarDelegate::Acce
return ConfirmInfoBarDelegate::Accept();
}
@@ -107,7 +125,7 @@
+}
--- a/chrome/browser/ui/startup/default_browser_prompt/default_browser_infobar_delegate.h
+++ b/chrome/browser/ui/startup/default_browser_prompt/default_browser_infobar_delegate.h
@@ -61,7 +61,9 @@ class DefaultBrowserInfoBarDelegate : pu
@@ -47,7 +47,9 @@ class DefaultBrowserInfoBarDelegate : pu
int GetButtons() const override;
std::u16string GetButtonLabel(InfoBarButton button) const override;
bool Accept() override;
@@ -119,7 +137,7 @@
raw_ptr<Profile> profile_;
--- a/chrome/browser/ui/views/infobars/confirm_infobar.cc
+++ b/chrome/browser/ui/views/infobars/confirm_infobar.cc
@@ -126,7 +126,9 @@ void ConfirmInfoBar::Layout(PassKey) {
@@ -222,7 +222,9 @@ void ConfirmInfoBar::Layout(PassKey) {
}
if constexpr (!views::PlatformStyle::kIsOkButtonLeading) {
@@ -31,7 +31,7 @@
#include "base/containers/to_vector.h"
#include "base/feature_list.h"
#include "base/functional/bind.h"
@@ -263,6 +264,10 @@ network::mojom::SSLConfigPtr SSLConfigSe
@@ -269,6 +270,10 @@ network::mojom::SSLConfigPtr SSLConfigSe
config->ech_enabled = ech_enabled_.GetValue();
+13 -12
View File
@@ -9,7 +9,7 @@
])
# If the command finished with a non-zero return code, then report the
@@ -378,7 +378,7 @@ def Main(argv):
@@ -384,7 +384,7 @@ def Main(argv):
# http://lists.apple.com/archives/carbon-dev/2006/Jun/msg00139.html
# BUILD will always be an increasing value, so BUILD_PATH gives us
# something unique that meetings what LS wants.
@@ -43,7 +43,7 @@
return PRODUCT_VERSION;
--- a/chrome/browser/ui/webui/version/version_ui.cc
+++ b/chrome/browser/ui/webui/version/version_ui.cc
@@ -222,6 +222,8 @@ void VersionUI::AddVersionDetailStrings(
@@ -232,6 +232,8 @@ void VersionUI::AddVersionDetailStrings(
VersionProcessorVariation());
// Data strings.
@@ -52,7 +52,7 @@
html_source->AddString(version_ui::kVersion,
version_info::GetVersionNumber());
html_source->AddString(version_ui::kVersionSuffix,
@@ -309,12 +311,14 @@ void VersionUI::AddVersionDetailStrings(
@@ -319,12 +321,14 @@ void VersionUI::AddVersionDetailStrings(
std::u16string VersionUI::GetAnnotatedVersionStringForUi() {
return l10n_util::GetStringFUTF16(
IDS_SETTINGS_ABOUT_PAGE_BROWSER_VERSION,
@@ -162,23 +162,24 @@
background-color: var(--background-color);
--- a/chrome/app/chrome_main_delegate.cc
+++ b/chrome/app/chrome_main_delegate.cc
@@ -367,15 +367,15 @@ bool HandleCreditsSwitch(const base::Com
@@ -365,16 +365,16 @@ bool HandleCreditsSwitch(const base::Com
bool HandleVersionSwitches(const base::CommandLine& command_line) {
#if !BUILDFLAG(IS_MAC)
if (command_line.HasSwitch(switches::kProductVersion)) {
- printf("%s\n", version_info::GetVersionNumber().data());
+ printf("%s\n", version_info::GetHeliumVersionNumber().data());
- UNSAFE_TODO(printf("%s\n", version_info::GetVersionNumber().data()));
+ UNSAFE_TODO(printf("%s\n", version_info::GetHeliumVersionNumber().data()));
return true;
}
#endif
if (command_line.HasSwitch(switches::kVersion)) {
- printf("%s %s %s\n", version_info::GetProductName().data(),
- version_info::GetVersionNumber().data(),
- chrome::GetChannelName(chrome::WithExtendedStable(true)).c_str());
+ printf("%s %s (Chromium %s)\n", version_info::GetProductName().data(),
+ version_info::GetHeliumVersionNumber().data(),
+ version_info::GetVersionNumber().data());
UNSAFE_TODO(printf(
- "%s %s %s\n", version_info::GetProductName().data(),
- version_info::GetVersionNumber().data(),
- chrome::GetChannelName(chrome::WithExtendedStable(true)).c_str()));
+ "%s %s (Chromium %s)\n", version_info::GetProductName().data(),
+ version_info::GetHeliumVersionNumber().data(),
+ version_info::GetVersionNumber().data()));
return true;
}
@@ -1,19 +1,20 @@
--- a/chrome/browser/helium_flag_choices.h
+++ b/chrome/browser/helium_flag_choices.h
@@ -29,6 +29,7 @@ namespace helium {
constexpr const char kDisableEchCommandLine[] = "disable-ech";
constexpr const char kCanvasNoiseCommandLine[] = "fingerprinting-canvas-noise";
constexpr const char kAudioContextJitterCommandLine[] = "fingerprinting-audio-context-jitter";
+ constexpr const char kMiddleClickAutoscrollCommandLine[] = "middle-click-autoscroll";
@@ -32,6 +32,8 @@ namespace helium {
constexpr const char kHeliumNoiseCanvasCommandLine[] = "helium-noise-canvas";
constexpr const char kHeliumNoiseAudioCommandLine[] = "helium-noise-audio";
+ constexpr const char kMiddleClickAutoscrollCommandLine[] = "middle-click-autoscroll";
+
} // namespace helium
#endif /* CHROME_BROWSER_HELIUM_FLAG_CHOICES_H_ */
--- a/chrome/browser/helium_flag_entries.h
+++ b/chrome/browser/helium_flag_entries.h
@@ -24,4 +24,8 @@
"Audio Context fingerprint deception",
"Adds small random jitter (±0.01%) to audio data to prevent fingerprinting. Helium flag.",
kOsAll, FEATURE_VALUE_TYPE(blink::features::kAudioContextJitter)},
@@ -28,4 +28,8 @@
"[Helium Noise] Jitter audio context data",
"Adds insignificant jitter to audio data to deceive AudioContext-based fingerprinting. Helium flag.",
kOsAll, FEATURE_VALUE_TYPE(blink::features::kHeliumNoiseAudio)},
+ {helium::kMiddleClickAutoscrollCommandLine,
+ "Middle Click Autoscroll",
+ "Enables autoscroll on middle click. Helium flag, Chromium feature.",
@@ -21,19 +22,20 @@
#endif /* CHROME_BROWSER_HELIUM_FLAG_ENTRIES_H_ */
--- a/third_party/blink/public/common/features.h
+++ b/third_party/blink/public/common/features.h
@@ -23,6 +23,7 @@ namespace blink {
namespace features {
@@ -44,6 +44,8 @@ BLINK_COMMON_EXPORT BASE_DECLARE_FEATURE
BLINK_COMMON_EXPORT BASE_DECLARE_FEATURE(kHeliumNoiseCanvas);
BLINK_COMMON_EXPORT BASE_DECLARE_FEATURE(kHeliumNoiseAudio);
BLINK_COMMON_EXPORT BASE_DECLARE_FEATURE(kAudioContextJitter);
+BLINK_COMMON_EXPORT BASE_DECLARE_FEATURE(kHeliumMiddleClickAutoscroll);
BLINK_COMMON_EXPORT BASE_DECLARE_FEATURE(kDisableLinkDrag);
BLINK_COMMON_EXPORT BASE_DECLARE_FEATURE(kReducedSystemInfo);
+
// Controls whether to include information about the page's open popup in
// AIPageContent.
BLINK_COMMON_EXPORT BASE_DECLARE_FEATURE(kAIPageContentIncludePopupWindows);
--- a/third_party/blink/common/features.cc
+++ b/third_party/blink/common/features.cc
@@ -23,6 +23,15 @@ BASE_FEATURE(kAudioContextJitter,
"AudioContextJitter",
base::FEATURE_ENABLED_BY_DEFAULT);
@@ -19,6 +19,15 @@
namespace blink::features {
+BASE_FEATURE(kHeliumMiddleClickAutoscroll,
+ "HeliumMiddleClickAutoscroll",
@@ -49,7 +51,7 @@
BASE_FEATURE(kRemoveClientHints, "RemoveClientHints", base::FEATURE_DISABLED_BY_DEFAULT);
--- a/third_party/blink/renderer/core/exported/web_view_impl.cc
+++ b/third_party/blink/renderer/core/exported/web_view_impl.cc
@@ -1905,9 +1905,9 @@ void WebView::ApplyWebPreferences(const
@@ -1928,9 +1928,9 @@ void WebView::ApplyWebPreferences(const
prefs.default_maximum_page_scale_factor);
#endif
+156 -67
View File
@@ -50,7 +50,7 @@
+ "//components/helium_services",
"//components/infobars/core",
"//components/lens:features",
"//components/lens:mime_type",
"//components/lens:lens_url_utils",
--- a/components/search_engines/template_url_data_util.cc
+++ b/components/search_engines/template_url_data_util.cc
@@ -15,6 +15,7 @@
@@ -84,7 +84,7 @@
+}
--- a/components/search_engines/template_url_service.cc
+++ b/components/search_engines/template_url_service.cc
@@ -40,6 +40,8 @@
@@ -39,6 +39,8 @@
#include "base/strings/utf_string_conversions.h"
#include "build/build_config.h"
#include "components/country_codes/country_codes.h"
@@ -93,7 +93,7 @@
#include "components/google/core/common/google_util.h"
#include "components/omnibox/common/omnibox_feature_configs.h"
#include "components/omnibox/common/omnibox_features.h"
@@ -58,7 +60,9 @@
@@ -57,7 +59,9 @@
#include "components/search_engines/search_engines_switches.h"
#include "components/search_engines/search_terms_data.h"
#include "components/search_engines/template_url.h"
@@ -103,7 +103,7 @@
#include "components/search_engines/template_url_prepopulate_data.h"
#include "components/search_engines/template_url_prepopulate_data_resolver.h"
#include "components/search_engines/template_url_service_client.h"
@@ -73,6 +77,7 @@
@@ -72,6 +76,7 @@
#include "components/sync/protocol/search_engine_specifics.pb.h"
#include "components/url_formatter/url_fixer.h"
#include "net/base/registry_controlled_domains/registry_controlled_domain.h"
@@ -111,7 +111,7 @@
#include "url/gurl.h"
#include "url/origin.h"
#include "url/third_party/mozilla/url_parse.h"
@@ -582,6 +587,7 @@ class TemplateURLService::PreLoadingProv
@@ -580,6 +585,7 @@ class TemplateURLService::PreLoadingProv
// TemplateURLService ---------------------------------------------------------
TemplateURLService::TemplateURLService(
PrefService& prefs,
@@ -119,7 +119,7 @@
search_engines::SearchEngineChoiceService& search_engine_choice_service,
TemplateURLPrepopulateData::Resolver& prepopulate_data_resolver,
std::unique_ptr<SearchTermsData> search_terms_data,
@@ -594,6 +600,8 @@ TemplateURLService::TemplateURLService(
@@ -592,6 +598,8 @@ TemplateURLService::TemplateURLService(
prepopulate_data_resolver_(prepopulate_data_resolver),
search_terms_data_(std::move(search_terms_data)),
web_data_service_(web_data_service),
@@ -128,7 +128,7 @@
client_(std::move(client)),
dsp_change_callback_(dsp_change_callback),
pre_loading_providers_(std::make_unique<PreLoadingProviders>()),
@@ -610,11 +618,13 @@ TemplateURLService::TemplateURLService(
@@ -608,11 +616,13 @@ TemplateURLService::TemplateURLService(
TemplateURLService::TemplateURLService(
PrefService& prefs,
@@ -142,7 +142,7 @@
search_engine_choice_service,
prepopulate_data_resolver,
/*search_terms_data=*/std::make_unique<SearchTermsData>(),
@@ -695,6 +705,10 @@ bool TemplateURLService::ShowInActivesLi
@@ -693,6 +703,10 @@ bool TemplateURLService::ShowInActivesLi
}
bool TemplateURLService::HiddenFromLists(const TemplateURL* t_url) const {
@@ -153,7 +153,7 @@
switch (t_url->policy_origin()) {
case TemplateURLData::PolicyOrigin::kDefaultSearchProvider:
return false;
@@ -1524,11 +1538,37 @@ void TemplateURLService::Load() {
@@ -1526,11 +1540,37 @@ void TemplateURLService::Load() {
if (web_data_service_) {
load_handle_ = web_data_service_->GetKeywords(this);
@@ -191,7 +191,7 @@
base::CallbackListSubscription TemplateURLService::RegisterOnLoadedCallback(
base::OnceClosure callback) {
return loaded_ ? base::CallbackListSubscription()
@@ -2512,6 +2552,13 @@ void TemplateURLService::Init() {
@@ -2514,6 +2554,13 @@ void TemplateURLService::Init() {
&TemplateURLService::OnDefaultSearchProviderGUIDChanged,
base::Unretained(this)));
@@ -236,7 +236,7 @@
search_engines::SearchEngineChoiceService& search_engine_choice_service,
TemplateURLPrepopulateData::Resolver& prepopulate_data_resolver,
base::span<const TemplateURLService::Initializer> initializers = {});
@@ -479,6 +483,8 @@ class TemplateURLService final : public
@@ -482,6 +486,8 @@ class TemplateURLService final : public
// OnTemplateURLServiceChanged.
void Load();
@@ -245,7 +245,7 @@
// Registers a callback to be called when the service has loaded.
//
// If the service has already loaded, this function does nothing.
@@ -717,6 +723,8 @@ class TemplateURLService final : public
@@ -720,6 +726,8 @@ class TemplateURLService final : public
void Init();
@@ -254,7 +254,7 @@
// Simulate a loaded `TemplateURLService`.
void ApplyInitializersForTesting(
base::span<const TemplateURLService::Initializer> initializers);
@@ -919,6 +927,10 @@ class TemplateURLService final : public
@@ -922,6 +930,10 @@ class TemplateURLService final : public
// Service used to store entries.
scoped_refptr<KeywordWebDataService> web_data_service_;
@@ -382,7 +382,7 @@
+}
+
+void BangManager::OnSimpleLoaderComplete(
+ std::unique_ptr<std::string> response_body) {
+ std::optional<std::string> response_body) {
+ int response_code = -1;
+ std::string mime_type;
+
@@ -545,7 +545,7 @@
+ scoped_refptr<network::SharedURLLoaderFactory> url_loader_factory,
+ PrefService& prefs
+ );
+ void OnSimpleLoaderComplete(std::unique_ptr<std::string> response_body);
+ void OnSimpleLoaderComplete(std::optional<std::string> response_body);
+ void LoadManifestFromString(const std::string& manifest);
+ BangCategory GetCategoryFromJSONObject(std::string_view sc) const;
+
@@ -565,7 +565,7 @@
+
--- a/components/omnibox/browser/autocomplete_input.cc
+++ b/components/omnibox/browser/autocomplete_input.cc
@@ -739,9 +739,9 @@ bool AutocompleteInput::HasHTTPSScheme(c
@@ -740,9 +740,9 @@ bool AutocompleteInput::HasHTTPSScheme(c
// static
AutocompleteInput::FeaturedKeywordMode
AutocompleteInput::GetFeaturedKeywordMode(std::u16string_view text) {
@@ -577,7 +577,7 @@
return FeaturedKeywordMode::kPrefix;
return FeaturedKeywordMode::kFalse;
}
@@ -909,6 +909,7 @@ std::u16string AutocompleteInput::Autoco
@@ -885,6 +885,7 @@ std::u16string AutocompleteInput::Autoco
const std::u16string& input,
bool trim_leading_whitespace,
std::u16string* remaining_input) {
@@ -585,7 +585,7 @@
// Find end of first token. The AutocompleteController has trimmed leading
// whitespace, so we need not skip over that.
const size_t first_white(input.find_first_of(base::kWhitespaceUTF16));
@@ -917,6 +918,39 @@ std::u16string AutocompleteInput::Autoco
@@ -893,6 +894,39 @@ std::u16string AutocompleteInput::Autoco
return input; // Only one token provided.
}
@@ -678,7 +678,7 @@
--- a/components/search_engines/template_url.cc
+++ b/components/search_engines/template_url.cc
@@ -1693,6 +1693,8 @@ bool TemplateURL::IsBetterThanConflictin
@@ -1759,6 +1759,8 @@ bool TemplateURL::IsBetterThanConflictin
: base::Time(),
// Prefer engines that CANNOT be auto-replaced.
!engine->safe_for_autoreplace(),
@@ -689,7 +689,7 @@
// Favor prepopulated engines over other auto-generated engines.
--- a/components/search_engines/template_url.h
+++ b/components/search_engines/template_url.h
@@ -847,6 +847,8 @@ class TemplateURL {
@@ -848,6 +848,8 @@ class TemplateURL {
starter_pack_id() == template_url_starter_pack_data::kAiMode;
}
@@ -700,7 +700,7 @@
// Sanity check for https://crbug.com/781703.
--- a/components/helium_services/helium_services_helpers.cc
+++ b/components/helium_services/helium_services_helpers.cc
@@ -66,6 +66,11 @@ bool ShouldAccessExtensionService(const
@@ -63,6 +63,11 @@ bool ShouldAccessExtensionService(const
prefs.GetBoolean(prefs::kHeliumExtProxyEnabled);
}
@@ -714,9 +714,9 @@
return GetDummyURL();
--- a/components/helium_services/helium_services_helpers.h
+++ b/components/helium_services/helium_services_helpers.h
@@ -18,6 +18,7 @@ const char kHeliumDefaultOrigin[] =
const char kHeliumDummyOrigin[] =
"https://helium-services-are-disabled.qjz9zk";
@@ -20,6 +20,7 @@ const char kHeliumDummyOrigin[] =
bool ShouldAccessServices(const PrefService& prefs);
+COMPONENT_EXPORT(HELIUM) bool ShouldFetchBangs(const PrefService& prefs);
COMPONENT_EXPORT(HELIUM) bool ShouldAccessExtensionService(const PrefService& prefs);
@@ -724,19 +724,19 @@
COMPONENT_EXPORT(HELIUM) GURL GetDummyURL();
--- a/chrome/browser/ui/webui/settings/settings_localized_strings_provider.cc
+++ b/chrome/browser/ui/webui/settings/settings_localized_strings_provider.cc
@@ -1973,6 +1973,9 @@ void AddPrivacyStrings(content::WebUIDat
{"heliumServicesToggle", IDS_SETTINGS_HELIUM_SERVICES_TOGGLE},
{"heliumServicesToggleDescription",
IDS_SETTINGS_HELIUM_SERVICES_TOGGLE_DESCRIPTION},
@@ -2205,6 +2205,9 @@ void AddPrivacyStrings(content::WebUIDat
IDS_SETTINGS_HELIUM_SERVICES_EXT_PROXY_TOGGLE},
{"heliumExtProxyToggleDescription",
IDS_SETTINGS_HELIUM_SERVICES_EXT_PROXY_TOGGLE_DESCRIPTION},
+ {"heliumBangsToggle", IDS_SETTINGS_HELIUM_SERVICES_BANGS_TOGGLE},
+ {"heliumBangsToggleDescription",
+ IDS_SETTINGS_HELIUM_SERVICES_BANGS_TOGGLE_DESCRIPTION},
{"heliumExtProxyToggle",
IDS_SETTINGS_HELIUM_SERVICES_EXT_PROXY_TOGGLE},
{"heliumExtProxyToggleDescription",
{"heliumOriginOverride", IDS_SETTINGS_HELIUM_SERVICES_OVERRIDE},
{"heliumOriginOverrideDescription",
IDS_SETTINGS_HELIUM_SERVICES_OVERRIDE_DESCRIPTION},
--- a/chrome/app/settings_strings.grdp
+++ b/chrome/app/settings_strings.grdp
@@ -1945,6 +1945,12 @@
@@ -2029,6 +2029,12 @@
<message name="IDS_SETTINGS_HELIUM_SERVICES_EXT_PROXY_TOGGLE_DESCRIPTION" desc="Description of the toggle for enabling/disabling of downloading and proxying extensions">
When enabled, Helium will proxy extension downloads and updates to protect your privacy. When disabled, downloading and updating extensions will not work.
</message>
@@ -751,7 +751,7 @@
</message>
--- a/chrome/browser/resources/settings/privacy_page/services_page.html
+++ b/chrome/browser/resources/settings/privacy_page/services_page.html
@@ -50,6 +50,11 @@
@@ -87,6 +87,11 @@
label="$i18n{heliumExtProxyToggle}"
sub-label="$i18n{heliumExtProxyToggleDescription}">
</settings-toggle-button>
@@ -765,9 +765,9 @@
</template>
--- a/chrome/browser/ui/browser_ui_prefs.cc
+++ b/chrome/browser/ui/browser_ui_prefs.cc
@@ -208,6 +208,7 @@ void RegisterBrowserUserPrefs(user_prefs
{
@@ -215,6 +215,7 @@ void RegisterBrowserUserPrefs(user_prefs
registry->RegisterIntegerPref(prefs::kHeliumSchemaVersion, 0);
registry->RegisterBooleanPref(prefs::kHeliumDisableSchemaAlerts, false);
registry->RegisterBooleanPref(prefs::kHeliumServicesEnabled, true);
+ registry->RegisterBooleanPref(prefs::kHeliumBangsEnabled, true);
registry->RegisterBooleanPref(prefs::kHeliumExtProxyEnabled, true);
@@ -775,7 +775,7 @@
registry->RegisterBooleanPref(prefs::kHeliumDidOnboarding, false);
--- a/chrome/browser/extensions/api/settings_private/prefs_util.cc
+++ b/chrome/browser/extensions/api/settings_private/prefs_util.cc
@@ -357,6 +357,8 @@ const PrefsUtil::TypedPrefMap& PrefsUtil
@@ -365,6 +365,8 @@ const PrefsUtil::TypedPrefMap& PrefsUtil
settings_api::PrefType::kBoolean;
(*s_allowlist)[::prefs::kHeliumExtProxyEnabled] =
settings_api::PrefType::kBoolean;
@@ -786,7 +786,7 @@
(*s_allowlist)[::prefs::kHeliumServicesConsented] =
--- a/components/helium_services/pref_names.h
+++ b/components/helium_services/pref_names.h
@@ -24,6 +24,9 @@ inline constexpr char kHeliumDidOnboardi
@@ -30,6 +30,9 @@ inline constexpr char kHeliumDidOnboardi
inline constexpr char kHeliumExtProxyEnabled[] =
"helium.services.ext_proxy";
@@ -796,9 +796,68 @@
} // namespace prefs
#endif // COMPONENTS_HELIUM_SERVICES_PREF_NAMES_H_
--- a/third_party/metrics_proto/omnibox_event.proto
+++ b/third_party/metrics_proto/omnibox_event.proto
@@ -787,6 +787,8 @@ message OmniboxEventProto {
// or tabbing to it.
TOOLBELT = 9; // Select and activate a search shortcuts action
// from the omnibox toolbelt.
+ RETURN_BANG = 10; // Accept a bang at the end of the query by pressing
+ // the Return/Enter key.
}
optional KeywordModeEntryMethod keyword_mode_entry_method = 20;
--- a/chrome/browser/ui/omnibox/omnibox_edit_model.h
+++ b/chrome/browser/ui/omnibox/omnibox_edit_model.h
@@ -304,6 +304,9 @@ class OmniboxEditModel {
return !is_keyword_hint_ && !keyword_.empty();
}
+ // Accepts the bang at the end of the user query.
+ void MaybeAcceptTrailingBang();
+
// Accepts the current keyword hint as a keyword. `entry_method` indicates how
// the user entered keyword mode.
void AcceptKeyword(
@@ -664,6 +667,10 @@ class OmniboxEditModel {
// triggering is enabled, false otherwise.
bool AllowKeywordSpaceTriggering() const;
+ // Checks whether the user text contains a bang at the end of it
+ // that can be accepted by pressing the Return key.
+ bool HasTrailingBangKeyword() const;
+
// Whether the user just typed a space at the end of a keyword, with or
// without inline autocompletion:
// - youtube| -> youtube | (a space was appended to a keyword)
--- a/chrome/browser/ui/omnibox/omnibox_edit_model.cc
+++ b/chrome/browser/ui/omnibox/omnibox_edit_model.cc
@@ -840,6 +840,17 @@ bool OmniboxEditModel::AcceptKeyword(
@@ -888,6 +888,24 @@ void OmniboxEditModel::OpenSelectionForT
OpenSelection(popup_selection_, timestamp, disposition, via_keyboard);
}
+void OmniboxEditModel::MaybeAcceptTrailingBang() {
+ if (!HasTrailingBangKeyword()) {
+ return;
+ }
+
+ AcceptKeyword(OmniboxEventProto::RETURN_BANG);
+
+ const AutocompleteResult& result = autocomplete_controller()->result();
+ for (size_t i = 0; i < result.size(); i++) {
+ const AutocompleteMatch& match = result.match_at(i);
+
+ if (input_.text() == match.fill_into_edit) {
+ SetPopupSelection(OmniboxPopupSelection(i));
+ return;
+ }
+ }
+}
+
void OmniboxEditModel::AcceptKeyword(
OmniboxEventProto::KeywordModeEntryMethod entry_method) {
TRACE_EVENT0("omnibox", "OmniboxEditModel::AcceptKeyword");
@@ -896,6 +914,17 @@ void OmniboxEditModel::AcceptKeyword(
controller_->StopAutocomplete(/*clear_result=*/false);
@@ -807,16 +866,16 @@
+ keyword_);
+
+ if (turl && turl->bang_id() > 0 && !user_text_.starts_with(u'!')) {
+ AutocompleteMatch match = CurrentMatch(nullptr);
+ if (!match.fill_into_edit.empty()) {
+ AutocompleteMatch match = CurrentMatch();
+ if (match.fill_into_edit.length() > user_text_.length()) {
+ user_text_ = match.fill_into_edit;
+ }
+ }
+
is_keyword_hint_ = false;
SetIsKeywordHint(false);
keyword_mode_entry_method_ = entry_method;
if (original_user_text_with_keyword_.empty()) {
@@ -882,9 +893,6 @@ bool OmniboxEditModel::AcceptKeyword(
@@ -938,9 +967,6 @@ void OmniboxEditModel::AcceptKeyword(
}
base::RecordAction(base::UserMetricsAction("AcceptedKeywordHint"));
@@ -824,35 +883,65 @@
- controller_->client()->GetTemplateURLService()->GetTemplateURLForKeyword(
- keyword_);
EmitEnteredKeywordModeHistogram(entry_method, turl, !user_text_.empty());
return true;
}
@@ -1543,7 +1551,13 @@ void OmniboxEditModel::InternalSetUserTe
std::u16string OmniboxEditModel::MaybeStripKeyword(
const std::u16string& text) const {
- return is_keyword_selected()
+ std::u16string trimmed_text;
+ base::TrimWhitespace(text, base::TRIM_LEADING, &trimmed_text);
+
+ std::u16string actual_keyword = base::ToLowerASCII(
+ AutocompleteInput::SplitKeywordFromInput(trimmed_text, false, nullptr));
+
+ return is_keyword_selected() && actual_keyword == keyword_
? AutocompleteInput::SplitReplacementStringFromInput(text, false)
: text;
@@ -2804,6 +2830,21 @@ bool OmniboxEditModel::AllowKeywordSpace
return GetPrefService()->GetBoolean(omnibox::kKeywordSpaceTriggeringEnabled);
}
@@ -2756,10 +2770,12 @@ bool OmniboxEditModel::MaybeAcceptKeywor
+bool OmniboxEditModel::HasTrailingBangKeyword() const {
+ if (!is_keyword_hint_ || input_.InKeywordMode()
+ || !keyword_.starts_with('!')
+ || !AutocompleteMatch::IsSearchType(current_match_.type)
+ || !GetText().ends_with(keyword_)) {
+ return false;
+ }
+
+ const TemplateURL* turl =
+ controller_->client()->GetTemplateURLService()->GetTemplateURLForKeyword(
+ keyword_);
+
+ return turl && turl->bang_id() > 0;
+}
+
bool OmniboxEditModel::ShouldAcceptKeywordAfterInsertingSpaceAtEnd(
const std::u16string& new_text) {
// Check if the user has disabled space triggering.
@@ -2827,16 +2868,20 @@ bool OmniboxEditModel::ShouldAcceptKeywo
return false;
}
+ std::u16string new_keyword = base::ToLowerASCII(
+ AutocompleteInput::SplitKeywordFromInput(new_text, false, nullptr));
- // `input` must end with space. Typing 'youtube' shouldn't enter
- // keyword mode until the user types a final space.
- if (!IsSpaceCharForAcceptingKeyword(new_text[new_text.length() - 1])) {
+ // Parse the keyword from the input so bang keywords in the middle or at the
+ // end are accepted when the trailing space is typed.
+ std::u16string trimmed_text(
+ base::TrimWhitespace(new_text, base::TRIM_LEADING));
+ const std::u16string new_keyword = base::ToLowerASCII(
+ AutocompleteInput::SplitKeywordFromInput(trimmed_text, false, nullptr));
+
size_t keyword_length = new_text.length() - 1;
- return is_keyword_hint_ && (keyword_.length() == keyword_length) &&
+ return is_keyword_hint_ && new_keyword == keyword_ &&
IsSpaceCharForAcceptingKeyword(new_text[keyword_length]) &&
- !new_text.compare(0, keyword_length, keyword_, 0, keyword_length) &&
AcceptKeyword(OmniboxEventProto::SPACE_AT_END);
}
+ if (new_keyword != keyword_) {
return false;
}
- // Check the rest of the input matches `keyword`. This isn't necessary,
- // `AutocompleteController` shouldn't show keyword hints on the default match
- // for inputs like 'yout '. But that's not a guarantee.
- if (new_text.substr(0, new_text.length() - 1) != keyword_) {
+ // `input` must end with space. Typing 'youtube' shouldn't enter
+ // keyword mode until the user types a final space.
+ if (!IsSpaceCharForAcceptingKeyword(new_text[new_text.length() - 1])) {
return false;
}
--- a/chrome/browser/ui/views/omnibox/omnibox_view_views.cc
+++ b/chrome/browser/ui/views/omnibox/omnibox_view_views.cc
@@ -2015,6 +2015,7 @@ bool OmniboxViewViews::HandleKeyEvent(vi
metric_value);
if (controller()->IsPopupOpen() && !control) {
// Normal case of pressing <return> when the popup is open.
+ controller()->edit_model()->MaybeAcceptTrailingBang();
controller()->edit_model()->OpenSelection(
controller()->edit_model()->GetPopupSelection(), event.time_stamp(),
disposition,
@@ -1,13 +1,13 @@
--- a/chrome/browser/about_flags.cc
+++ b/chrome/browser/about_flags.cc
@@ -40,6 +40,7 @@
@@ -36,6 +36,7 @@
#include "chrome/browser/apps/app_discovery_service/app_discovery_service.h"
#include "chrome/browser/browser_features.h"
#include "chrome/browser/browser_process.h"
+#include "chrome/browser/channel_selection.h"
#include "chrome/browser/devtools/features.h"
#include "chrome/browser/flag_descriptions.h"
#include "chrome/browser/ip_protection/ip_protection_switches.h"
#include "chrome/browser/login_detection/login_detection_util.h"
--- /dev/null
+++ b/chrome/browser/channel_selection.cc
@@ -0,0 +1,28 @@
@@ -90,12 +90,12 @@
"Configures the frame rate the browser is throttled to when Energy Saver is enabled. Helium flag.",
--- a/chrome/browser/BUILD.gn
+++ b/chrome/browser/BUILD.gn
@@ -264,6 +264,8 @@ static_library("browser") {
"btm/btm_browser_signin_detector_factory.h",
"btm/stateful_bounce_counter.cc",
"btm/stateful_bounce_counter.h",
+ "channel_selection.cc",
+ "channel_selection.h",
@@ -263,6 +263,8 @@ static_library("browser") {
"browsing_topics/browsing_topics_service_factory.h",
"chained_back_navigation_tracker.cc",
"chained_back_navigation_tracker.h",
+ "channel_selection.cc",
+ "channel_selection.h",
"child_process_host_flags.h",
"chrome_browser_field_trials.cc",
"chrome_browser_field_trials.h",
@@ -1,8 +1,6 @@
TODO: guard services_page.html with is_mac
--- a/components/helium_services/pref_names.h
+++ b/components/helium_services/pref_names.h
@@ -27,6 +27,9 @@ inline constexpr char kHeliumExtProxyEna
@@ -33,6 +33,9 @@ inline constexpr char kHeliumExtProxyEna
inline constexpr char kHeliumBangsEnabled[] =
"helium.services.bangs";
@@ -14,7 +12,7 @@ TODO: guard services_page.html with is_mac
--- a/components/helium_services/helium_services_helpers.h
+++ b/components/helium_services/helium_services_helpers.h
@@ -20,11 +20,13 @@ const char kHeliumDummyOrigin[] =
@@ -22,11 +22,13 @@ bool ShouldAccessServices(const PrefServ
COMPONENT_EXPORT(HELIUM) bool ShouldFetchBangs(const PrefService& prefs);
COMPONENT_EXPORT(HELIUM) bool ShouldAccessExtensionService(const PrefService& prefs);
@@ -30,15 +28,7 @@ TODO: guard services_page.html with is_mac
PrefChangeRegistrar& registrar, const base::RepeatingClosure& observer);
--- a/components/helium_services/helium_services_helpers.cc
+++ b/components/helium_services/helium_services_helpers.cc
@@ -7,6 +7,7 @@
#include <optional>
#include "base/functional/bind.h"
+#include "base/strings/stringprintf.h"
#include "components/helium_services/pref_names.h"
#include "components/prefs/pref_service.h"
#include "net/base/url_util.h"
@@ -15,6 +16,12 @@
@@ -16,6 +16,12 @@
namespace helium {
@@ -51,7 +41,7 @@ TODO: guard services_page.html with is_mac
std::optional<GURL> GetValidUserOverridenURL(std::string_view user_url_) {
if (user_url_.empty()) {
return std::nullopt;
@@ -76,6 +83,11 @@ bool ShouldFetchBangs(const PrefService&
@@ -73,6 +79,11 @@ bool ShouldFetchBangs(const PrefService&
prefs.GetBoolean(prefs::kHeliumBangsEnabled);
}
@@ -63,7 +53,7 @@ TODO: guard services_page.html with is_mac
GURL GetExtensionUpdateURL(const PrefService& prefs) {
if (!ShouldAccessExtensionService(prefs)) {
return GetDummyURL();
@@ -101,6 +113,20 @@ GURL GetSpellcheckURL(const PrefService&
@@ -98,6 +109,20 @@ GURL GetSpellcheckURL(const PrefService&
return GetServicesBaseURL(prefs).Resolve("/dict/");
}
@@ -86,26 +76,24 @@ TODO: guard services_page.html with is_mac
registrar.Add(prefs::kHeliumServicesEnabled, observer);
--- a/chrome/browser/resources/settings/privacy_page/services_page.html
+++ b/chrome/browser/resources/settings/privacy_page/services_page.html
@@ -62,6 +62,13 @@
@@ -99,6 +99,11 @@
sub-label="$i18n{heliumSpellcheckToggleDescription}">
</settings-toggle-button>
</if>
+ <if expr="is_macosx">
+ <settings-toggle-button id="updatesToggleButton"
+ pref="{{prefs.helium.services.browser_updates}}"
+ label="$i18n{heliumUpdatesToggle}"
+ sub-label="$i18n{heliumUpdatesToggleDescription}">
+ </settings-toggle-button>
+ </if>
+ <settings-toggle-button id="updatesToggleButton"
+ pref="{{prefs.helium.services.browser_updates}}"
+ label="$i18n{heliumUpdatesToggle}"
+ sub-label="$i18n{heliumUpdatesToggleDescription}">
+ </settings-toggle-button>
</cr-collapse>
</div>
</template>
--- a/chrome/browser/ui/webui/settings/settings_localized_strings_provider.cc
+++ b/chrome/browser/ui/webui/settings/settings_localized_strings_provider.cc
@@ -1983,6 +1983,10 @@ void AddPrivacyStrings(content::WebUIDat
IDS_SETTINGS_HELIUM_SERVICES_EXT_PROXY_TOGGLE},
{"heliumExtProxyToggleDescription",
IDS_SETTINGS_HELIUM_SERVICES_EXT_PROXY_TOGGLE_DESCRIPTION},
@@ -2211,6 +2211,10 @@ void AddPrivacyStrings(content::WebUIDat
{"heliumSpellcheckToggle", IDS_SETTINGS_HELIUM_SERVICES_SPELLCHECK_TOGGLE},
{"heliumSpellcheckToggleDescription",
IDS_SETTINGS_HELIUM_SERVICES_SPELLCHECK_TOGGLE_DESCRIPTION},
+ {"heliumUpdatesToggle",
+ IDS_SETTINGS_HELIUM_SERVICES_UPDATE},
+ {"heliumUpdatesToggleDescription",
@@ -115,7 +103,7 @@ TODO: guard services_page.html with is_mac
IDS_SETTINGS_HELIUM_SERVICES_OVERRIDE_DESCRIPTION},
--- a/chrome/browser/extensions/api/settings_private/prefs_util.cc
+++ b/chrome/browser/extensions/api/settings_private/prefs_util.cc
@@ -367,6 +367,8 @@ const PrefsUtil::TypedPrefMap& PrefsUtil
@@ -369,6 +369,8 @@ const PrefsUtil::TypedPrefMap& PrefsUtil
settings_api::PrefType::kBoolean;
(*s_allowlist)[::prefs::kHeliumSpellcheckEnabled] =
settings_api::PrefType::kBoolean;
@@ -126,7 +114,7 @@ TODO: guard services_page.html with is_mac
(*s_allowlist)[::prefs::kHeliumServicesConsented] =
--- a/chrome/browser/ui/browser_ui_prefs.cc
+++ b/chrome/browser/ui/browser_ui_prefs.cc
@@ -219,6 +219,7 @@ void RegisterBrowserUserPrefs(user_prefs
@@ -221,6 +221,7 @@ void RegisterBrowserUserPrefs(user_prefs
registry->RegisterStringPref(prefs::kHeliumServicesOrigin, "");
registry->RegisterBooleanPref(prefs::kHeliumDidOnboarding, false);
registry->RegisterBooleanPref(prefs::kHeliumServicesConsented, false);
@@ -136,16 +124,23 @@ TODO: guard services_page.html with is_mac
registry->RegisterBooleanPref(
--- a/chrome/app/settings_strings.grdp
+++ b/chrome/app/settings_strings.grdp
@@ -1957,6 +1957,12 @@
@@ -2044,6 +2044,19 @@
<message name="IDS_SETTINGS_HELIUM_SERVICES_SPELLCHECK_TOGGLE_DESCRIPTION" desc="Description of the for enabling/disabling of downloading spellcheck files">
Helium will fetch dictionary files used for spell checking when requested. When disabled, spell checking will not work.
</message>
+ <message name="IDS_SETTINGS_HELIUM_SERVICES_UPDATE" desc="Toggle for automatic update downloads">
+ Allow automatic browser updates
+ </message>
+ <message name="IDS_SETTINGS_HELIUM_SERVICES_UPDATE_DESCRIPTION" desc="Description of the toggle for automatic update downloads">
+ Helium will automatically download and install browser updates as they become available. We recommend keeping this setting enabled to ensure you get the latest security patches and features.
+ Allow automatic browser and component updates
+ </message>
+ <if expr="is_macosx">
+ <message name="IDS_SETTINGS_HELIUM_SERVICES_UPDATE_DESCRIPTION" desc="Description of the toggle for automatic update downloads">
+ Helium will automatically download and install browser and component updates as they become available. We recommend keeping this setting enabled to ensure you get the latest features and security updates.
+ </message>
+ </if>
+ <if expr="not is_macosx">
+ <message name="IDS_SETTINGS_HELIUM_SERVICES_UPDATE_DESCRIPTION" desc="Description of the toggle for automatic update downloads">
+ Helium will automatically download and install browser and component updates as they become available. We recommend keeping this setting enabled to ensure you get the latest features and security updates. Automatic core browser updates are not available on this platform yet, but component updates are. Please use external software to keep Helium up to date.
+ </message>
+ </if>
<message name="IDS_SETTINGS_HELIUM_SERVICES_OVERRIDE" desc="Text input for overriding the Helium services server">
Use your own instance of Helium services
</message>
+25 -19
View File
@@ -84,34 +84,40 @@
std::vector<user_data_importer::SourceProfile> DetectSourceProfilesWorker(
--- a/chrome/common/importer/firefox_importer_utils_linux.cc
+++ b/chrome/common/importer/firefox_importer_utils_linux.cc
@@ -9,17 +9,26 @@
#include "base/files/file_util.h"
#include "base/path_service.h"
@@ -51,9 +51,12 @@ constexpr const base::FilePath::CharType
constexpr const base::FilePath::CharType* const kFirefoxProfilesIniSubpath =
FILE_PATH_LITERAL(".mozilla/firefox/profiles.ini");
+constexpr const base::FilePath::CharType* const kZenProfilesIniSubpath =
+ FILE_PATH_LITERAL(".zen/profiles.ini");
+
} // namespace
-base::FilePath GetProfilesINI() {
+base::FilePath _GetProfilesINI(const char* folder) {
base::FilePath ini_file;
// The default location of the profile folder containing user data is
// under user HOME directory in .mozilla/firefox folder on Linux.
+base::FilePath _GetProfilesINI(const base::FilePath::CharType* ini_subpath) {
base::FilePath home;
base::PathService::Get(base::DIR_HOME, &home);
if (!home.empty()) {
- ini_file = home.Append(".mozilla/firefox/profiles.ini");
+ ini_file = home.Append(folder)
+ .Append("profiles.ini");
}
if (base::PathExists(ini_file))
return ini_file;
if (home.empty()) {
@@ -68,7 +71,7 @@ base::FilePath GetProfilesINI() {
for (const auto* profile_storage_base : kFirefoxProfileStorageBasePaths) {
base::FilePath ini_file = home;
ini_file = ini_file.Append(profile_storage_base)
- .Append(kFirefoxProfilesIniSubpath);
+ .Append(ini_subpath);
if (base::PathExists(ini_file)) {
return ini_file;
}
@@ -76,3 +79,11 @@ base::FilePath GetProfilesINI() {
return base::FilePath();
}
+
+base::FilePath GetProfilesINI() {
+ return _GetProfilesINI(".mozilla/firefox");
+ return _GetProfilesINI(kFirefoxProfilesIniSubpath);
+}
+
+base::FilePath GetZenProfilesINI() {
+ return _GetProfilesINI(".zen");
+ return _GetProfilesINI(kZenProfilesIniSubpath);
+}
--- a/chrome/common/importer/firefox_importer_utils_mac.mm
+++ b/chrome/common/importer/firefox_importer_utils_mac.mm
@@ -241,7 +247,7 @@
root.FindStringByDottedPath(current_profile + ".Name")) {
--- a/chrome/common/importer/firefox_importer_utils.h
+++ b/chrome/common/importer/firefox_importer_utils.h
@@ -45,13 +45,17 @@ struct FirefoxDetail {
@@ -41,13 +41,17 @@ struct FirefoxDetail {
std::vector<FirefoxDetail> GetFirefoxDetails(
const std::string& firefox_install_id);
@@ -260,7 +266,7 @@
// Detects version of Firefox and installation path for the given Firefox
// profile.
@@ -62,6 +66,7 @@ bool GetFirefoxVersionAndPathFromProfile
@@ -58,6 +62,7 @@ bool GetFirefoxVersionAndPathFromProfile
// Gets the full path of the profiles.ini file. This file records the profiles
// that can be used by Firefox. Returns an empty path if failed.
base::FilePath GetProfilesINI();
@@ -480,7 +486,7 @@
private:
--- a/chrome/common/importer/profile_import_process_param_traits_macros.h
+++ b/chrome/common/importer/profile_import_process_param_traits_macros.h
@@ -20,11 +20,11 @@
@@ -23,11 +23,11 @@
#if BUILDFLAG(IS_WIN)
IPC_ENUM_TRAITS_MIN_MAX_VALUE(user_data_importer::ImporterType,
user_data_importer::TYPE_UNKNOWN,
@@ -0,0 +1,31 @@
--- a/chrome/browser/ui/views/frame/system_menu_model_builder.cc
+++ b/chrome/browser/ui/views/frame/system_menu_model_builder.cc
@@ -8,6 +8,7 @@
#include "base/strings/utf_string_conversions.h"
#include "build/build_config.h"
#include "chrome/app/chrome_command_ids.h"
+#include "chrome/browser/profiles/profile.h"
#include "chrome/browser/ui/browser_commands.h"
#include "chrome/browser/ui/browser_window/public/browser_window_features.h"
#include "chrome/browser/ui/tabs/features.h"
@@ -25,7 +26,6 @@
#if BUILDFLAG(IS_CHROMEOS)
#include "ash/multi_user/multi_user_window_manager.h"
#include "ash/shell.h"
-#include "chrome/browser/profiles/profile.h"
#include "chrome/browser/ui/ash/multi_user/multi_user_util.h"
#include "chrome/browser/ui/browser_window.h"
#include "chrome/browser/ui/settings_window_manager_chromeos.h"
@@ -97,6 +97,12 @@ void SystemMenuModelBuilder::BuildSystem
model->AddItemWithStringId(IDC_BOOKMARK_ALL_TABS, IDS_BOOKMARK_ALL_TABS);
model->AddItemWithStringId(IDC_NAME_WINDOW, IDS_NAME_WINDOW);
+
+ if (!browser()->profile()->IsOffTheRecord()) {
+ model->AddSeparator(ui::NORMAL_SEPARATOR);
+ model->AddItemWithStringId(IDC_SHOW_CUSTOMIZE_CHROME_SIDE_PANEL,
+ IDS_SHOW_CUSTOMIZE_CHROME_SIDE_PANEL);
+ }
#if BUILDFLAG(ENABLE_GLIC)
#if BUILDFLAG(IS_WIN)
// On Windows we can not remove an item when showing the menu. So only add
+9 -9
View File
@@ -1,6 +1,6 @@
--- a/chrome/browser/renderer_context_menu/render_view_context_menu.cc
+++ b/chrome/browser/renderer_context_menu/render_view_context_menu.cc
@@ -1127,11 +1127,6 @@ void RenderViewContextMenu::InitMenu() {
@@ -1150,11 +1150,6 @@ void RenderViewContextMenu::InitMenu() {
AppendSpellingAndSearchSuggestionItems();
}
@@ -12,15 +12,15 @@
if (editable) {
AppendOtherEditableItems();
}
@@ -2214,7 +2209,6 @@ void RenderViewContextMenu::AppendPageIt
@@ -2265,7 +2260,6 @@ void RenderViewContextMenu::AppendPageIt
IDS_CONTENT_CONTEXT_SAVEPAGEAS);
menu_model_.AddItemWithStringId(IDC_PRINT, IDS_CONTENT_CONTEXT_PRINT);
AppendLiveCaptionItem();
- AppendMediaRouterItem();
if (IsRegionSearchEnabled()) {
AppendRegionSearchItem();
}
@@ -2343,8 +2337,7 @@ void RenderViewContextMenu::AppendMediaR
if (features::IsReadAnythingMenuShuffleExperimentEnabled()) {
// This will be set to false in AppendRegionSearchItem() if it is called.
@@ -2417,8 +2411,7 @@ void RenderViewContextMenu::AppendMediaR
void RenderViewContextMenu::AppendReadAnythingItem() {
// Show Read Anything option if it's not already open in the side panel.
@@ -30,7 +30,7 @@
menu_model_.AddItemWithStringId(IDC_CONTENT_CONTEXT_OPEN_IN_READING_MODE,
IDS_CONTENT_CONTEXT_READING_MODE);
}
@@ -3620,10 +3613,12 @@ void RenderViewContextMenu::ExecuteComma
@@ -3731,10 +3724,12 @@ void RenderViewContextMenu::ExecuteComma
}
void RenderViewContextMenu::AddSpellCheckServiceItem(bool is_checked) {
@@ -43,7 +43,7 @@
if (is_checked) {
menu_model_.AddCheckItemWithStringId(
IDC_CONTENT_CONTEXT_ACCESSIBILITY_LABELS_TOGGLE,
@@ -4000,6 +3995,8 @@ bool RenderViewContextMenu::IsVideoFrame
@@ -4133,6 +4128,8 @@ bool RenderViewContextMenu::IsVideoFrame
bool RenderViewContextMenu::AppendQRCodeGeneratorItem(bool for_image,
bool draw_icon,
bool add_separator) {
@@ -54,7 +54,7 @@
}
--- a/chrome/browser/ui/browser_tab_strip_model_delegate.cc
+++ b/chrome/browser/ui/browser_tab_strip_model_delegate.cc
@@ -310,6 +310,7 @@ void BrowserTabStripModelDelegate::AddTo
@@ -298,6 +298,7 @@ void BrowserTabStripModelDelegate::AddTo
}
bool BrowserTabStripModelDelegate::SupportsReadLater() {
@@ -1,6 +1,6 @@
--- a/chrome/browser/ui/omnibox/omnibox_pedal_implementations.cc
+++ b/chrome/browser/ui/omnibox/omnibox_pedal_implementations.cc
@@ -1990,12 +1990,7 @@ GetPedalImplementations(bool incognito,
@@ -2029,12 +2029,7 @@ GetPedalImplementations(bool incognito,
if (!incognito && !guest) {
add(new OmniboxPedalClearBrowsingData(/*incognito=*/false));
}
@@ -13,7 +13,7 @@
add(new OmniboxPedalPlayChromeDinoGame());
add(new OmniboxPedalManageSiteSettings());
add(new OmniboxPedalManageChromeSettings());
@@ -2007,37 +2002,15 @@ GetPedalImplementations(bool incognito,
@@ -2046,37 +2041,15 @@ GetPedalImplementations(bool incognito,
if (!guest) {
add(new OmniboxPedalClearBrowsingData(incognito));
}
+221
View File
@@ -0,0 +1,221 @@
--- a/components/component_updater/component_updater_url_constants.cc
+++ b/components/component_updater/component_updater_url_constants.cc
@@ -15,9 +15,9 @@ namespace component_updater {
// The value of |kDefaultUrlSource| can be overridden with
// --component-updater=url-source=someurl.
const char kUpdaterJSONDefaultUrl[] =
- "https://update.googleapis.com/service/update2/json";
+ "trk:345:https://update.googleapis.com/service/update2/json";
const char kUpdaterJSONFallbackUrl[] =
- "http://update.googleapis.com/service/update2/json";
+ "trk:346:http://update.googleapis.com/service/update2/json";
} // namespace component_updater
--- a/components/helium_services/helium_services_helpers.cc
+++ b/components/helium_services/helium_services_helpers.cc
@@ -9,6 +9,7 @@
#include "base/functional/bind.h"
#include "base/strings/stringprintf.h"
#include "components/helium_services/pref_names.h"
+#include "components/helium_services/schema.h"
#include "components/prefs/pref_service.h"
#include "net/base/url_util.h"
#include "url/gurl.h"
@@ -84,6 +85,12 @@ bool ShouldAccessUpdateService(const Pre
prefs.GetBoolean(prefs::kHeliumUpdateFetchingEnabled);
}
+bool ShouldAccessComponentUpdateService(const PrefService& prefs) {
+ return ShouldAccessServices(prefs) &&
+ HasAcceptedSchema(prefs, 1) &&
+ prefs.GetBoolean(prefs::kHeliumUpdateFetchingEnabled);
+}
+
bool ShouldAccessUBlockAssets(const PrefService& prefs) {
return ShouldAccessServices(prefs) &&
prefs.GetBoolean(prefs::kHeliumUBlockAssetsEnabled);
@@ -128,6 +135,14 @@ GURL GetBrowserUpdateURL(const PrefServi
#endif
}
+GURL GetComponentUpdateURL(const PrefService* prefs) {
+ if (!prefs || !ShouldAccessComponentUpdateService(*prefs)) {
+ return GetDummyURL();
+ }
+
+ return GetServicesBaseURL(*prefs).Resolve("/com");
+}
+
GURL GetUBlockAssetsURL(const PrefService& prefs) {
if (!ShouldAccessUBlockAssets(prefs)) {
return GetDummyURL();
--- a/components/helium_services/helium_services_helpers.h
+++ b/components/helium_services/helium_services_helpers.h
@@ -23,6 +23,7 @@ bool ShouldAccessServices(const PrefServ
COMPONENT_EXPORT(HELIUM) bool ShouldFetchBangs(const PrefService& prefs);
COMPONENT_EXPORT(HELIUM) bool ShouldAccessExtensionService(const PrefService& prefs);
COMPONENT_EXPORT(HELIUM) bool ShouldAccessUpdateService(const PrefService& prefs);
+COMPONENT_EXPORT(HELIUM) bool ShouldAccessComponentUpdateService(const PrefService& prefs);
COMPONENT_EXPORT(HELIUM) bool ShouldAccessUBlockAssets(const PrefService& prefs);
COMPONENT_EXPORT(HELIUM) GURL GetServicesBaseURL(const PrefService& prefs);
COMPONENT_EXPORT(HELIUM) GURL GetDummyURL();
@@ -30,6 +31,7 @@ COMPONENT_EXPORT(HELIUM) GURL GetExtensi
COMPONENT_EXPORT(HELIUM) GURL GetWebstoreSnippetURL(const PrefService& prefs, std::string_view id);
COMPONENT_EXPORT(HELIUM) GURL GetSpellcheckURL(const PrefService& prefs);
COMPONENT_EXPORT(HELIUM) GURL GetBrowserUpdateURL(const PrefService& prefs);
+COMPONENT_EXPORT(HELIUM) GURL GetComponentUpdateURL(const PrefService* prefs);
COMPONENT_EXPORT(HELIUM) GURL GetUBlockAssetsURL(const PrefService& prefs);
COMPONENT_EXPORT(HELIUM) std::optional<GURL> GetValidUserOverridenURL(std::string_view user_url_);
COMPONENT_EXPORT(HELIUM) void ConfigurePrefChangeRegistrarFor(std::string_view pref_name,
--- a/chrome/browser/component_updater/chrome_component_updater_configurator.cc
+++ b/chrome/browser/component_updater/chrome_component_updater_configurator.cc
@@ -26,11 +26,14 @@
#include "chrome/browser/component_updater/component_updater_utils.h"
#include "chrome/browser/component_updater/updater_state.h"
#include "chrome/browser/net/system_network_context_manager.h"
+#include "chrome/browser/profiles/profile.h"
+#include "chrome/browser/profiles/profile_manager.h"
#include "chrome/browser/update_client/chrome_update_query_params_delegate.h"
#include "chrome/common/channel_info.h"
#include "chrome/common/chrome_paths.h"
#include "components/component_updater/component_updater_command_line_config_policy.h"
#include "components/component_updater/configurator_impl.h"
+#include "components/helium_services/helium_services_helpers.h"
#include "components/prefs/pref_service.h"
#include "components/services/patch/content/patch_service.h"
#include "components/services/unzip/content/unzip_service.h"
@@ -55,6 +58,26 @@
namespace component_updater {
namespace {
+PrefService* GetProfilePrefs() {
+ // Browser process and profile manager are usually
+ // not null, but they may be during tests.
+ if (!g_browser_process) {
+ return nullptr;
+ }
+
+ ProfileManager* pm = g_browser_process->profile_manager();
+ if (!pm) {
+ return nullptr;
+ }
+
+ Profile* profile = pm->GetLastUsedProfileIfLoaded();
+ if (!profile) {
+ return nullptr;
+ }
+
+ return profile->GetPrefs();
+}
+
class ChromeConfigurator : public update_client::Configurator {
public:
ChromeConfigurator(const base::CommandLine* cmdline,
@@ -154,12 +177,12 @@ base::TimeDelta ChromeConfigurator::Upda
std::vector<GURL> ChromeConfigurator::UpdateUrl() const {
DCHECK_CALLED_ON_VALID_SEQUENCE(sequence_checker_);
- return configurator_impl_.UpdateUrl();
+ return {helium::GetComponentUpdateURL(GetProfilePrefs())};
}
std::vector<GURL> ChromeConfigurator::PingUrl() const {
DCHECK_CALLED_ON_VALID_SEQUENCE(sequence_checker_);
- return configurator_impl_.PingUrl();
+ return {helium::GetComponentUpdateURL(GetProfilePrefs())};
}
std::string ChromeConfigurator::GetProdId() const {
--- a/components/component_updater/component_installer.cc
+++ b/components/component_updater/component_installer.cc
@@ -12,6 +12,7 @@
#include <utility>
#include <vector>
+#include "base/containers/fixed_flat_set.h"
#include "base/files/file_enumerator.h"
#include "base/files/file_path.h"
#include "base/files/file_util.h"
@@ -111,7 +112,22 @@ void ComponentInstaller::Register(Compon
std::vector<uint8_t> public_key_hash;
installer_policy_->GetHash(&public_key_hash);
+
+ static constexpr auto kAllowedComponents =
+ base::MakeFixedFlatSet<std::string_view>(
+ base::sorted_unique,
+ {
+ "hfnkpimlhhgieaddgfemjhofmfblmnib", // CRLSet
+ "oimompecagnajdejgnnjijobebaeigek", // WidevineCdm
+ }
+ );
+
const auto crx_id = update_client::GetCrxIdFromPublicKeyHash(public_key_hash);
+
+ if (!kAllowedComponents.contains(crx_id)) {
+ return;
+ }
+
Register(base::BindOnce(&ComponentUpdateService::RegisterComponent,
base::Unretained(cus)),
std::move(callback), cus->GetRegisteredVersion(crx_id),
--- a/chrome/app/generated_resources.grd
+++ b/chrome/app/generated_resources.grd
@@ -7034,6 +7034,9 @@ Keep your key file in a safe place. You
<message name="IDS_COMPONENTS_SVC_STATUS_UPDATE_ERROR" desc="Service Status">
Update error
</message>
+ <message name="IDS_COMPONENTS_SVC_STATUS_ERROR_HELIUM_SERVICES" desc="Service Status">
+ Component updates are disabled. See Helium services in settings.
+ </message>
<message name="IDS_COMPONENTS_UNKNOWN" desc="Service Status">
Unknown
</message>
--- a/chrome/browser/ui/webui/components/components_handler.cc
+++ b/chrome/browser/ui/webui/components/components_handler.cc
@@ -12,8 +12,12 @@
#include "base/notreached.h"
#include "base/values.h"
#include "build/build_config.h"
+#include "chrome/browser/profiles/profile.h"
#include "chrome/grit/generated_resources.h"
+#include "components/helium_services/helium_services_helpers.h"
+#include "components/prefs/pref_service.h"
#include "components/update_client/crx_update_item.h"
+#include "content/public/browser/web_contents.h"
#include "ui/base/l10n/l10n_util.h"
ComponentsHandler::ComponentsHandler(
@@ -82,6 +86,20 @@ void ComponentsHandler::OnEvent(const up
std::u16string ComponentsHandler::ServiceStatusToString(
update_client::ComponentState state) {
+
+ if (state == update_client::ComponentState::kUpdateError) {
+ Profile* profile = Profile::FromBrowserContext(
+ web_ui()->GetWebContents()->GetBrowserContext());
+
+ if (profile) {
+ PrefService* prefs = profile->GetPrefs();
+ if (prefs && !helium::ShouldAccessComponentUpdateService(*prefs)) {
+ return l10n_util::GetStringUTF16(
+ IDS_COMPONENTS_SVC_STATUS_ERROR_HELIUM_SERVICES);
+ }
+ }
+ }
+
switch (state) {
case update_client::ComponentState::kNew:
return l10n_util::GetStringUTF16(IDS_COMPONENTS_SVC_STATUS_NEW);
--- a/chrome/browser/ui/webui/components/components_handler.h
+++ b/chrome/browser/ui/webui/components/components_handler.h
@@ -40,7 +40,7 @@ class ComponentsHandler : public content
void OnEvent(const update_client::CrxUpdateItem& item) override;
private:
- static std::u16string ServiceStatusToString(
+ std::u16string ServiceStatusToString(
update_client::ComponentState state);
base::Value::List LoadComponents();
@@ -1,6 +1,6 @@
--- a/services/network/public/cpp/features.cc
+++ b/services/network/public/cpp/features.cc
@@ -421,7 +421,7 @@ BASE_FEATURE(kUpdateRequestForCorsRedire
@@ -442,7 +442,7 @@ BASE_FEATURE(kUpdateRequestForCorsRedire
// https://github.com/patcg-individual-drafts/topics
// Kill switch for the Topics API.
@@ -9,7 +9,7 @@
// Enable the shared storage API. Note that enabling this feature does not
// automatically expose this API to the web, it only allows the element to be
@@ -500,7 +500,7 @@ BASE_FEATURE(kSharedStorageTransactional
@@ -521,7 +521,7 @@ BASE_FEATURE(kSharedStorageTransactional
// Kill switch for the Interest Group API, i.e. if disabled, the
// API exposure will be disabled regardless of the OT config.
@@ -1,6 +1,6 @@
--- a/chrome/browser/ui/views/webid/fedcm_account_selection_view_desktop.cc
+++ b/chrome/browser/ui/views/webid/fedcm_account_selection_view_desktop.cc
@@ -1272,6 +1272,9 @@ gfx::Rect FedCmAccountSelectionView::Get
@@ -1281,6 +1281,9 @@ gfx::Rect FedCmAccountSelectionView::Get
void FedCmAccountSelectionView::ShouldShowDialog(bool& should_show) {
if (dialog_type_ == DialogType::BUBBLE) {
@@ -1,6 +1,6 @@
--- a/components/history_clusters/core/features.cc
+++ b/components/history_clusters/core/features.cc
@@ -16,11 +16,7 @@ namespace history_clusters {
@@ -15,11 +15,7 @@ namespace history_clusters {
namespace {
constexpr auto enabled_by_default_desktop_only =
@@ -0,0 +1,11 @@
--- a/components/search/ntp_features.cc
+++ b/components/search/ntp_features.cc
@@ -245,7 +245,7 @@ BASE_FEATURE(kNtpNextFeatures, base::FEA
BASE_FEATURE(kNtpOneGoogleBarAsyncBarParts, base::FEATURE_DISABLED_BY_DEFAULT);
// If enabled, a footer will show on the NTP.
-BASE_FEATURE(kNtpFooter, base::FEATURE_ENABLED_BY_DEFAULT);
+BASE_FEATURE(kNtpFooter, base::FEATURE_DISABLED_BY_DEFAULT);
// If enabled, tab groups module will be shown.
BASE_FEATURE(kNtpTabGroupsModule,
@@ -1,6 +1,6 @@
--- a/chrome/browser/upgrade_detector/upgrade_detector_impl.cc
+++ b/chrome/browser/upgrade_detector/upgrade_detector_impl.cc
@@ -214,6 +214,8 @@ void UpgradeDetectorImpl::DoCalculateThr
@@ -220,6 +220,8 @@ void UpgradeDetectorImpl::DoCalculateThr
void UpgradeDetectorImpl::StartOutdatedBuildDetector() {
DCHECK_CALLED_ON_VALID_SEQUENCE(sequence_checker_);
+1 -1
View File
@@ -1,6 +1,6 @@
--- a/ui/base/pointer/touch_ui_controller.cc
+++ b/ui/base/pointer/touch_ui_controller.cc
@@ -177,13 +177,7 @@ void TouchUiController::TouchUiScoperFor
@@ -178,13 +178,7 @@ void TouchUiController::TouchUiScoperFor
// static
TouchUiController* TouchUiController::Get() {
static base::NoDestructor<TouchUiController> instance([] {
@@ -1,6 +1,6 @@
--- a/chrome/browser/ui/ui_features.cc
+++ b/chrome/browser/ui/ui_features.cc
@@ -627,7 +627,7 @@ bool HasTabSearchToolbarButton() {
@@ -525,7 +525,7 @@ bool HasTabSearchToolbarButton() {
return is_tab_search_moving;
}
@@ -10,7 +10,7 @@
return false;
--- a/components/user_education/common/tutorial/tutorial_registry.cc
+++ b/components/user_education/common/tutorial/tutorial_registry.cc
@@ -26,7 +26,6 @@ bool TutorialRegistry::IsTutorialRegiste
@@ -25,7 +25,6 @@ bool TutorialRegistry::IsTutorialRegiste
const TutorialDescription* TutorialRegistry::GetTutorialDescription(
TutorialIdentifier id) const {
@@ -18,7 +18,7 @@
auto pair = tutorial_registry_.find(id);
if (pair == tutorial_registry_.end()) {
return nullptr;
@@ -36,7 +35,6 @@ const TutorialDescription* TutorialRegis
@@ -35,7 +34,6 @@ const TutorialDescription* TutorialRegis
const std::vector<TutorialIdentifier> TutorialRegistry::GetTutorialIdentifiers()
const {
@@ -1,6 +1,6 @@
--- a/chrome/browser/ui/ui_features.cc
+++ b/chrome/browser/ui/ui_features.cc
@@ -285,13 +285,7 @@ bool IsTabGroupMenuMoreEntryPointsEnable
@@ -136,13 +136,7 @@ bool IsTabGroupMenuMoreEntryPointsEnable
// Enables preview images in tab-hover cards.
// https://crbug.com/928954
@@ -23,7 +23,7 @@
if (tab_search_action.has_value()) {
--- a/chrome/browser/ui/ui_features.cc
+++ b/chrome/browser/ui/ui_features.cc
@@ -577,7 +577,7 @@ BASE_FEATURE(kByDateHistoryInSidePanel,
@@ -479,7 +479,7 @@ BASE_FEATURE(kByDateHistoryInSidePanel,
BASE_FEATURE(kTabStripBrowserApi, base::FEATURE_DISABLED_BY_DEFAULT);
@@ -32,10 +32,10 @@
// This serves as a "kill-switch" for migrating the Tab Search feature to be a
// toolbar button for non-ChromeOS users in the US.
@@ -612,6 +612,8 @@ bool HasTabSearchToolbarButton() {
return false;
}
@@ -510,6 +510,8 @@ static std::string GetCountryCode() {
}
bool HasTabSearchToolbarButton() {
+ return true;
+
static const bool is_tab_search_moving = [] {
@@ -1,6 +1,6 @@
--- a/chrome/browser/about_flags.cc
+++ b/chrome/browser/about_flags.cc
@@ -13399,11 +13399,295 @@ const FeatureEntry kFeatureEntries[] = {
@@ -13547,11 +13547,387 @@ const FeatureEntry kFeatureEntries[] = {
// AboutFlagsHistogramTest unit test to verify this process).
};
@@ -26,6 +26,11 @@
+ // Google's experimental APIs that don't work in Helium
+ // due to missing model binaries
+ "translation-api",
+ "translation-api-streaming-by-sentence",
+
+ // Misc features not relevant to Helium
+ "extensions-menu-access-control",
+ "extensions-collapse-main-menu",
+
+ // NTP
+ "omnibox-zero-suggest-prefetching",
@@ -40,8 +45,14 @@
+ "ntp-tab-groups-module-zero-state",
+ "ntp-microsoft-authentication-module",
+ "ntp-realbox-next",
+ "ntp-next-features",
+ "ntp-customize-chrome-auto-open",
+ "ntp-feature-optimization-module-removal",
+ "ntp-feature-optimization-shortcuts-removal",
+ "ntp-feature-optimization-dismiss-modules-removal",
+ "enable-ntp-enterprise-shortcuts",
+
+ // Google Account & Sync
+ // Google Account & Sync & Synced profiles
+ "use-sync-sandbox",
+ "offer-migration-to-dice-users",
+ "web-signin-leads-to-implicitly-signed-in-state",
@@ -54,14 +65,35 @@
+ "enable-bookmarks-selected-type-on-signin-for-testing",
+ "enable-cross-device-pref-tracker",
+ "pdf-save-to-drive",
+ "mdm-errors-for-dasher-accounts-handling",
+ "profile-creation-decline-signin-cta-experiment",
+ "show-profile-picker-to-all-users-experiment",
+ "migrate-syncing-user-to-signed-in",
+ "undo-migration-of-syncing-user-to-signed-in",
+ "profile-signals-reporting-enabled",
+ "profile-creation-friction-reduction-experiment-prefill-name-requirement",
+ "profile-creation-friction-reduction-experiment-remove-signin-step",
+ "profile-creation-friction-reduction-experiment-skip-customize-profile",
+ "open-all-profiles-from-profile-picker-experiment",
+ "profile-picker-text-variations",
+ "enable-oauth-multilogin-cookies-binding",
+ "enable-oauth-multilogin-cookies-binding-server-experiment",
+ "enable-chrome-refresh-token-binding",
+ "enable-bound-session-credentials",
+ "enable-bound-session-credentials-software-keys-for-manual-testing",
+
+ // Gemini Nano
+ // Gemini Nano / Other Google models
+ "prompt-api-for-gemini-nano",
+ "prompt-api-for-gemini-nano-multimodal-input",
+ "summarization-api-for-gemini-nano",
+ "writer-api-for-gemini-nano",
+ "rewriter-api-for-gemini-nano",
+ "proofreader-api-for-gemini-nano",
+ "omnibox-on-device-tail-suggestions",
+ "language-detection-api",
+ "text-safety-classifier",
+ "page-content-annotations",
+ "page-content-annotations-remote-page-metadata",
+
+ // AI Mode
+ "ai-mode-omnibox-entry-point",
@@ -75,6 +107,20 @@
+ "composebox-uses-chrome-compose-client",
+ "compose-selection-nudge",
+ "contextual-tasks",
+ "web-app-migrate-preinstalled-chat",
+ "webui-omnibox-aim-popup",
+ "aim-entry-point-direct-navigation",
+
+ // Contextual AI stuff (AI Mode entrypoints?)
+ "contextual-search-box-uses-contextual-search-provider",
+ "contextual-suggestions-ablate-others-when-present",
+ "omnibox-contextual-search-on-focus-suggestions",
+ "omnibox-contextual-suggestions",
+ "contextual-cueing",
+ "contextual-suggestion-ui-improvements",
+ "contextual-tasks-context",
+ "contextual-tasks-suggestions-enabled",
+ "contextual-tasks-context-library",
+
+ // Shopping stuff
+ "product-specifications",
@@ -126,6 +172,10 @@
+ "lens-search-zero-state-csb",
+ "lens-updated-feedback-entrypoint",
+ "lens-video-citations",
+ "lens-aim-suggestions",
+ "lens-aim-gradient-suggest-background",
+ "lens-overlay-optimization-filter",
+ "lens-overlay-non-blocking-privacy-notice",
+
+ // Google Assistant
+ "enable-assistant-dsp",
@@ -150,6 +200,8 @@
+ "enable-ntp-browser-promos",
+ "mobile-promo-on-desktop",
+ "in-product-help-demo-mode-choice",
+ "iph-extensions-menu-feature",
+ "iph-extensions-request-access-button-feature",
+
+ // GLIC (AI agent stuff)
+ "glic",
@@ -164,12 +216,17 @@
+ "glic-pre-warming",
+ "glic-fre-pre-warming",
+ "browsing-history-actor-integration-M1",
+ "browsing-history-actor-integration-M2",
+
+ // Live captions
+ "enable-headless-live-caption",
+
+ // Google Wallet
+ "wallet-service-use-sandbox",
+ "enable-secure-payment-confirmation-availability-api",
+ "enable-secure-payment-confirmation-fallback-ux",
+ "enable-web-payments-experimental-features",
+ "enable-debug-for-store-billing",
+
+ // Safety Hub
+ "safety-hub",
@@ -204,6 +261,7 @@
+ "apply-clientside-model-predictions-for-password-types",
+ "enable-site-isolation-for-password-sites",
+ "pwm-show-suggestions-on-autofocus",
+ "web-authentication-passkey-upgrade",
+
+ // Reading Mode
+ "read-anything-read-aloud",
@@ -211,6 +269,37 @@
+ "read-anything-images-via-algorithm",
+ "read-anything-docs-integration",
+ "read-anything-docs-load-more-button",
+ "read-anything-read-aloud-ts-text-segmentation",
+ "read-anything-with-readability-enabled",
+ "read-anything-omnibox-chip",
+ "read-anything-immersive-reading-mode",
+
+ // Misc Google experiments
+ "happiness-tracking-surveys-for-desktop-demo",
+ "permissions-ai-v3",
+ "permissions-ai-v4",
+ "permissions-ai-p92",
+ "private-metrics-enable-puma",
+ "private-metrics-enable-puma-rc",
+ "user-value-default-browser-strings",
+ "invalidate-search-engine-choice-on-device-restore-detection",
+ "variations-seed-corpus",
+ "protected-audience-debug-token",
+ "rcaps-dynamic-profile-country",
+ "related-website-sets-permission-grants",
+ "data-sharing",
+ "data-sharing-join-only",
+ "data-sharing-non-production-environment",
+ "shared-data-types-kill-switch",
+ "data-sharing-debug-logs",
+ "chrome-web-store-navigation-throttle",
+ "supervised-user-block-interstitial-v3",
+
+ // New layout kill switches
+ // (old layout is disabled in 144 and removed in 146)
+ "app-browser-use-new-layout",
+ "popup-browser-use-new-layout",
+ "tabbed-browser-use-new-layout",
+
+ // Autofill
+ "reintroduce-hybrid-passkey-entry-point",
@@ -274,6 +363,9 @@
+ "autofill-and-passwords-in-same-surface",
+ "autofill-enable-ai-based-amount-extraction",
+ "autofill-prefer-buy-now-pay-later-blocklists",
+ "mark-all-credentials-as-leaked",
+ "apply-clientside-model-predictions-for-otps",
+ "enable-your-saved-info-settings-page",
+
+ // Add new entries above this line and categorize them accordingly.
+});
@@ -297,7 +389,7 @@
FlagsStateSingleton(const FlagsStateSingleton&) = delete;
FlagsStateSingleton& operator=(const FlagsStateSingleton&) = delete;
~FlagsStateSingleton() override = default;
@@ -13422,7 +13706,7 @@ class FlagsStateSingleton : public flags
@@ -13570,7 +13946,7 @@ class FlagsStateSingleton : public flags
void RestoreDefaultState() {
flags_state_ =
@@ -306,7 +398,7 @@
}
private:
@@ -13747,7 +14031,7 @@ base::span<const FeatureEntry> GetFeatur
@@ -13907,7 +14283,7 @@ base::span<const FeatureEntry> GetFeatur
!entries_for_testing->empty()) {
return *entries_for_testing;
}
@@ -0,0 +1,16 @@
--- a/extensions/browser/extension_registrar.cc
+++ b/extensions/browser/extension_registrar.cc
@@ -542,9 +542,12 @@ void ExtensionRegistrar::AddComponentExt
if (old_version.IsValid()) {
UnregisterServiceWorkerWithRootScope(extension);
}
+
+ base::flat_set<int> disable_reasons = GetDisableReasonsOnInstalled(extension);
+
// TODO(crbug.com/40508457): If needed, add support for Declarative Net
// Request to component extensions and pass the ruleset install prefs here.
- AddNewOrUpdatedExtension(extension, {}, kInstallFlagNone,
+ AddNewOrUpdatedExtension(extension, std::move(disable_reasons), kInstallFlagNone,
syncer::StringOrdinal(), std::string(),
/*ruleset_install_prefs=*/{});
return;
@@ -0,0 +1,12 @@
--- a/components/gcm_driver/instance_id/instance_id_impl.cc
+++ b/components/gcm_driver/instance_id/instance_id_impl.cc
@@ -263,9 +263,6 @@ gcm::InstanceIDHandler* InstanceIDImpl::
}
void InstanceIDImpl::RunWhenReady(base::OnceClosure task) {
- if (!delayed_task_controller_.CanRunTaskWithoutDelay())
- delayed_task_controller_.AddTask(std::move(task));
- else
base::SingleThreadTaskRunner::GetCurrentDefault()->PostTask(
FROM_HERE, std::move(task));
}
@@ -1,6 +1,6 @@
--- a/chrome/browser/ui/tabs/saved_tab_groups/saved_tab_group_model_listener.cc
+++ b/chrome/browser/ui/tabs/saved_tab_groups/saved_tab_group_model_listener.cc
@@ -188,17 +188,7 @@ void SavedTabGroupModelListener::OnTabSt
@@ -192,17 +192,7 @@ void SavedTabGroupModelListener::OnTabSt
return;
}
@@ -0,0 +1,89 @@
--- a/components/extstore_fixups/BUILD.gn
+++ b/components/extstore_fixups/BUILD.gn
@@ -16,6 +16,7 @@ generate_grd("extstore_fixups_grd") {
input_files_base_dir = rebase_path(".", "//")
input_files = [
"manifest.json",
+ "chrome-webstore.js",
]
}
--- a/components/extstore_fixups/manifest.json
+++ b/components/extstore_fixups/manifest.json
@@ -9,5 +9,10 @@
"version": "0.0.0",
"manifest_version": 3,
"content_scripts": [
+ {
+ "matches": [ "https://chromewebstore.google.com/*" ],
+ "run_at": "document_start",
+ "js": [ "chrome-webstore.js" ]
+ }
]
}
--- /dev/null
+++ b/components/extstore_fixups/chrome-webstore.js
@@ -0,0 +1,63 @@
+// Copyright 2025 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.
+
+(() => {
+ const PROMO_POPUP_SELECTOR = 'header > [aria-labelledby=promo-header]';
+ const SWITCH_NAG_SELECTOR = 'main section [aria-label=Info]';
+ const SWITCH_BTN_SELECTOR = 'button[aria-label^=\'Switch to Chrome\']';
+ const removeChromeNags = () => {
+ const promoPopup = document.querySelector(PROMO_POPUP_SELECTOR);
+ if (promoPopup) {
+ promoPopup.remove();
+ }
+
+ const switchNag = document.querySelector(SWITCH_NAG_SELECTOR);
+ if (switchNag && switchNag.querySelector(SWITCH_BTN_SELECTOR)) {
+ switchNag.remove();
+ }
+ };
+
+ const replaceDownloadButtonText = (el) => {
+ if (el.nodeType === Node.TEXT_NODE) {
+ if (!el.nodeValue?.includes('Chrome')) {
+ return false;
+ }
+
+ el.nodeValue = el.nodeValue.replace(/\b(Google\s)?Chrome\b/, 'Helium');
+ return true;
+ } else if (el.childNodes) {
+ for (const node of el.childNodes) {
+ if (replaceDownloadButtonText(node)) {
+ return true;
+ }
+ }
+ }
+
+ return false;
+ };
+
+ const changeDownloadButtonText = () => {
+ const mainTitles = document.querySelectorAll('main section h1');
+
+ for (const mainTitleEl of mainTitles) {
+ const downloadButton =
+ mainTitleEl?.parentElement?.parentElement?.querySelector('button');
+ if (!downloadButton || !downloadButton.textContent?.includes('Chrome')) {
+ continue;
+ }
+
+ if (replaceDownloadButtonText(downloadButton)) {
+ break;
+ }
+ }
+ };
+
+ const handleChanges = () => {
+ removeChromeNags();
+ changeDownloadButtonText();
+ };
+
+ const observer = new MutationObserver(handleChanges);
+ observer.observe(document, {childList: true, subtree: true});
+})();
@@ -0,0 +1,198 @@
--- /dev/null
+++ b/components/extstore_fixups/BUILD.gn
@@ -0,0 +1,37 @@
+# Copyright 2025 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.
+
+import("//ui/webui/resources/tools/generate_grd.gni")
+import("//tools/grit/grit_rule.gni")
+
+generated_grd = "$target_gen_dir/resources.grd"
+
+generate_grd("extstore_fixups_grd") {
+ out_grd = generated_grd
+
+ grd_prefix = "extstore_fixups"
+ resource_path_prefix = "extstore_fixups"
+
+ input_files_base_dir = rebase_path(".", "//")
+ input_files = [
+ "manifest.json",
+ ]
+}
+
+grit("extstore_fixups") {
+ source = generated_grd
+
+ # Required because the .grd is generated.
+ enable_input_discovery_for_gn_analyze = false
+ output_dir = "$target_gen_dir/resources"
+
+ outputs = [
+ "grit/extstore_fixups_resources.h",
+ "grit/extstore_fixups_resources_map.cc",
+ "grit/extstore_fixups_resources_map.h",
+ "extstore_fixups_resources.pak"
+ ]
+
+ deps = [":extstore_fixups_grd"]
+}
--- /dev/null
+++ b/components/extstore_fixups/manifest.json
@@ -0,0 +1,13 @@
+// Copyright 2025 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.
+
+{
+ "name": "extstore-fixups",
+ // chrome-extension://jfnekidfgkhnfagaabpddmioknbjglgp
+ "key": "MIGfMA0GCSqGSIb3DQEBAQUAA4GNADCBiQKBgQDGyNfoa6gmayvnBUHaYz2fNyPT7CIj6e5VccAZcIbpM/w9bhshiU0zxe0Ci+oLzHy3E/mObNM1IrXhHAQZno7H3frUxTH+m2eIGiwcqLfJkaQFkXvSoInpsG2N3Q74W6YN3mKk7rBAE8PQT1Nyh5H8AmIaWRvLz1+vcowpPNjU/QIDAQAB",
+ "version": "0.0.0",
+ "manifest_version": 3,
+ "content_scripts": [
+ ]
+}
--- /dev/null
+++ b/components/extstore_fixups/extension_ids.h
@@ -0,0 +1,15 @@
+// Copyright 2025 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.
+
+#ifndef COMPONENTS_EXTSTORE_FIXUPS_EXTENSION_IDS_H_
+#define COMPONENTS_EXTSTORE_FIXUPS_EXTENSION_IDS_H_
+
+namespace helium {
+
+inline constexpr char kExtstoreFixupsExtensionId[] =
+ "jfnekidfgkhnfagaabpddmioknbjglgp";
+
+} // namespace helium
+
+#endif /* COMPONENTS_EXTSTORE_FIXUPS_EXTENSION_IDS_H_ */
--- a/tools/gritsettings/resource_ids.spec
+++ b/tools/gritsettings/resource_ids.spec
@@ -205,7 +205,7 @@
"META": {"sizes": {"includes": [20]}},
"includes": [2820],
},
- "<(SHARED_INTERMEDIATE_DIR)/chrome/browser/resources/ash/inline_login/resources.grd": {
+ "<(SHARED_INTERMEDIATE_DIR)/components/extstore_fixups/resources.grd": {
"META": {"sizes": {"includes": [20]}},
"includes": [2840],
},
--- a/chrome/chrome_paks.gni
+++ b/chrome/chrome_paks.gni
@@ -141,6 +141,7 @@ template("chrome_extra_paks") {
"$root_gen_dir/components/translate_internals_resources.pak",
"$root_gen_dir/components/user_actions_ui_resources.pak",
"$root_gen_dir/components/version_ui_resources.pak",
+ "$root_gen_dir/components/extstore_fixups/resources/extstore_fixups_resources.pak",
"$root_gen_dir/content/attribution_internals_resources.pak",
"$root_gen_dir/content/content_resources.pak",
"$root_gen_dir/content/histograms_resources.pak",
@@ -169,6 +170,7 @@ template("chrome_extra_paks") {
"//components/enterprise/connectors/resources",
"//components/metrics:server_urls_grd",
"//components/resources",
+ "//components/extstore_fixups",
"//content:content_resources",
"//content/browser/resources",
"//mojo/public/js:resources",
--- a/chrome/browser/extensions/BUILD.gn
+++ b/chrome/browser/extensions/BUILD.gn
@@ -588,6 +588,7 @@ source_set("extensions") {
"//components/update_client:common_impl",
"//components/user_prefs",
"//components/vector_icons",
+ "//components/extstore_fixups",
"//content/public/browser",
"//extensions/browser",
"//extensions/browser/api/storage:settings_namespace",
--- a/chrome/browser/extensions/chrome_component_extension_resource_manager.cc
+++ b/chrome/browser/extensions/chrome_component_extension_resource_manager.cc
@@ -18,6 +18,7 @@
#include "chrome/grit/chrome_unscaled_resources.h"
#include "chrome/grit/component_extension_resources_map.h"
#include "chrome/grit/theme_resources.h"
+#include "components/extstore_fixups/resources/grit/extstore_fixups_resources_map.h"
#include "content/public/browser/browser_thread.h"
#include "extensions/buildflags/buildflags.h"
#include "extensions/common/constants.h"
@@ -96,6 +97,7 @@ ChromeComponentExtensionResourceManager:
AddComponentResourceEntries(kComponentExtensionResources);
AddComponentResourceEntries(kExtraComponentExtensionResources);
AddComponentResourceEntries(kUblockResources);
+ AddComponentResourceEntries(kExtstoreFixupsResources);
#if BUILDFLAG(IS_CHROMEOS)
// Add Files app JS modules resources.
--- a/chrome/browser/extensions/component_loader.h
+++ b/chrome/browser/extensions/component_loader.h
@@ -216,6 +216,7 @@ class ComponentLoader : public KeyedServ
const std::string& description_string);
void AddWebStoreApp();
void AddUBlock();
+ void AddExtstoreFixups();
#if BUILDFLAG(IS_CHROMEOS)
void AddChromeApp();
--- a/chrome/browser/extensions/component_loader.cc
+++ b/chrome/browser/extensions/component_loader.cc
@@ -37,6 +37,7 @@
#include "chrome/grit/generated_resources.h"
#include "components/crx_file/id_util.h"
#include "components/version_info/version_info.h"
+#include "components/extstore_fixups/resources/grit/extstore_fixups_resources.h"
#include "content/public/browser/browser_thread.h"
#include "content/public/common/content_switches.h"
#include "extensions/browser/extension_file_task_runner.h"
@@ -445,6 +446,11 @@ void ComponentLoader::AddUBlock() {
}
}
+void ComponentLoader::AddExtstoreFixups() {
+ Add(IDR_EXTSTORE_FIXUPS_MANIFEST_JSON,
+ base::FilePath(FILE_PATH_LITERAL("extstore_fixups")));
+}
+
#if BUILDFLAG(IS_CHROMEOS)
void ComponentLoader::AddChromeApp() {
AddWithNameAndDescription(
@@ -523,6 +529,7 @@ void ComponentLoader::AddDefaultComponen
if (!skip_session_components) {
AddWebStoreApp();
AddUBlock();
+ AddExtstoreFixups();
#if BUILDFLAG(IS_CHROMEOS)
AddChromeApp();
#endif // BUILDFLAG(IS_CHROMEOS)
--- a/chrome/browser/extensions/component_extensions_allowlist/allowlist.cc
+++ b/chrome/browser/extensions/component_extensions_allowlist/allowlist.cc
@@ -16,6 +16,8 @@
#include "chrome/common/extensions/extension_constants.h"
#include "chrome/grit/browser_resources.h"
#include "components/helium_services/extension_ids.h"
+#include "components/extstore_fixups/extension_ids.h"
+#include "components/extstore_fixups/resources/grit/extstore_fixups_resources.h"
#include "extensions/buildflags/buildflags.h"
#include "extensions/common/constants.h"
#include "printing/buildflags/buildflags.h"
@@ -37,6 +39,7 @@ bool IsComponentExtensionAllowlisted(con
extension_misc::kInAppPaymentsSupportAppId,
extension_misc::kPdfExtensionId,
helium::kUBlockOriginComponentId,
+ helium::kExtstoreFixupsExtensionId,
#if BUILDFLAG(IS_CHROMEOS)
extension_misc::kAssessmentAssistantExtensionId,
extension_misc::kAccessibilityCommonExtensionId,
@@ -93,6 +96,7 @@ bool IsComponentExtensionAllowlisted(int
case IDR_READING_MODE_GDOCS_HELPER_MANIFEST:
case IDR_WEBSTORE_MANIFEST:
case IDR_UBLOCK_MANIFEST_JSON:
+ case IDR_EXTSTORE_FIXUPS_MANIFEST_JSON:
#if BUILDFLAG(IS_CHROMEOS)
// Separate ChromeOS list, as it is quite large.
+16 -1
View File
@@ -1,6 +1,21 @@
--- a/chrome/browser/about_flags.cc
+++ b/chrome/browser/about_flags.cc
@@ -4990,11 +4990,13 @@ const FeatureEntry::FeatureVariation kSe
@@ -395,11 +395,11 @@ namespace about_flags {
namespace {
-const unsigned kOsAll = kOsMac | kOsWin | kOsLinux | kOsCrOS | kOsAndroid;
-const unsigned kOsDesktop = kOsMac | kOsWin | kOsLinux | kOsCrOS;
+const unsigned kOsAll = kOsMac | kOsWin | kOsLinux;
+const unsigned kOsDesktop = kOsMac | kOsWin | kOsLinux;
#if defined(USE_AURA)
-const unsigned kOsAura = kOsWin | kOsLinux | kOsCrOS;
+const unsigned kOsAura = kOsWin | kOsLinux;
#endif // USE_AURA
#if defined(USE_AURA)
@@ -5225,11 +5225,13 @@ const FeatureEntry::Choice kOmniboxAutof
// calculate and verify checksum.
//
// When adding a new choice, add it to the end of the list.
@@ -1,224 +0,0 @@
--- a/chrome/browser/extensions/api/settings_private/prefs_util.cc
+++ b/chrome/browser/extensions/api/settings_private/prefs_util.cc
@@ -230,6 +230,10 @@ const PrefsUtil::TypedPrefMap& PrefsUtil
(*s_allowlist)[::prefs::kSplitViewDragAndDropEnabled] =
settings_api::PrefType::kBoolean;
+ // Custom toolbar button settings.
+ (*s_allowlist)[::prefs::kShowAvatarButton] =
+ settings_api::PrefType::kBoolean;
+
// Appearance settings.
(*s_allowlist)[::prefs::kCurrentThemeID] = settings_api::PrefType::kString;
(*s_allowlist)[::prefs::kPinnedActions] = settings_api::PrefType::kList;
--- a/chrome/browser/ui/actions/chrome_action_id.h
+++ b/chrome/browser/ui/actions/chrome_action_id.h
@@ -558,6 +558,7 @@
#define TOOLBAR_PINNABLE_ACTION_IDS \
E(kActionHome, IDC_HOME) \
E(kActionForward, IDC_FORWARD) \
+ E(kActionAvatar, IDC_SHOW_AVATAR_MENU) \
E(kActionNewIncognitoWindow, IDC_NEW_INCOGNITO_WINDOW) \
E(kActionSendSharedTabGroupFeedback, IDC_SEND_SHARED_TAB_GROUP_FEEDBACK) \
E(kActionShowPasswordManager, IDC_SHOW_PASSWORD_MANAGER) \
--- a/chrome/browser/ui/browser_ui_prefs.cc
+++ b/chrome/browser/ui/browser_ui_prefs.cc
@@ -123,6 +123,9 @@ void RegisterBrowserUserPrefs(user_prefs
registry->RegisterBooleanPref(prefs::kPinSplitTabButton, false,
pref_registration_flags);
+ registry->RegisterBooleanPref(
+ prefs::kShowAvatarButton, true);
+
registry->RegisterInt64Pref(prefs::kDefaultBrowserLastDeclined, 0);
registry->RegisterBooleanPref(prefs::kWebAppCreateOnDesktop, true);
registry->RegisterBooleanPref(prefs::kWebAppCreateInAppsMenu, true);
--- a/chrome/browser/ui/toolbar/pinned_toolbar/pinned_toolbar_actions_model.cc
+++ b/chrome/browser/ui/toolbar/pinned_toolbar/pinned_toolbar_actions_model.cc
@@ -216,6 +216,7 @@ void PinnedToolbarActionsModel::UpdatePi
void PinnedToolbarActionsModel::ResetToDefault() {
pref_service_->ClearPref(prefs::kShowHomeButton);
pref_service_->ClearPref(prefs::kShowForwardButton);
+ pref_service_->ClearPref(prefs::kShowAvatarButton);
pref_service_->ClearPref(prefs::kPinnedActions);
}
@@ -229,7 +230,10 @@ bool PinnedToolbarActionsModel::IsDefaul
const bool forward_is_default =
pref_service_->GetDefaultPrefValue(prefs::kShowForwardButton)
->GetBool() == pref_service_->GetBoolean(prefs::kShowForwardButton);
- return action_are_default && home_is_default && forward_is_default;
+ const bool avatar_is_default =
+ pref_service_->GetDefaultPrefValue(prefs::kShowAvatarButton)
+ ->GetBool() == pref_service_->GetBoolean(prefs::kShowAvatarButton);
+ return action_are_default && home_is_default && forward_is_default && avatar_is_default;
}
void PinnedToolbarActionsModel::MaybeMigrateExistingPinnedStates() {
--- a/chrome/browser/ui/views/toolbar/toolbar_view.cc
+++ b/chrome/browser/ui/views/toolbar/toolbar_view.cc
@@ -463,8 +463,7 @@ void ToolbarView::Init() {
#else
// DevTools profiles are OffTheRecord, so hide it there.
show_avatar_toolbar_button = browser_->profile()->IsIncognitoProfile() ||
- browser_->profile()->IsGuestSession() ||
- browser_->profile()->IsRegularProfile();
+ browser_->profile()->IsGuestSession();
#endif
const std::string sab_value = base::CommandLine::ForCurrentProcess()->
@@ -533,6 +532,17 @@ void ToolbarView::Init() {
home_->SetVisible(show_home_button_.GetValue());
+ show_avatar_button_.Init(
+ prefs::kShowAvatarButton, prefs,
+ base::BindRepeating(&ToolbarView::OnShowAvatarButtonChanged,
+ base::Unretained(this)));
+
+ // avatar is always shown in incognito and guest profiles,
+ // but in regular profiles it's managed by the kShowAvatarButton pref
+ if (browser_->profile()->IsRegularProfile()) {
+ avatar_->SetVisible(show_avatar_button_.GetValue());
+ }
+
InitLayout();
for (auto* button : std::array<views::Button*, 5>{back_, forward_, reload_,
@@ -1253,6 +1263,10 @@ void ToolbarView::OnShowHomeButtonChange
home_->SetVisible(show_home_button_.GetValue());
}
+void ToolbarView::OnShowAvatarButtonChanged() {
+ avatar_->SetVisible(show_avatar_button_.GetValue());
+}
+
void ToolbarView::OnTouchUiChanged() {
if (display_mode_ == DisplayMode::NORMAL) {
// Update the internal margins for touch layout.
--- a/chrome/browser/ui/views/toolbar/toolbar_view.h
+++ b/chrome/browser/ui/views/toolbar/toolbar_view.h
@@ -268,6 +268,8 @@ class ToolbarView : public views::Access
void OnShowHomeButtonChanged();
+ void OnShowAvatarButtonChanged();
+
void OnTouchUiChanged();
void UpdateClipPath();
@@ -318,6 +320,8 @@ class ToolbarView : public views::Access
// Controls whether or not a home button should be shown on the toolbar.
BooleanPrefMember show_home_button_;
+ BooleanPrefMember show_avatar_button_;
+
BooleanPrefMember show_chrome_labs_button_;
// The display mode used when laying out the toolbar.
--- a/chrome/browser/ui/webui/side_panel/customize_chrome/customize_toolbar/customize_toolbar.mojom
+++ b/chrome/browser/ui/webui/side_panel/customize_chrome/customize_toolbar/customize_toolbar.mojom
@@ -16,6 +16,7 @@ enum ActionId {
kShowSearchCompanion,
kHome,
kForward,
+ kAvatar,
kNewIncognitoWindow,
kShowPasswordManager,
kShowPaymentMethods,
--- a/chrome/browser/ui/webui/side_panel/customize_chrome/customize_toolbar/customize_toolbar_handler.cc
+++ b/chrome/browser/ui/webui/side_panel/customize_chrome/customize_toolbar/customize_toolbar_handler.cc
@@ -50,6 +50,8 @@ MojoActionForChromeAction(actions::Actio
return side_panel::customize_chrome::mojom::ActionId::kHome;
case kActionForward:
return side_panel::customize_chrome::mojom::ActionId::kForward;
+ case kActionAvatar:
+ return side_panel::customize_chrome::mojom::ActionId::kAvatar;
case kActionNewIncognitoWindow:
return side_panel::customize_chrome::mojom::ActionId::kNewIncognitoWindow;
case kActionShowPasswordsBubbleOrPage:
@@ -109,6 +111,8 @@ std::optional<actions::ActionId> ChromeA
return kActionHome;
case side_panel::customize_chrome::mojom::ActionId::kForward:
return kActionForward;
+ case side_panel::customize_chrome::mojom::ActionId::kAvatar:
+ return kActionAvatar;
case side_panel::customize_chrome::mojom::ActionId::kNewIncognitoWindow:
return kActionNewIncognitoWindow;
case side_panel::customize_chrome::mojom::ActionId::kShowPasswordManager:
@@ -174,6 +178,10 @@ CustomizeToolbarHandler::CustomizeToolba
prefs::kPinSplitTabButton,
base::BindRepeating(&CustomizeToolbarHandler::OnPinSplitTabButtonChanged,
base::Unretained(this)));
+ pref_change_registrar_.Add(
+ prefs::kShowAvatarButton,
+ base::BindRepeating(&CustomizeToolbarHandler::OnShowAvatarButtonChanged,
+ base::Unretained(this)));
}
CustomizeToolbarHandler::~CustomizeToolbarHandler() = default;
@@ -219,6 +227,19 @@ void CustomizeToolbarHandler::ListAction
actions.push_back(std::move(home_action));
actions.push_back(std::move(forward_action));
+ auto avatar_action = side_panel::customize_chrome::mojom::Action::New(
+ MojoActionForChromeAction(kActionAvatar).value(),
+ base::UTF16ToUTF8(l10n_util::GetStringUTF16(IDS_PROFILES_MENU_NAME)),
+ prefs()->GetBoolean(prefs::kShowAvatarButton), false,
+ side_panel::customize_chrome::mojom::CategoryId::kYourChrome,
+ GURL(webui::EncodePNGAndMakeDataURI(
+ ui::ImageModel::FromVectorIcon(
+ vector_icons::kAccountCircleChromeRefreshIcon, icon_color_id)
+ .Rasterize(&provider),
+ scale_factor)));
+
+ actions.push_back(std::move(avatar_action));
+
if (base::FeatureList::IsEnabled(features::kSideBySide)) {
auto split_tab_action = side_panel::customize_chrome::mojom::Action::New(
MojoActionForChromeAction(kActionSplitTab).value(),
@@ -367,6 +388,9 @@ void CustomizeToolbarHandler::PinAction(
case kActionSplitTab:
prefs()->SetBoolean(prefs::kPinSplitTabButton, pin);
break;
+ case kActionAvatar:
+ prefs()->SetBoolean(prefs::kShowAvatarButton, pin);
+ break;
default:
model_->UpdatePinnedState(chrome_action.value(), pin);
const std::optional<std::string> metrics_name =
@@ -420,6 +444,11 @@ void CustomizeToolbarHandler::OnPinSplit
prefs()->GetBoolean(prefs::kPinSplitTabButton));
}
+void CustomizeToolbarHandler::OnShowAvatarButtonChanged() {
+ OnActionPinnedChanged(kActionAvatar,
+ prefs()->GetBoolean(prefs::kShowAvatarButton));
+}
+
void CustomizeToolbarHandler::OnActionItemChanged() {
client_->NotifyActionsUpdated();
}
--- a/chrome/browser/ui/webui/side_panel/customize_chrome/customize_toolbar/customize_toolbar_handler.h
+++ b/chrome/browser/ui/webui/side_panel/customize_chrome/customize_toolbar/customize_toolbar_handler.h
@@ -54,6 +54,7 @@ class CustomizeToolbarHandler
void OnShowHomeButtonChanged();
void OnShowForwardButtonChanged();
void OnPinSplitTabButtonChanged();
+ void OnShowAvatarButtonChanged();
void OnActionItemChanged();
PrefService* prefs() const;
--- a/chrome/common/pref_names.h
+++ b/chrome/common/pref_names.h
@@ -1332,6 +1332,10 @@ inline constexpr char kSplitViewDragAndD
inline constexpr char kSplitViewDragAndDropNudgeUsedCount[] =
"browser.split_view_drag_and_drop_nudge_used_count";
+// A boolean pref set to true if the Avatar button should be visible on the
+// toolbar.
+inline constexpr char kShowAvatarButton[] = "helium.browser.show_avatar_button";
+
// A boolean pref set to true if Gemini integration be enabled. This is managed
// by enterprise policy.
inline constexpr char kGeminiSettings[] = "browser.gemini_settings";
@@ -1,234 +0,0 @@
--- a/chrome/browser/extensions/api/settings_private/prefs_util.cc
+++ b/chrome/browser/extensions/api/settings_private/prefs_util.cc
@@ -233,6 +233,8 @@ const PrefsUtil::TypedPrefMap& PrefsUtil
// Custom toolbar button settings.
(*s_allowlist)[::prefs::kShowAvatarButton] =
settings_api::PrefType::kBoolean;
+ (*s_allowlist)[::prefs::kShowExtensionsButton] =
+ settings_api::PrefType::kBoolean;
// Appearance settings.
(*s_allowlist)[::prefs::kCurrentThemeID] = settings_api::PrefType::kString;
--- a/chrome/browser/ui/actions/chrome_action_id.h
+++ b/chrome/browser/ui/actions/chrome_action_id.h
@@ -559,6 +559,7 @@
E(kActionHome, IDC_HOME) \
E(kActionForward, IDC_FORWARD) \
E(kActionAvatar, IDC_SHOW_AVATAR_MENU) \
+ E(kActionExtensions) \
E(kActionNewIncognitoWindow, IDC_NEW_INCOGNITO_WINDOW) \
E(kActionSendSharedTabGroupFeedback, IDC_SEND_SHARED_TAB_GROUP_FEEDBACK) \
E(kActionShowPasswordManager, IDC_SHOW_PASSWORD_MANAGER) \
--- a/chrome/browser/ui/browser_ui_prefs.cc
+++ b/chrome/browser/ui/browser_ui_prefs.cc
@@ -125,6 +125,8 @@ void RegisterBrowserUserPrefs(user_prefs
registry->RegisterBooleanPref(
prefs::kShowAvatarButton, true);
+ registry->RegisterBooleanPref(
+ prefs::kShowExtensionsButton, true);
registry->RegisterInt64Pref(prefs::kDefaultBrowserLastDeclined, 0);
registry->RegisterBooleanPref(prefs::kWebAppCreateOnDesktop, true);
--- a/chrome/browser/ui/toolbar/pinned_toolbar/pinned_toolbar_actions_model.cc
+++ b/chrome/browser/ui/toolbar/pinned_toolbar/pinned_toolbar_actions_model.cc
@@ -217,6 +217,7 @@ void PinnedToolbarActionsModel::ResetToD
pref_service_->ClearPref(prefs::kShowHomeButton);
pref_service_->ClearPref(prefs::kShowForwardButton);
pref_service_->ClearPref(prefs::kShowAvatarButton);
+ pref_service_->ClearPref(prefs::kShowExtensionsButton);
pref_service_->ClearPref(prefs::kPinnedActions);
}
@@ -233,7 +234,12 @@ bool PinnedToolbarActionsModel::IsDefaul
const bool avatar_is_default =
pref_service_->GetDefaultPrefValue(prefs::kShowAvatarButton)
->GetBool() == pref_service_->GetBoolean(prefs::kShowAvatarButton);
- return action_are_default && home_is_default && forward_is_default && avatar_is_default;
+ const bool extensions_is_default =
+ pref_service_->GetDefaultPrefValue(prefs::kShowExtensionsButton)
+ ->GetBool() == pref_service_->GetBoolean(prefs::kShowExtensionsButton);
+ return action_are_default && home_is_default &&
+ forward_is_default && avatar_is_default &&
+ extensions_is_default;
}
void PinnedToolbarActionsModel::MaybeMigrateExistingPinnedStates() {
--- a/chrome/browser/ui/views/extensions/extensions_toolbar_container.cc
+++ b/chrome/browser/ui/views/extensions/extensions_toolbar_container.cc
@@ -552,7 +552,9 @@ void ExtensionsToolbarContainer::AnchorA
// Fix the position of widgets. Without this fix, extension-installed-bubble
// and extension-uninstall-dialog may be out of the window border on Linux.
- if (base::CommandLine::ForCurrentProcess()->HasSwitch("hide-extensions-menu"))
+ if (!browser_->profile()->GetPrefs()->GetBoolean(
+ prefs::kShowExtensionsButton) ||
+ base::CommandLine::ForCurrentProcess()->HasSwitch("hide-extensions-menu"))
{
views::View* anchor_view = BrowserView::GetBrowserViewForBrowser(browser_)
->toolbar_button_provider()->GetAppMenuButton();
@@ -962,7 +964,9 @@ void ExtensionsToolbarContainer::UpdateC
}
bool ExtensionsToolbarContainer::ShouldContainerBeVisible() const {
- if (base::CommandLine::ForCurrentProcess()->HasSwitch("hide-extensions-menu"))
+ if (!browser_->profile()->GetPrefs()->GetBoolean(
+ prefs::kShowExtensionsButton) ||
+ base::CommandLine::ForCurrentProcess()->HasSwitch("hide-extensions-menu"))
return false;
// The container (and extensions-menu button) should not be visible if we have
--- a/chrome/browser/ui/views/toolbar/toolbar_view.cc
+++ b/chrome/browser/ui/views/toolbar/toolbar_view.cc
@@ -543,6 +543,14 @@ void ToolbarView::Init() {
avatar_->SetVisible(show_avatar_button_.GetValue());
}
+ if (extensions_container_) {
+ show_extensions_button_.Init(
+ prefs::kShowExtensionsButton, prefs,
+ base::BindRepeating(&ToolbarView::OnShowExtensionsButtonChanged,
+ base::Unretained(this)));
+ extensions_container_->SetVisible(show_extensions_button_.GetValue());
+ }
+
InitLayout();
for (auto* button : std::array<views::Button*, 5>{back_, forward_, reload_,
@@ -1267,6 +1275,10 @@ void ToolbarView::OnShowAvatarButtonChan
avatar_->SetVisible(show_avatar_button_.GetValue());
}
+void ToolbarView::OnShowExtensionsButtonChanged() {
+ extensions_container_->SetVisible(show_extensions_button_.GetValue());
+}
+
void ToolbarView::OnTouchUiChanged() {
if (display_mode_ == DisplayMode::NORMAL) {
// Update the internal margins for touch layout.
--- a/chrome/browser/ui/views/toolbar/toolbar_view.h
+++ b/chrome/browser/ui/views/toolbar/toolbar_view.h
@@ -270,6 +270,8 @@ class ToolbarView : public views::Access
void OnShowAvatarButtonChanged();
+ void OnShowExtensionsButtonChanged();
+
void OnTouchUiChanged();
void UpdateClipPath();
@@ -322,6 +324,8 @@ class ToolbarView : public views::Access
BooleanPrefMember show_avatar_button_;
+ BooleanPrefMember show_extensions_button_;
+
BooleanPrefMember show_chrome_labs_button_;
// The display mode used when laying out the toolbar.
--- a/chrome/browser/ui/webui/side_panel/customize_chrome/customize_toolbar/customize_toolbar.mojom
+++ b/chrome/browser/ui/webui/side_panel/customize_chrome/customize_toolbar/customize_toolbar.mojom
@@ -17,6 +17,7 @@ enum ActionId {
kHome,
kForward,
kAvatar,
+ kExtensions,
kNewIncognitoWindow,
kShowPasswordManager,
kShowPaymentMethods,
--- a/chrome/browser/ui/webui/side_panel/customize_chrome/customize_toolbar/customize_toolbar_handler.cc
+++ b/chrome/browser/ui/webui/side_panel/customize_chrome/customize_toolbar/customize_toolbar_handler.cc
@@ -52,6 +52,8 @@ MojoActionForChromeAction(actions::Actio
return side_panel::customize_chrome::mojom::ActionId::kForward;
case kActionAvatar:
return side_panel::customize_chrome::mojom::ActionId::kAvatar;
+ case kActionExtensions:
+ return side_panel::customize_chrome::mojom::ActionId::kExtensions;
case kActionNewIncognitoWindow:
return side_panel::customize_chrome::mojom::ActionId::kNewIncognitoWindow;
case kActionShowPasswordsBubbleOrPage:
@@ -113,6 +115,8 @@ std::optional<actions::ActionId> ChromeA
return kActionForward;
case side_panel::customize_chrome::mojom::ActionId::kAvatar:
return kActionAvatar;
+ case side_panel::customize_chrome::mojom::ActionId::kExtensions:
+ return kActionExtensions;
case side_panel::customize_chrome::mojom::ActionId::kNewIncognitoWindow:
return kActionNewIncognitoWindow;
case side_panel::customize_chrome::mojom::ActionId::kShowPasswordManager:
@@ -182,6 +186,10 @@ CustomizeToolbarHandler::CustomizeToolba
prefs::kShowAvatarButton,
base::BindRepeating(&CustomizeToolbarHandler::OnShowAvatarButtonChanged,
base::Unretained(this)));
+ pref_change_registrar_.Add(
+ prefs::kShowExtensionsButton,
+ base::BindRepeating(&CustomizeToolbarHandler::OnShowExtensionsButtonChanged,
+ base::Unretained(this)));
}
CustomizeToolbarHandler::~CustomizeToolbarHandler() = default;
@@ -240,6 +248,19 @@ void CustomizeToolbarHandler::ListAction
actions.push_back(std::move(avatar_action));
+ auto extensions_action = side_panel::customize_chrome::mojom::Action::New(
+ MojoActionForChromeAction(kActionExtensions).value(),
+ base::UTF16ToUTF8(l10n_util::GetStringUTF16(IDS_TOOLTIP_EXTENSIONS_BUTTON)),
+ prefs()->GetBoolean(prefs::kShowExtensionsButton), false,
+ side_panel::customize_chrome::mojom::CategoryId::kYourChrome,
+ GURL(webui::EncodePNGAndMakeDataURI(
+ ui::ImageModel::FromVectorIcon(
+ vector_icons::kExtensionChromeRefreshIcon, icon_color_id)
+ .Rasterize(&provider),
+ scale_factor)));
+
+ actions.push_back(std::move(extensions_action));
+
if (base::FeatureList::IsEnabled(features::kSideBySide)) {
auto split_tab_action = side_panel::customize_chrome::mojom::Action::New(
MojoActionForChromeAction(kActionSplitTab).value(),
@@ -391,6 +412,9 @@ void CustomizeToolbarHandler::PinAction(
case kActionAvatar:
prefs()->SetBoolean(prefs::kShowAvatarButton, pin);
break;
+ case kActionExtensions:
+ prefs()->SetBoolean(prefs::kShowExtensionsButton, pin);
+ break;
default:
model_->UpdatePinnedState(chrome_action.value(), pin);
const std::optional<std::string> metrics_name =
@@ -449,6 +473,11 @@ void CustomizeToolbarHandler::OnShowAvat
prefs()->GetBoolean(prefs::kShowAvatarButton));
}
+void CustomizeToolbarHandler::OnShowExtensionsButtonChanged() {
+ OnActionPinnedChanged(kActionExtensions,
+ prefs()->GetBoolean(prefs::kShowExtensionsButton));
+}
+
void CustomizeToolbarHandler::OnActionItemChanged() {
client_->NotifyActionsUpdated();
}
--- a/chrome/browser/ui/webui/side_panel/customize_chrome/customize_toolbar/customize_toolbar_handler.h
+++ b/chrome/browser/ui/webui/side_panel/customize_chrome/customize_toolbar/customize_toolbar_handler.h
@@ -55,6 +55,7 @@ class CustomizeToolbarHandler
void OnShowForwardButtonChanged();
void OnPinSplitTabButtonChanged();
void OnShowAvatarButtonChanged();
+ void OnShowExtensionsButtonChanged();
void OnActionItemChanged();
PrefService* prefs() const;
--- a/chrome/common/pref_names.h
+++ b/chrome/common/pref_names.h
@@ -1336,6 +1336,10 @@ inline constexpr char kSplitViewDragAndD
// toolbar.
inline constexpr char kShowAvatarButton[] = "helium.browser.show_avatar_button";
+// A boolean pref set to true if the Extensions button should be visible on the
+// toolbar.
+inline constexpr char kShowExtensionsButton[] = "helium.browser.show_extensions_button";
+
// A boolean pref set to true if Gemini integration be enabled. This is managed
// by enterprise policy.
inline constexpr char kGeminiSettings[] = "browser.gemini_settings";
@@ -1,6 +1,6 @@
--- a/chrome/browser/ungoogled_flag_entries.h
+++ b/chrome/browser/ungoogled_flag_entries.h
@@ -145,7 +145,7 @@
@@ -133,7 +133,7 @@
"Return generic values for WebGLDebugRendererInfo to remove a potential data leak while preventing potential website breakage. ungoogled-chromium flag.",
kOsAll, FEATURE_WITH_PARAMS_VALUE_TYPE(blink::features::kSpoofWebGLInfo, kSpoofWebGLChoices, "SpoofWebGLInfo")},
{"increase-incognito-storage-quota",
+35 -23
View File
@@ -15,7 +15,7 @@
#define IDC_VISIT_DESKTOP_OF_LRU_USER_5 34083
--- a/chrome/common/pref_names.h
+++ b/chrome/common/pref_names.h
@@ -1493,6 +1493,11 @@ inline constexpr char kPageColorsBlockLi
@@ -1501,6 +1501,11 @@ inline constexpr char kPageColorsBlockLi
inline constexpr char kPrefersDefaultScrollbarStyles[] =
"settings.a11y.prefers_default_scrollbar_styles";
@@ -29,7 +29,7 @@
// asking the user to set up automatic updates when Keystone promotion is
--- a/chrome/browser/ui/browser_ui_prefs.cc
+++ b/chrome/browser/ui/browser_ui_prefs.cc
@@ -146,6 +146,8 @@ void RegisterBrowserUserPrefs(user_prefs
@@ -151,6 +151,8 @@ void RegisterBrowserUserPrefs(user_prefs
registry->RegisterListPref(prefs::kWebRtcLocalIpsAllowedUrls);
registry->RegisterBooleanPref(prefs::kWebRtcTextLogCollectionAllowed, false);
@@ -40,7 +40,7 @@
registry->RegisterBooleanPref(policy::policy_prefs::kHideWebStoreIcon, false);
--- a/chrome/browser/ui/browser_command_controller.cc
+++ b/chrome/browser/ui/browser_command_controller.cc
@@ -388,7 +388,9 @@ bool BrowserCommandController::IsReserve
@@ -408,7 +408,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 ||
@@ -51,7 +51,7 @@
}
void BrowserCommandController::TabStateChanged() {
@@ -1160,6 +1162,14 @@ bool BrowserCommandController::ExecuteCo
@@ -1207,6 +1209,14 @@ bool BrowserCommandController::ExecuteCo
case IDC_DUPLICATE_TARGET_TAB:
DuplicateKeyboardFocusedTab(browser_);
break;
@@ -66,7 +66,7 @@
// Hosted App commands
case IDC_COPY_URL:
CopyURL(browser_, browser_->tab_strip_model()->GetActiveWebContents());
@@ -1912,6 +1922,12 @@ void BrowserCommandController::UpdateCom
@@ -1994,6 +2004,12 @@ void BrowserCommandController::UpdateCom
bool dev_tools_enabled = DevToolsWindow::AllowDevToolsFor(
profile(), browser_->tab_strip_model()->GetActiveWebContents());
@@ -108,17 +108,18 @@
{true, false, false, true, kVK_UpArrow, IDC_FOCUS_PREVIOUS_PANE},
--- a/chrome/browser/ui/cocoa/accelerators_cocoa.mm
+++ b/chrome/browser/ui/cocoa/accelerators_cocoa.mm
@@ -37,7 +37,8 @@ const struct AcceleratorMapping {
@@ -37,7 +37,9 @@ const struct AcceleratorMapping {
{IDC_CUT, ui::EF_COMMAND_DOWN, ui::VKEY_X},
{IDC_DEV_TOOLS, ui::EF_COMMAND_DOWN | ui::EF_ALT_DOWN, ui::VKEY_I},
{IDC_DEV_TOOLS_CONSOLE, ui::EF_COMMAND_DOWN | ui::EF_ALT_DOWN, ui::VKEY_J},
- {IDC_DEV_TOOLS_INSPECT, ui::EF_COMMAND_DOWN | ui::EF_ALT_DOWN, ui::VKEY_C},
+ {IDC_DEV_TOOLS_INSPECT, ui::EF_COMMAND_DOWN | ui::EF_ALT_DOWN, ui::VKEY_E},
+ {IDC_COPY_OR_INSPECT_SHORTCUT, ui::EF_COMMAND_DOWN | ui::EF_SHIFT_DOWN, ui::VKEY_C},
+ {IDC_NEW_SPLIT_TAB, ui::EF_COMMAND_DOWN | ui::EF_ALT_DOWN, ui::VKEY_N},
{IDC_FIND, ui::EF_COMMAND_DOWN, ui::VKEY_F},
{IDC_NEW_INCOGNITO_WINDOW, ui::EF_COMMAND_DOWN | ui::EF_SHIFT_DOWN,
ui::VKEY_N},
@@ -73,9 +74,6 @@ const struct AcceleratorMapping {
@@ -73,9 +75,6 @@ const struct AcceleratorMapping {
// We used to define IDC_CLOSE_WINDOW here. Instead, see
// AcceleratorForCloseWindow().
{IDC_CLOSE_TAB, ui::EF_COMMAND_DOWN, ui::VKEY_W},
@@ -153,7 +154,7 @@
// Accounts / Users / People.
--- a/chrome/app/settings_strings.grdp
+++ b/chrome/app/settings_strings.grdp
@@ -193,6 +193,16 @@
@@ -190,6 +190,16 @@
Shows a confirmation when you copy links, images, or videos
</message>
</if>
@@ -172,7 +173,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
@@ -276,6 +276,7 @@ void AddA11yStrings(content::WebUIDataSo
@@ -285,6 +285,7 @@ void AddA11yStrings(content::WebUIDataSo
#endif // BUILDFLAG(IS_WIN) || BUILDFLAG(IS_LINUX) || BUILDFLAG(IS_MAC)
{"axTreeFixingTitle", IDS_SETTINGS_AX_TREE_FIXING_TITLE},
{"axTreeFixingSubtitle", IDS_SETTINGS_AX_TREE_FIXING_SUBTITLE},
@@ -180,18 +181,20 @@
};
html_source->AddLocalizedStrings(kLocalizedStrings);
--- a/chrome/browser/resources/settings/a11y_page/a11y_page.html
+++ b/chrome/browser/resources/settings/a11y_page/a11y_page.html
@@ -99,5 +99,9 @@
sub-label="$i18n{toastAlertLevelDescription}">
</settings-toggle-button>
</if>
+ <settings-toggle-button id="CopyPageUrlShortcut" class="hr"
+ pref="{{prefs.helium.settings.a11y.copy_page_url_shortcut}}"
+ label="$i18n{copyPageUrlShortcut}">
+ </settings-toggle-button>
</div>
</settings-section>
--- a/chrome/browser/resources/settings/appearance_page/appearance_behavior_page.html
+++ b/chrome/browser/resources/settings/appearance_page/appearance_behavior_page.html
@@ -1,6 +1,11 @@
<style include="cr-shared-style settings-shared"></style>
<settings-section page-title="$i18n{behaviorPageTitle}">
+ <settings-toggle-button class="hr" id="copyPageUrlShortcut"
+ pref="{{prefs.helium.settings.a11y.copy_page_url_shortcut}}"
+ label="$i18n{copyPageUrlShortcut}">
+ </settings-toggle-button>
+
<settings-toggle-button class="hr" id="autoPinNewTabGroups"
pref="{{prefs.auto_pin_new_tab_groups}}"
label="$i18n{autoPinNewTabGroups}">
--- a/third_party/devtools-frontend/src/front_end/panels/elements/elements-meta.ts
+++ b/third_party/devtools-frontend/src/front_end/panels/elements/elements-meta.ts
@@ -446,11 +446,11 @@ UI.ActionRegistration.registerActionExte
@@ -219,9 +222,18 @@
Item(IDS_PASTE_MAC)
.tag(IDC_CONTENT_CONTEXT_PASTE)
.action(@selector(paste:)),
@@ -523,6 +525,8 @@ NSMenuItem* BuildTabMenu(NSApplication*
.submenu({
Item(IDS_TAB_CXMENU_NEWTABTORIGHT)
.command_id(IDC_NEW_TAB_TO_RIGHT),
+ Item(IDS_TAB_CXMENU_ADD_TAB_TO_NEW_SPLIT)
+ .command_id(IDC_NEW_SPLIT_TAB),
Item(IDS_NEXT_TAB_MAC)
.command_id(IDC_SELECT_NEXT_TAB),
Item(IDS_PREV_TAB_MAC)
--- a/chrome/browser/ui/cocoa/share_menu_controller.mm
+++ b/chrome/browser/ui/cocoa/share_menu_controller.mm
@@ -99,12 +99,6 @@ bool CanShare() {
@@ -98,12 +98,6 @@ bool CanShare() {
// to fetch sharing services that can handle the NSURL type.
NSArray* services = [NSSharingService
sharingServicesForItems:@[ [NSURL URLWithString:@"https://google.com"] ]];
@@ -234,7 +246,7 @@
for (NSSharingService* service in services) {
// Email share service causes mysterious crashes, so share directly.
// See https://crbug.com/356643975
@@ -298,13 +292,4 @@ bool CanShare() {
@@ -297,13 +291,4 @@ bool CanShare() {
return item;
}
@@ -1,6 +1,6 @@
--- a/components/performance_manager/user_tuning/prefs.cc
+++ b/components/performance_manager/user_tuning/prefs.cc
@@ -25,7 +25,7 @@ void RegisterLocalStatePrefs(PrefRegistr
@@ -24,7 +24,7 @@ void RegisterLocalStatePrefs(PrefRegistr
kMemorySaverModeTimeBeforeDiscardInMinutes,
kDefaultMemorySaverModeTimeBeforeDiscardInMinutes);
registry->RegisterIntegerPref(
@@ -1,247 +0,0 @@
Audio Context fingerprinting mitigation, inspired by this patch in Cromite:
https://github.com/uazo/cromite/blob/b2824377/build/patches/AudioBuffer-AnalyserNode-fp-mitigations.patch
--- a/chrome/browser/helium_flag_choices.h
+++ b/chrome/browser/helium_flag_choices.h
@@ -28,6 +28,7 @@ namespace helium {
constexpr const char kDisableEchCommandLine[] = "disable-ech";
constexpr const char kCanvasNoiseCommandLine[] = "fingerprinting-canvas-noise";
+ constexpr const char kAudioContextJitterCommandLine[] = "fingerprinting-audio-context-jitter";
} // namespace helium
--- a/chrome/browser/helium_flag_entries.h
+++ b/chrome/browser/helium_flag_entries.h
@@ -20,4 +20,8 @@
"Canvas fingerprint deception",
"Enable noising pixels when the contents of a canvas are read back by a script. Bound to a browser session. Helium flag, Chromium feature.",
kOsAll, FEATURE_VALUE_TYPE(fingerprinting_protection_interventions::features::kCanvasNoise)},
+ {helium::kAudioContextJitterCommandLine,
+ "Audio Context fingerprint deception",
+ "Adds small random jitter (±0.01%) to audio data to prevent fingerprinting. Helium flag.",
+ kOsAll, FEATURE_VALUE_TYPE(blink::features::kAudioContextJitter)},
#endif /* CHROME_BROWSER_HELIUM_FLAG_ENTRIES_H_ */
--- a/third_party/blink/common/features.cc
+++ b/third_party/blink/common/features.cc
@@ -19,6 +19,10 @@
namespace blink::features {
+BASE_FEATURE(kAudioContextJitter,
+ "AudioContextJitter",
+ base::FEATURE_ENABLED_BY_DEFAULT);
+
BASE_FEATURE(kDisableLinkDrag, "DisableLinkDrag", base::FEATURE_DISABLED_BY_DEFAULT);
BASE_FEATURE(kReducedSystemInfo, "ReducedSystemInfo", base::FEATURE_DISABLED_BY_DEFAULT);
BASE_FEATURE(kRemoveClientHints, "RemoveClientHints", base::FEATURE_DISABLED_BY_DEFAULT);
--- a/third_party/blink/public/common/features.h
+++ b/third_party/blink/public/common/features.h
@@ -22,6 +22,8 @@
namespace blink {
namespace features {
+BLINK_COMMON_EXPORT BASE_DECLARE_FEATURE(kAudioContextJitter);
+
BLINK_COMMON_EXPORT BASE_DECLARE_FEATURE(kDisableLinkDrag);
BLINK_COMMON_EXPORT BASE_DECLARE_FEATURE(kReducedSystemInfo);
BLINK_COMMON_EXPORT BASE_DECLARE_FEATURE(kRemoveClientHints);
--- a/third_party/blink/renderer/modules/webaudio/audio_buffer.cc
+++ b/third_party/blink/renderer/modules/webaudio/audio_buffer.cc
@@ -32,6 +32,7 @@
#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"
@@ -200,6 +201,20 @@ AudioBuffer::AudioBuffer(AudioBus* bus)
}
}
+void AudioBuffer::JitterAudioData() {
+ if (!base::FeatureList::IsEnabled(features::kAudioContextJitter)) {
+ return;
+ }
+
+ for (unsigned i = 0; i < channels_.size(); ++i) {
+ if (NotShared<DOMFloat32Array> channel = getChannelData(i)) {
+ for (float& sample : channel->AsSpan()) {
+ sample = BaseAudioContext::JitterAudioData(sample);
+ }
+ }
+ }
+}
+
NotShared<DOMFloat32Array> AudioBuffer::getChannelData(
unsigned channel_index,
ExceptionState& exception_state) {
--- a/third_party/blink/renderer/modules/webaudio/audio_buffer.h
+++ b/third_party/blink/renderer/modules/webaudio/audio_buffer.h
@@ -116,6 +116,8 @@ class MODULES_EXPORT AudioBuffer final :
std::unique_ptr<SharedAudioBuffer> CreateSharedAudioBuffer();
+ void JitterAudioData();
+
private:
static DOMFloat32Array* CreateFloat32ArrayOrNull(
uint32_t length,
--- a/third_party/blink/renderer/modules/webaudio/audio_context.cc
+++ b/third_party/blink/renderer/modules/webaudio/audio_context.cc
@@ -850,7 +850,12 @@ double AudioContext::baseLatency() const
DCHECK_CALLED_ON_VALID_SEQUENCE(main_thread_sequence_checker_);
DCHECK(destination());
- return base_latency_;
+ if (!base::FeatureList::IsEnabled(features::kAudioContextJitter)) {
+ return base_latency_;
+ }
+
+ // Round to two decimal places
+ return std::round(base_latency_ * 100.0) / 100.0;
}
double AudioContext::outputLatency() const {
--- a/third_party/blink/renderer/modules/webaudio/base_audio_context.cc
+++ b/third_party/blink/renderer/modules/webaudio/base_audio_context.cc
@@ -774,6 +774,13 @@ LocalDOMWindow* BaseAudioContext::GetWin
return To<LocalDOMWindow>(GetExecutionContext());
}
+float BaseAudioContext::JitterAudioData(float data) {
+ float variation = base::RandFloat() * 0.0001f; // 1/10000
+ float sign = base::RandBool() ? 1.0f : -1.0f;
+
+ return data * (1.0f + variation * sign);
+}
+
void BaseAudioContext::NotifySourceNodeStartedProcessing(AudioNode* node) {
DCHECK(IsMainThread());
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
@@ -327,6 +327,8 @@ class MODULES_EXPORT BaseAudioContext
// if the execution context does not exist.
bool CheckExecutionContextAndThrowIfNecessary(ExceptionState&);
+ static float JitterAudioData(float data);
+
protected:
enum class ContextType { kRealtimeContext, kOfflineContext };
--- a/third_party/blink/renderer/modules/webaudio/offline_audio_context.cc
+++ b/third_party/blink/renderer/modules/webaudio/offline_audio_context.cc
@@ -375,6 +375,8 @@ void OfflineAudioContext::FireCompletion
return;
}
+ rendered_buffer->JitterAudioData();
+
// Call the offline rendering completion event listener and resolve the
// promise too.
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
@@ -32,6 +32,8 @@
#include <complex>
#include "base/compiler_specific.h"
+#include "third_party/blink/public/common/features.h"
+#include "third_party/blink/renderer/modules/webaudio/base_audio_context.h"
#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"
@@ -114,10 +116,15 @@ void RealtimeAnalyser::GetFloatFrequency
const float* source = magnitude_buffer_.Data();
float* destination = destination_array->Data();
+ const bool kJitterEnabled = base::FeatureList::IsEnabled(
+ features::kAudioContextJitter);
+
for (unsigned i = 0; i < len; ++i) {
const float linear_value = UNSAFE_TODO(source[i]);
const double db_mag = audio_utilities::LinearToDecibels(linear_value);
- UNSAFE_TODO(destination[i]) = static_cast<float>(db_mag);
+ auto db_value = static_cast<float>(db_mag);
+ UNSAFE_TODO(destination[i]) = kJitterEnabled ?
+ BaseAudioContext::JitterAudioData(db_value) : db_value;
}
}
}
@@ -149,15 +156,22 @@ void RealtimeAnalyser::GetByteFrequencyD
const float* source = magnitude_buffer_.Data();
unsigned char* destination = destination_array->Data();
+ const bool kJitterEnabled = base::FeatureList::IsEnabled(
+ features::kAudioContextJitter);
+
for (unsigned i = 0; i < len; ++i) {
const float linear_value = UNSAFE_TODO(source[i]);
const double db_mag = audio_utilities::LinearToDecibels(linear_value);
// The range m_minDecibels to m_maxDecibels will be scaled to byte values
// from 0 to UCHAR_MAX.
- const double scaled_value =
+ double scaled_value =
UCHAR_MAX * (db_mag - min_decibels) * range_scale_factor;
+ if (kJitterEnabled) {
+ scaled_value = BaseAudioContext::JitterAudioData(scaled_value);
+ }
+
// Clip to valid range.
UNSAFE_TODO(destination[i]) =
static_cast<unsigned char>(ClampTo(scaled_value, 0, UCHAR_MAX));
@@ -182,12 +196,19 @@ void RealtimeAnalyser::GetFloatTimeDomai
const unsigned write_index = GetWriteIndex();
+ const bool kJitterEnabled = base::FeatureList::IsEnabled(
+ features::kAudioContextJitter);
+
for (unsigned i = 0; i < len; ++i) {
// Buffer access is protected due to modulo operation.
float value = UNSAFE_TODO(
input_buffer[(i + write_index - fft_size + kInputBufferSize) %
kInputBufferSize]);
+ if (kJitterEnabled) {
+ value = BaseAudioContext::JitterAudioData(value);
+ }
+
UNSAFE_TODO(destination[i]) = value;
}
}
@@ -209,12 +230,19 @@ void RealtimeAnalyser::GetByteTimeDomain
const unsigned write_index = GetWriteIndex();
+ const bool kJitterEnabled = base::FeatureList::IsEnabled(
+ features::kAudioContextJitter);
+
for (unsigned i = 0; i < len; ++i) {
// Buffer access is protected due to modulo operation.
- const float value = UNSAFE_TODO(
+ float value = UNSAFE_TODO(
input_buffer[(i + write_index - fft_size + kInputBufferSize) %
kInputBufferSize]);
+ if (kJitterEnabled) {
+ value = BaseAudioContext::JitterAudioData(value);
+ }
+
// Scale from nominal -1 -> +1 to unsigned byte.
const double scaled_value = 128 * (value + 1);
--- a/third_party/blink/renderer/platform/runtime_enabled_features.json5
+++ b/third_party/blink/renderer/platform/runtime_enabled_features.json5
@@ -599,7 +599,6 @@
// AudioContext.playoutStats interface.
// https://chromestatus.com/feature/5172818344148992
name: "AudioContextPlayoutStats",
- origin_trial_feature_name: "AudioContextPlayoutStats",
status: "experimental",
},
{
@@ -1,69 +0,0 @@
--- a/chrome/browser/helium_flag_choices.h
+++ b/chrome/browser/helium_flag_choices.h
@@ -27,6 +27,7 @@ namespace helium {
};
constexpr const char kDisableEchCommandLine[] = "disable-ech";
+ constexpr const char kCanvasNoiseCommandLine[] = "fingerprinting-canvas-noise";
} // namespace helium
--- a/chrome/browser/helium_flag_entries.h
+++ b/chrome/browser/helium_flag_entries.h
@@ -16,4 +16,8 @@
"Disables TLS Encrypted Client Hello. Not recommended unless you live in an area with heavy Internet"
" censorship and ECH prevents websites from loading. Helium flag.",
kOsAll, SINGLE_VALUE_TYPE(helium::kDisableEchCommandLine)},
+ {helium::kCanvasNoiseCommandLine,
+ "Canvas fingerprint deception",
+ "Enable noising pixels when the contents of a canvas are read back by a script. Bound to a browser session. Helium flag, Chromium feature.",
+ kOsAll, FEATURE_VALUE_TYPE(fingerprinting_protection_interventions::features::kCanvasNoise)},
#endif /* CHROME_BROWSER_HELIUM_FLAG_ENTRIES_H_ */
--- a/components/fingerprinting_protection_filter/interventions/common/interventions_features.cc
+++ b/components/fingerprinting_protection_filter/interventions/common/interventions_features.cc
@@ -10,13 +10,13 @@ namespace fingerprinting_protection_inte
// Whether the canvas interventions should be enabled that add noise to the
// readback values.
-BASE_FEATURE(kCanvasNoise, base::FeatureState::FEATURE_DISABLED_BY_DEFAULT);
+BASE_FEATURE(kCanvasNoise, base::FeatureState::FEATURE_ENABLED_BY_DEFAULT);
BASE_FEATURE_PARAM(bool,
kCanvasNoiseInRegularMode,
&kCanvasNoise,
"enable_in_regular_mode",
- false);
+ true);
// [Experimental] Whether readback of canvases should be blocked.
BASE_FEATURE(kBlockCanvasReadback,
--- a/third_party/blink/renderer/core/canvas_interventions/canvas_interventions_helper.cc
+++ b/third_party/blink/renderer/core/canvas_interventions/canvas_interventions_helper.cc
@@ -157,17 +157,6 @@ bool CanvasInterventionsHelper::MaybeNoi
GetContextTypeForMetrics(execution_context)}),
static_cast<int>(high_entropy_canvas_op_types), canvas_op_exclusive_max);
- AuditsIssue::ReportUserReidentificationCanvasNoisedIssue(
- CaptureSourceLocation(execution_context), execution_context);
-
- execution_context->AddConsoleMessage(MakeGarbageCollected<ConsoleMessage>(
- mojom::blink::ConsoleMessageSource::kIntervention,
- mojom::blink::ConsoleMessageLevel::kInfo,
- "Noise was added to a canvas readback. If this has caused breakage, "
- "please file a bug at https://issues.chromium.org/issues/"
- "new?component=1456351&title=Canvas%20noise%20breakage. This "
- "feature can be disabled through chrome://flags/#enable-canvas-noise"));
-
base::TimeDelta elapsed_time = base::TimeTicks::Now() - start_time;
UMA_HISTOGRAM_CUSTOM_MICROSECONDS_TIMES(kNoiseDurationMetricName,
@@ -175,9 +164,6 @@ bool CanvasInterventionsHelper::MaybeNoi
base::Milliseconds(100), 100);
UMA_HISTOGRAM_COUNTS_1M(kCanvasSizeMetricName,
pixmap_to_noise.width() * pixmap_to_noise.height());
- UseCounter::Count(execution_context, WebFeature::kCanvasReadbackNoise);
- auto* helper = CanvasInterventionsHelper::From(execution_context);
- helper->IncrementNoisedCanvasReadbacks();
return true;
}
+423
View File
@@ -0,0 +1,423 @@
--- a/chrome/browser/helium_flag_choices.h
+++ b/chrome/browser/helium_flag_choices.h
@@ -30,6 +30,7 @@ namespace helium {
constexpr const char kHeliumNoiseCommandLine[] = "helium-noise";
constexpr const char kHeliumNoiseCanvasCommandLine[] = "helium-noise-canvas";
+ constexpr const char kHeliumNoiseAudioCommandLine[] = "helium-noise-audio";
} // namespace helium
--- a/chrome/browser/helium_flag_entries.h
+++ b/chrome/browser/helium_flag_entries.h
@@ -24,4 +24,8 @@
"[Helium Noise] Canvas pixel noising",
"Adds insignificant noise to canvas pixels during readback to deceive canvas-based fingerprinting. Helium flag.",
kOsAll, FEATURE_VALUE_TYPE(blink::features::kHeliumNoiseCanvas)},
+ {helium::kHeliumNoiseAudioCommandLine,
+ "[Helium Noise] Jitter audio context data",
+ "Adds insignificant jitter to audio data to deceive AudioContext-based fingerprinting. Helium flag.",
+ kOsAll, FEATURE_VALUE_TYPE(blink::features::kHeliumNoiseAudio)},
#endif /* CHROME_BROWSER_HELIUM_FLAG_ENTRIES_H_ */
--- a/third_party/blink/common/features.cc
+++ b/third_party/blink/common/features.cc
@@ -47,6 +47,10 @@ BASE_FEATURE(kHeliumNoise,
BASE_FEATURE(kHeliumNoiseCanvas,
base::FEATURE_ENABLED_BY_DEFAULT);
+// Audio Context jitter for fingerprinting protection.
+BASE_FEATURE(kHeliumNoiseAudio,
+ base::FEATURE_ENABLED_BY_DEFAULT);
+
// Controls whether to include information about the page's open popup in
// AIPageContent.
BASE_FEATURE(kAIPageContentIncludePopupWindows,
--- a/third_party/blink/public/common/features.h
+++ b/third_party/blink/public/common/features.h
@@ -42,6 +42,7 @@ BLINK_COMMON_EXPORT extern const base::F
BLINK_COMMON_EXPORT BASE_DECLARE_FEATURE(kHeliumNoise);
BLINK_COMMON_EXPORT BASE_DECLARE_FEATURE(kHeliumNoiseCanvas);
+BLINK_COMMON_EXPORT BASE_DECLARE_FEATURE(kHeliumNoiseAudio);
// Controls whether to include information about the page's open popup in
// 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 @@
#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"
@@ -200,6 +201,20 @@ AudioBuffer::AudioBuffer(AudioBus* bus)
}
}
+void AudioBuffer::JitterAudioData(ExecutionContext* context) {
+ if (!base::FeatureList::IsEnabled(blink::features::kHeliumNoiseAudio)) {
+ return;
+ }
+
+ for (unsigned i = 0; i < channels_.size(); ++i) {
+ if (NotShared<DOMFloat32Array> channel = getChannelData(i)) {
+ for (float& sample : channel->AsSpan()) {
+ sample = BaseAudioContext::JitterAudioData(sample, context);
+ }
+ }
+ }
+}
+
NotShared<DOMFloat32Array> AudioBuffer::getChannelData(
unsigned channel_index,
ExceptionState& exception_state) {
--- a/third_party/blink/renderer/modules/webaudio/audio_buffer.h
+++ b/third_party/blink/renderer/modules/webaudio/audio_buffer.h
@@ -41,6 +41,7 @@ namespace blink {
class AudioBus;
class AudioBufferOptions;
+class ExecutionContext;
class ExceptionState;
class SharedAudioBuffer;
@@ -115,6 +116,8 @@ class MODULES_EXPORT AudioBuffer final :
std::unique_ptr<SharedAudioBuffer> CreateSharedAudioBuffer();
+ void JitterAudioData(ExecutionContext* context);
+
private:
static DOMFloat32Array* CreateFloat32ArrayOrNull(
uint32_t length,
--- a/third_party/blink/renderer/modules/webaudio/audio_context.cc
+++ b/third_party/blink/renderer/modules/webaudio/audio_context.cc
@@ -969,7 +969,12 @@ double AudioContext::baseLatency() const
DCHECK_CALLED_ON_VALID_SEQUENCE(main_thread_sequence_checker_);
DCHECK(destination());
- return base_latency_;
+ if (!base::FeatureList::IsEnabled(blink::features::kHeliumNoiseAudio)) {
+ return base_latency_;
+ }
+
+ // Round to two decimal places
+ return std::round(base_latency_ * 100.0) / 100.0;
}
double AudioContext::outputLatency() const {
--- a/third_party/blink/renderer/modules/webaudio/base_audio_context.cc
+++ b/third_party/blink/renderer/modules/webaudio/base_audio_context.cc
@@ -26,10 +26,13 @@
#include "third_party/blink/renderer/modules/webaudio/base_audio_context.h"
#include <algorithm>
+#include <bit>
#include "base/metrics/histogram_functions.h"
#include "build/build_config.h"
#include "media/base/audio_bus.h"
+#include "third_party/blink/public/common/features.h"
+#include "third_party/blink/public/common/helium_noise/noise_token.h"
#include "third_party/blink/public/mojom/devtools/console_message.mojom-blink.h"
#include "third_party/blink/public/mojom/frame/lifecycle.mojom-shared.h"
#include "third_party/blink/public/platform/platform.h"
@@ -37,7 +40,9 @@
#include "third_party/blink/renderer/bindings/core/v8/dictionary.h"
#include "third_party/blink/renderer/bindings/core/v8/script_promise_resolver.h"
#include "third_party/blink/renderer/bindings/modules/v8/v8_periodic_wave_constraints.h"
+#include "third_party/blink/renderer/core/helium_noise/helium_noise_hash.h"
#include "third_party/blink/renderer/core/dom/dom_exception.h"
+#include "third_party/blink/renderer/core/execution_context/execution_context.h"
#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"
@@ -776,6 +781,35 @@ LocalDOMWindow* BaseAudioContext::GetWin
return To<LocalDOMWindow>(GetExecutionContext());
}
+float BaseAudioContext::JitterAudioData(float data, ExecutionContext* context) {
+ if (!base::FeatureList::IsEnabled(blink::features::kHeliumNoiseAudio)) {
+ return data;
+ }
+
+ if (!context || !context->GetHeliumNoiseTokens().contains(
+ HeliumNoiseFeature::kAudio)) {
+ return data;
+ }
+
+ HeliumNoiseHash noise_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);
+
+ // 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;
+
+ return data * (1.0f + jitter);
+}
+
void BaseAudioContext::NotifySourceNodeStartedProcessing(AudioNode* node) {
DCHECK(IsMainThread());
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
@@ -327,6 +327,8 @@ class MODULES_EXPORT BaseAudioContext
// if the execution context does not exist.
bool CheckExecutionContextAndThrowIfNecessary(ExceptionState&);
+ static float JitterAudioData(float data, ExecutionContext* context);
+
protected:
enum class ContextType { kRealtimeContext, kOfflineContext };
--- a/third_party/blink/renderer/modules/webaudio/offline_audio_context.cc
+++ b/third_party/blink/renderer/modules/webaudio/offline_audio_context.cc
@@ -413,6 +413,8 @@ void OfflineAudioContext::FireCompletion
return;
}
+ rendered_buffer->JitterAudioData(GetExecutionContext());
+
// Call the offline rendering completion event listener and resolve the
// promise too.
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 @@
#include "base/compiler_specific.h"
#include "media/base/audio_bus.h"
+#include "third_party/blink/public/common/features.h"
+#include "third_party/blink/renderer/modules/webaudio/base_audio_context.h"
#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"
@@ -98,7 +100,8 @@ bool RealtimeAnalyser::SetFftSize(uint32
}
void RealtimeAnalyser::GetFloatFrequencyData(DOMFloat32Array* destination_array,
- double current_time) {
+ double current_time,
+ ExecutionContext* context) {
DCHECK(IsMainThread());
DCHECK(destination_array);
@@ -115,16 +118,22 @@ void RealtimeAnalyser::GetFloatFrequency
const float* source = magnitude_buffer_.Data();
float* destination = destination_array->Data();
+ const bool jitter_enabled = base::FeatureList::IsEnabled(
+ blink::features::kHeliumNoiseAudio);
+
for (unsigned i = 0; i < len; ++i) {
const float linear_value = UNSAFE_TODO(source[i]);
const double db_mag = audio_utilities::LinearToDecibels(linear_value);
- UNSAFE_TODO(destination[i]) = static_cast<float>(db_mag);
+ auto db_value = static_cast<float>(db_mag);
+ UNSAFE_TODO(destination[i]) = jitter_enabled ?
+ BaseAudioContext::JitterAudioData(db_value, context) : db_value;
}
}
}
void RealtimeAnalyser::GetByteFrequencyData(DOMUint8Array* destination_array,
- double current_time) {
+ double current_time,
+ ExecutionContext* context) {
DCHECK(IsMainThread());
DCHECK(destination_array);
@@ -150,15 +159,22 @@ void RealtimeAnalyser::GetByteFrequencyD
const float* source = magnitude_buffer_.Data();
unsigned char* destination = destination_array->Data();
+ const bool jitter_enabled = base::FeatureList::IsEnabled(
+ blink::features::kHeliumNoiseAudio);
+
for (unsigned i = 0; i < len; ++i) {
const float linear_value = UNSAFE_TODO(source[i]);
const double db_mag = audio_utilities::LinearToDecibels(linear_value);
// The range m_minDecibels to m_maxDecibels will be scaled to byte values
// from 0 to UCHAR_MAX.
- const double scaled_value =
+ double scaled_value =
UCHAR_MAX * (db_mag - min_decibels) * range_scale_factor;
+ if (jitter_enabled) {
+ scaled_value = BaseAudioContext::JitterAudioData(scaled_value, context);
+ }
+
// Clip to valid range.
UNSAFE_TODO(destination[i]) =
static_cast<unsigned char>(ClampTo(scaled_value, 0, UCHAR_MAX));
@@ -167,7 +183,8 @@ void RealtimeAnalyser::GetByteFrequencyD
}
void RealtimeAnalyser::GetFloatTimeDomainData(
- DOMFloat32Array* destination_array) {
+ DOMFloat32Array* destination_array,
+ ExecutionContext* context) {
DCHECK(IsMainThread());
DCHECK(destination_array);
@@ -183,18 +200,26 @@ void RealtimeAnalyser::GetFloatTimeDomai
const unsigned write_index = GetWriteIndex();
+ const bool jitter_enabled = base::FeatureList::IsEnabled(
+ blink::features::kHeliumNoiseAudio);
+
for (unsigned i = 0; i < len; ++i) {
// Buffer access is protected due to modulo operation.
float value = UNSAFE_TODO(
input_buffer[(i + write_index - fft_size + kInputBufferSize) %
kInputBufferSize]);
+ if (jitter_enabled) {
+ value = BaseAudioContext::JitterAudioData(value, context);
+ }
+
UNSAFE_TODO(destination[i]) = value;
}
}
}
-void RealtimeAnalyser::GetByteTimeDomainData(DOMUint8Array* destination_array) {
+void RealtimeAnalyser::GetByteTimeDomainData(DOMUint8Array* destination_array,
+ ExecutionContext* context) {
DCHECK(IsMainThread());
DCHECK(destination_array);
@@ -210,12 +235,19 @@ void RealtimeAnalyser::GetByteTimeDomain
const unsigned write_index = GetWriteIndex();
+ const bool jitter_enabled = base::FeatureList::IsEnabled(
+ blink::features::kHeliumNoiseAudio);
+
for (unsigned i = 0; i < len; ++i) {
// Buffer access is protected due to modulo operation.
- const float value = UNSAFE_TODO(
+ float value = UNSAFE_TODO(
input_buffer[(i + write_index - fft_size + kInputBufferSize) %
kInputBufferSize]);
+ if (jitter_enabled) {
+ value = BaseAudioContext::JitterAudioData(value, context);
+ }
+
// Scale from nominal -1 -> +1 to unsigned byte.
const double scaled_value = 128 * (value + 1);
--- a/third_party/blink/renderer/platform/runtime_enabled_features.json5
+++ b/third_party/blink/renderer/platform/runtime_enabled_features.json5
@@ -634,7 +634,6 @@
// AudioContext.playoutStats interface.
// https://chromestatus.com/feature/5172818344148992
name: "AudioContextPlayoutStats",
- origin_trial_feature_name: "AudioContextPlayoutStats",
status: "experimental",
},
{
--- a/third_party/blink/renderer/modules/webaudio/analyser_handler.h
+++ b/third_party/blink/renderer/modules/webaudio/analyser_handler.h
@@ -13,6 +13,7 @@ namespace blink {
class AudioNode;
class ExceptionState;
+class ExecutionContext;
class AnalyserHandler final : public AudioHandler {
public:
@@ -37,17 +38,17 @@ class AnalyserHandler final : public Aud
}
void SetSmoothingTimeConstant(double k, ExceptionState&);
- void GetFloatFrequencyData(DOMFloat32Array* array, double current_time) {
- analyser_.GetFloatFrequencyData(array, current_time);
+ void GetFloatFrequencyData(DOMFloat32Array* array, double current_time, ExecutionContext* context) {
+ analyser_.GetFloatFrequencyData(array, current_time, context);
}
- void GetByteFrequencyData(DOMUint8Array* array, double current_time) {
- analyser_.GetByteFrequencyData(array, current_time);
+ void GetByteFrequencyData(DOMUint8Array* array, double current_time, ExecutionContext* context) {
+ analyser_.GetByteFrequencyData(array, current_time, context);
}
- void GetFloatTimeDomainData(DOMFloat32Array* array) {
- analyser_.GetFloatTimeDomainData(array);
+ void GetFloatTimeDomainData(DOMFloat32Array* array, ExecutionContext* context) {
+ analyser_.GetFloatTimeDomainData(array, context);
}
- void GetByteTimeDomainData(DOMUint8Array* array) {
- analyser_.GetByteTimeDomainData(array);
+ void GetByteTimeDomainData(DOMUint8Array* array, ExecutionContext* context) {
+ analyser_.GetByteTimeDomainData(array, context);
}
private:
--- a/third_party/blink/renderer/modules/webaudio/analyser_node.cc
+++ b/third_party/blink/renderer/modules/webaudio/analyser_node.cc
@@ -118,20 +118,22 @@ double AnalyserNode::smoothingTimeConsta
void AnalyserNode::getFloatFrequencyData(NotShared<DOMFloat32Array> array) {
GetAnalyserHandler().GetFloatFrequencyData(array.Get(),
- context()->currentTime());
+ context()->currentTime(),
+ GetExecutionContext());
}
void AnalyserNode::getByteFrequencyData(NotShared<DOMUint8Array> array) {
GetAnalyserHandler().GetByteFrequencyData(array.Get(),
- context()->currentTime());
+ context()->currentTime(),
+ GetExecutionContext());
}
void AnalyserNode::getFloatTimeDomainData(NotShared<DOMFloat32Array> array) {
- GetAnalyserHandler().GetFloatTimeDomainData(array.Get());
+ GetAnalyserHandler().GetFloatTimeDomainData(array.Get(), GetExecutionContext());
}
void AnalyserNode::getByteTimeDomainData(NotShared<DOMUint8Array> array) {
- GetAnalyserHandler().GetByteTimeDomainData(array.Get());
+ GetAnalyserHandler().GetByteTimeDomainData(array.Get(), GetExecutionContext());
}
void AnalyserNode::ReportDidCreate() {
--- a/third_party/blink/renderer/modules/webaudio/realtime_analyser.h
+++ b/third_party/blink/renderer/modules/webaudio/realtime_analyser.h
@@ -36,6 +36,7 @@
namespace blink {
class AudioBus;
+class ExecutionContext;
class RealtimeAnalyser final {
DISALLOW_NEW();
@@ -65,10 +66,10 @@ class RealtimeAnalyser final {
double SmoothingTimeConstant() const { return smoothing_time_constant_; }
void SetSmoothingTimeConstant(double k) { smoothing_time_constant_ = k; }
- void GetFloatFrequencyData(DOMFloat32Array*, double);
- void GetByteFrequencyData(DOMUint8Array*, double);
- void GetFloatTimeDomainData(DOMFloat32Array*);
- void GetByteTimeDomainData(DOMUint8Array*);
+ void GetFloatFrequencyData(DOMFloat32Array*, double, ExecutionContext*);
+ void GetByteFrequencyData(DOMUint8Array*, double, ExecutionContext*);
+ void GetFloatTimeDomainData(DOMFloat32Array*, ExecutionContext*);
+ void GetByteTimeDomainData(DOMUint8Array*, ExecutionContext*);
// The audio thread writes input data here.
void WriteInput(AudioBus*, uint32_t frames_to_process);
+421
View File
@@ -0,0 +1,421 @@
# Some files in this patch are sourced from Chromium. They were
# heavily modified to fit Helium's needs.
#
# Chromium's license header is maintained wherever applicable to
# respect the original authorship of code.
#
# Chromium LICENSE:
#
# Copyright 2015 The Chromium Authors
#
# Redistribution and use in source and binary forms, with or without
# modification, are permitted provided that the following conditions are
# met:
#
# * Redistributions of source code must retain the above copyright
# notice, this list of conditions and the following disclaimer.
# * Redistributions in binary form must reproduce the above
# copyright notice, this list of conditions and the following disclaimer
# in the documentation and/or other materials provided with the
# distribution.
# * Neither the name of Google LLC nor the names of its
# contributors may be used to endorse or promote products derived from
# this software without specific prior written permission.
#
# THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
# "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
# LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
# A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
# OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
# SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
# LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
# DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
# THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
# (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
# OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
--- a/chrome/browser/helium_flag_choices.h
+++ b/chrome/browser/helium_flag_choices.h
@@ -29,6 +29,7 @@ namespace helium {
constexpr const char kDisableEchCommandLine[] = "disable-ech";
constexpr const char kHeliumNoiseCommandLine[] = "helium-noise";
+ constexpr const char kHeliumNoiseCanvasCommandLine[] = "helium-noise-canvas";
} // namespace helium
--- a/chrome/browser/helium_flag_entries.h
+++ b/chrome/browser/helium_flag_entries.h
@@ -20,4 +20,8 @@
"Helium Noise",
"Helium's anti-fingerprinting functionality. Adds insignificant noise to various features to deceive fingerprinting scripts. Enabled by default, must be enabled for other anti-fingerprinting features to work. Helium flag.",
kOsAll, FEATURE_VALUE_TYPE(blink::features::kHeliumNoise)},
+ {helium::kHeliumNoiseCanvasCommandLine,
+ "[Helium Noise] Canvas pixel noising",
+ "Adds insignificant noise to canvas pixels during readback to deceive canvas-based fingerprinting. Helium flag.",
+ kOsAll, FEATURE_VALUE_TYPE(blink::features::kHeliumNoiseCanvas)},
#endif /* CHROME_BROWSER_HELIUM_FLAG_ENTRIES_H_ */
--- a/third_party/blink/common/features.cc
+++ b/third_party/blink/common/features.cc
@@ -43,6 +43,10 @@ const base::FeatureParam<std::string> kS
BASE_FEATURE(kHeliumNoise,
base::FEATURE_ENABLED_BY_DEFAULT);
+// Canvas noise for fingerprinting protection.
+BASE_FEATURE(kHeliumNoiseCanvas,
+ base::FEATURE_ENABLED_BY_DEFAULT);
+
// Controls whether to include information about the page's open popup in
// AIPageContent.
BASE_FEATURE(kAIPageContentIncludePopupWindows,
--- a/third_party/blink/public/common/features.h
+++ b/third_party/blink/public/common/features.h
@@ -41,6 +41,7 @@ BLINK_COMMON_EXPORT extern const base::F
// on the identifier name of the generated feature.
BLINK_COMMON_EXPORT BASE_DECLARE_FEATURE(kHeliumNoise);
+BLINK_COMMON_EXPORT BASE_DECLARE_FEATURE(kHeliumNoiseCanvas);
// Controls whether to include information about the page's open popup in
// AIPageContent.
--- /dev/null
+++ b/third_party/blink/renderer/core/helium_noise/canvas_noising_helper.cc
@@ -0,0 +1,240 @@
+// 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.
+// -----------------------------------------------------------------------
+// Copyright 2025 The Chromium Authors
+// Use of this source code is governed by a BSD-style license that can be
+// found in the LICENSE file.
+
+#include "third_party/blink/renderer/core/helium_noise/canvas_noising_helper.h"
+
+#include <array>
+#include <cstddef>
+#include <cstdint>
+
+#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/platform/graphics/canvas_high_entropy_op_type.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 "ui/gfx/skia_span_util.h"
+
+namespace blink {
+
+namespace {
+
+constexpr uint8_t kMaxClosePixelDelta = 10u;
+constexpr uint8_t kMaxNoisePerChannel = 3u;
+constexpr uint8_t kChannelsPerPixel = 4u;
+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.
+const std::pair<PixelLocation, PixelLocation> GetRandomPixelLocations(
+ HeliumNoiseHash& token_hash,
+ const PixelLocation offset,
+ const int width,
+ const int height) {
+ std::pair<PixelLocation, PixelLocation> pixel_locations;
+ // Uses 2 * log2(kMaxClosePixelDelta*2+1) = 8 bits from hash.
+ pixel_locations.first = {
+ offset.x + token_hash.GetValueBelow(kMaxClosePixelDelta * 2) -
+ kMaxClosePixelDelta + 1,
+ offset.y + token_hash.GetValueBelow(kMaxClosePixelDelta * 2) -
+ kMaxClosePixelDelta + 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 max 2 * log2(kMaximumCanvasSize) = 40 bits from hash.
+ pixel_locations.second = {token_hash.GetValueBelow(width),
+ token_hash.GetValueBelow(height)};
+ // Used at most 48 bits from hash
+ return pixel_locations;
+}
+
+void HeliumNoisePixel(base::span<uint8_t> pixel, HeliumNoiseHash& token_hash) {
+ base::SpanWriter writer(base::as_writable_bytes(pixel));
+ for (int i = 0; i < kChannelsPerPixel; ++i) {
+ int channel_value = pixel[i];
+ // Clamp min- and maxNoisedVal to [0, 255] and [1, 255] for the alpha
+ // channel if it was non-zero before.
+ int lowerLimit = (i == kChannelsPerPixel - 1 && channel_value > 0) ? 1 : 0;
+ int minNoisedVal = channel_value <= kMaxNoisePerChannel
+ ? lowerLimit
+ : channel_value - kMaxNoisePerChannel;
+ int maxNoisedVal = channel_value >= 255 - kMaxNoisePerChannel
+ ? 255
+ : channel_value + kMaxNoisePerChannel;
+ int noise = token_hash.GetValueBelow(
+ std::min(kMaxNoisePerChannel * 2 + 1, maxNoisedVal - minNoisedVal + 1));
+ writer.WriteU8LittleEndian(
+ base::checked_cast<uint8_t>(minNoisedVal + noise));
+ }
+}
+
+base::span<uint8_t, 4u> GetPixelAt(const int x,
+ const int y,
+ const int width,
+ const base::span<uint8_t> pixels) {
+ return pixels
+ .subspan(static_cast<size_t>((x + y * width) * kChannelsPerPixel))
+ .first<4u>();
+}
+
+uint64_t GetValueFromPixelLocations(
+ const std::pair<PixelLocation, PixelLocation> locations,
+ const base::span<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 CopyPixelValue(const base::span<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>());
+}
+
+// Adds noise to the provided pixels in place, using |token_hash| as the
+// source for pseudo-randomness. This function assumes that there are 4
+// channels per pixel.
+void HeliumNoisePixels(const HeliumNoiseHash& token_hash,
+ base::span<uint8_t> pixels,
+ const int width,
+ const int height) {
+ CHECK_EQ(pixels.size(),
+ static_cast<size_t>(width * height * kChannelsPerPixel));
+
+ const size_t row_size = width * kChannelsPerPixel;
+ std::vector<uint8_t> row1(row_size);
+ std::vector<uint8_t> row2(row_size);
+ base::span<uint8_t> unnoised_previous_row(row1);
+ base::span<uint8_t> unnoised_current_row(row2);
+
+ for (int y = 0; y < height; ++y) {
+ unnoised_current_row.copy_from(pixels.subspan(y * row_size, row_size));
+ for (int x = 0; x < width; ++x) {
+ auto pixel = GetPixelAt(x, y, width, pixels);
+ if (pixel == kEmptyPixel) {
+ continue;
+ }
+ if (y > 0 && x > 0 &&
+ GetPixelAt(x - 1, 0, width, unnoised_previous_row) == pixel) {
+ // same top-left pixel, copy.
+ CopyPixelValue(GetPixelAt(x - 1, y - 1, width, pixels), pixel);
+ } else if (y > 0 &&
+ GetPixelAt(x, 0, width, unnoised_previous_row) == pixel) {
+ // same top pixel, copy.
+ CopyPixelValue(GetPixelAt(x, y - 1, width, pixels), pixel);
+ } else if (y > 0 && x < width - 1 &&
+ GetPixelAt(x + 1, 0, width, unnoised_previous_row) == pixel) {
+ // same top-right pixel, copy.
+ CopyPixelValue(GetPixelAt(x + 1, y - 1, width, pixels), pixel);
+ } else if (x > 0 &&
+ GetPixelAt(x - 1, 0, width, unnoised_current_row) == pixel) {
+ // same left pixel, copy.
+ CopyPixelValue(GetPixelAt(x - 1, y, width, pixels), pixel);
+ } else {
+ // otherwise, noise the pixel.
+ HeliumNoiseHash hash_copy = token_hash;
+ hash_copy.Update(base::U32FromLittleEndian(pixel));
+ // GetRandomPixelLocations consumes at most 46 bits from hash.
+ const std::pair<PixelLocation, PixelLocation> other_pixels =
+ GetRandomPixelLocations(hash_copy, {x, y}, width, height);
+ hash_copy.Update(
+ GetValueFromPixelLocations(other_pixels, pixels, width));
+ // HeliumNoisePixel consumes 12 bits from hash
+ HeliumNoisePixel(pixel, hash_copy);
+ }
+ }
+ // Previous can be overwritten (new current). Current is the now previous.
+ std::swap(unnoised_previous_row, unnoised_current_row);
+ }
+}
+
+} // namespace
+
+// static
+bool CanvasNoisingHelper::MaybeNoiseSnapshot(
+ ExecutionContext* execution_context,
+ scoped_refptr<StaticBitmapImage>& snapshot) {
+ CHECK(snapshot);
+
+ if (!base::FeatureList::IsEnabled(
+ blink::features::kHeliumNoiseCanvas)) {
+ return false;
+ }
+
+ // Check if execution context exists and has a canvas noise token
+ if (!execution_context ||
+ !execution_context->GetHeliumNoiseTokens().contains(
+ HeliumNoiseFeature::kCanvas)) {
+ return false;
+ }
+
+ // 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()),
+ kUnpremul_SkAlphaType, snapshot->GetColorSpace().ToSkColorSpace());
+ SkBitmap bm;
+ if (!bm.tryAllocPixels(info)) {
+ return false;
+ }
+
+ // Copy the original pixels from snapshot to the modifiable SkPixmap. SkBitmap
+ // should already allocate the correct amount of pixels, so this shouldn't
+ // fail because of memory allocation.
+ auto pixmap_to_noise = bm.pixmap();
+ PaintImage paint_image = snapshot->PaintImageForCurrentFrame();
+ if (!paint_image.readPixels(bm.info(), pixmap_to_noise.writable_addr(),
+ bm.rowBytes(), 0, 0)) {
+ return false;
+ }
+
+ 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());
+
+ auto noised_image = bm.asImage();
+ snapshot = blink::UnacceleratedStaticBitmapImage::Create(
+ std::move(noised_image), snapshot->Orientation());
+
+ return true;
+}
+
+} // namespace blink
--- /dev/null
+++ b/third_party/blink/renderer/core/helium_noise/canvas_noising_helper.h
@@ -0,0 +1,31 @@
+// 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.
+// -----------------------------------------------------------------------
+// Copyright 2025 The Chromium Authors
+// Use of this source code is governed by a BSD-style license that can be
+// found in the LICENSE file.
+
+#ifndef THIRD_PARTY_BLINK_RENDERER_CORE_HELIUM_NOISE_CANVAS_NOISING_HELPER_H_
+#define THIRD_PARTY_BLINK_RENDERER_CORE_HELIUM_NOISE_CANVAS_NOISING_HELPER_H_
+
+#include "third_party/blink/renderer/core/core_export.h"
+#include "third_party/blink/renderer/core/execution_context/execution_context.h"
+#include "third_party/blink/renderer/platform/graphics/static_bitmap_image.h"
+
+namespace blink {
+
+class CORE_EXPORT CanvasNoisingHelper {
+ public:
+ // If allowed, performs noising on a copy of the snapshot StaticBitmapImage
+ // and modifies it in place. Returns true if noise was applied.
+ static bool MaybeNoiseSnapshot(ExecutionContext* execution_context,
+ scoped_refptr<StaticBitmapImage>& snapshot);
+
+ private:
+ CanvasNoisingHelper() = delete;
+};
+
+} // namespace blink
+
+#endif // THIRD_PARTY_BLINK_RENDERER_CORE_HELIUM_NOISE_CANVAS_NOISING_HELPER_H_
--- a/third_party/blink/renderer/core/helium_noise/build.gni
+++ b/third_party/blink/renderer/core/helium_noise/build.gni
@@ -5,4 +5,6 @@
blink_core_sources_helium_noise = [
"helium_noise_hash.cc",
"helium_noise_hash.h",
+ "canvas_noising_helper.cc",
+ "canvas_noising_helper.h",
]
--- a/third_party/blink/renderer/core/html/canvas/html_canvas_element.cc
+++ b/third_party/blink/renderer/core/html/canvas/html_canvas_element.cc
@@ -72,6 +72,7 @@
#include "third_party/blink/renderer/core/frame/settings.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_async_blob_creator.h"
#include "third_party/blink/renderer/core/html/canvas/canvas_context_creation_attributes_core.h"
#include "third_party/blink/renderer/core/html/canvas/canvas_draw_listener.h"
@@ -1305,6 +1306,9 @@ String HTMLCanvasElement::ToDataURLInter
scoped_refptr<StaticBitmapImage> image_bitmap = Snapshot(source_buffer);
if (image_bitmap) {
+ CanvasNoisingHelper::MaybeNoiseSnapshot(GetExecutionContext(),
+ image_bitmap);
+
std::unique_ptr<ImageDataBuffer> data_buffer =
ImageDataBuffer::Create(image_bitmap);
if (!data_buffer)
@@ -1416,6 +1420,9 @@ void HTMLCanvasElement::toBlob(V8BlobCal
CanvasAsyncBlobCreator* async_creator = nullptr;
scoped_refptr<StaticBitmapImage> image_bitmap = Snapshot(kBackBuffer);
if (image_bitmap) {
+ CanvasNoisingHelper::MaybeNoiseSnapshot(GetExecutionContext(),
+ image_bitmap);
+
auto* options = ImageEncodeOptions::Create();
options->setType(ImageEncoderUtils::MimeTypeName(encoding_mime_type));
async_creator = MakeGarbageCollected<CanvasAsyncBlobCreator>(
--- a/third_party/blink/renderer/core/offscreencanvas/offscreen_canvas.cc
+++ b/third_party/blink/renderer/core/offscreencanvas/offscreen_canvas.cc
@@ -20,6 +20,7 @@
#include "third_party/blink/renderer/core/fileapi/blob.h"
#include "third_party/blink/renderer/core/frame/local_dom_window.h"
#include "third_party/blink/renderer/core/frame/local_frame.h"
+#include "third_party/blink/renderer/core/helium_noise/canvas_noising_helper.h"
#include "third_party/blink/renderer/core/html/canvas/canvas_async_blob_creator.h"
#include "third_party/blink/renderer/core/html/canvas/canvas_context_creation_attributes_core.h"
#include "third_party/blink/renderer/core/html/canvas/canvas_rendering_context.h"
@@ -342,11 +343,13 @@ ScriptPromise<Blob> OffscreenCanvas::con
base::TimeTicks start_time = base::TimeTicks::Now();
scoped_refptr<StaticBitmapImage> image_bitmap = context_->GetImage();
if (image_bitmap) {
+ auto* execution_context = ExecutionContext::From(script_state);
+ CanvasNoisingHelper::MaybeNoiseSnapshot(execution_context, image_bitmap);
+
auto* resolver = MakeGarbageCollected<ScriptPromiseResolver<Blob>>(
script_state, exception_state.GetContext());
CanvasAsyncBlobCreator::ToBlobFunctionType function_type =
CanvasAsyncBlobCreator::kOffscreenCanvasConvertToBlobPromise;
- auto* execution_context = ExecutionContext::From(script_state);
auto* async_creator = MakeGarbageCollected<CanvasAsyncBlobCreator>(
image_bitmap, options, function_type, start_time, execution_context,
resolver);
File diff suppressed because it is too large Load Diff
+360 -235
View File
@@ -1,8 +1,8 @@
--- a/components/helium_services/pref_names.h
+++ b/components/helium_services/pref_names.h
@@ -7,12 +7,20 @@
namespace prefs {
@@ -13,12 +13,20 @@ inline constexpr char kHeliumSchemaVersi
inline constexpr char kHeliumDisableSchemaAlerts[] =
"helium.services.disable_schema_alerts";
+inline constexpr char kHeliumPrefPrefix[] = "helium.";
+
@@ -23,8 +23,8 @@
#endif // COMPONENTS_HELIUM_SERVICES_PREF_NAMES_H_
--- a/chrome/browser/ui/browser_ui_prefs.cc
+++ b/chrome/browser/ui/browser_ui_prefs.cc
@@ -205,6 +205,8 @@ void RegisterBrowserUserPrefs(user_prefs
{
@@ -212,6 +212,8 @@ void RegisterBrowserUserPrefs(user_prefs
registry->RegisterBooleanPref(prefs::kHeliumDisableSchemaAlerts, false);
registry->RegisterBooleanPref(prefs::kHeliumServicesEnabled, true);
registry->RegisterStringPref(prefs::kHeliumServicesOrigin, "");
+ registry->RegisterBooleanPref(prefs::kHeliumDidOnboarding, false);
@@ -34,24 +34,24 @@
registry->RegisterBooleanPref(
--- a/chrome/browser/ui/startup/startup_browser_creator_impl.cc
+++ b/chrome/browser/ui/startup/startup_browser_creator_impl.cc
@@ -58,6 +58,7 @@
#include "chrome/common/chrome_version.h"
@@ -59,6 +59,7 @@
#include "chrome/common/pref_names.h"
#include "chrome/common/webui_url_constants.h"
+#include "components/helium_services/pref_names.h"
#include "components/custom_handlers/protocol_handler_registry.h"
+#include "components/helium_services/pref_names.h"
#include "components/prefs/pref_service.h"
#include "components/privacy_sandbox/privacy_sandbox_features.h"
@@ -488,6 +489,15 @@ StartupBrowserCreatorImpl::DetermineStar
#include "components/signin/public/base/signin_switches.h"
@@ -495,6 +496,15 @@ StartupBrowserCreatorImpl::DetermineStar
LaunchResult launch_result =
tabs.empty() ? LaunchResult::kNormally : LaunchResult::kWithGivenUrls;
+ bool no_first_run = base::CommandLine::ForCurrentProcess()->HasSwitch(
+ switches::kNoFirstRun);
+ bool no_first_run =
+ base::CommandLine::ForCurrentProcess()->HasSwitch(switches::kNoFirstRun);
+ if (!is_incognito_or_guest && !no_first_run) {
+ if (!profile_->GetPrefs()->GetBoolean(prefs::kHeliumDidOnboarding)) {
+ UrlsToTabs({ GURL(chrome::kHeliumSetupURL) }, &tabs);
+ return { tabs, LaunchResult::kWithGivenUrls };
+ UrlsToTabs({GURL(chrome::kHeliumSetupURL)}, &tabs);
+ return {tabs, LaunchResult::kWithGivenUrls};
+ }
+ }
+
@@ -60,12 +60,12 @@
whats_new::LogStartupType(whats_new::StartupType::kIneligible);
--- a/tools/gritsettings/resource_ids.spec
+++ b/tools/gritsettings/resource_ids.spec
@@ -1216,6 +1216,10 @@
"META": {"sizes": {"includes": [30],}},
"includes": [7480],
@@ -1254,6 +1254,10 @@
"META": {"sizes": {"includes": [10]}},
"includes": [7495],
},
+ "<(SHARED_INTERMEDIATE_DIR)/components/helium_onboarding/resources.grd": {
+ "META": {"sizes": {"includes": [30],}},
+ "META": {"sizes": {"includes": [48],}},
+ "includes": [7510],
+ },
# END components/ section.
@@ -73,17 +73,17 @@
# START ios/ section.
--- a/chrome/browser/BUILD.gn
+++ b/chrome/browser/BUILD.gn
@@ -8621,6 +8621,7 @@ static_library("browser_generated_files"
@@ -8587,6 +8587,7 @@ static_library("browser_generated_files"
"//chrome/browser/v8_compile_hints/proto",
"//chrome/browser/web_applications/mojom:mojom_web_apps_enum",
"//chrome/common/request_header_integrity:buildflags",
+ "//components/helium_onboarding:generated_resources",
"//components/autofill/core/browser/ml_model/logging:mojo_bindings",
"//components/data_sharing/data_sharing_internals/webui:mojo_bindings",
"//components/webui/chrome_urls/mojom:mojo_bindings",
"//components/enterprise/connectors:mojom",
--- a/chrome/chrome_paks.gni
+++ b/chrome/chrome_paks.gni
@@ -468,11 +468,13 @@ template("chrome_extra_paks") {
@@ -473,11 +473,13 @@ template("chrome_extra_paks") {
if (!is_android && !is_chromeos) {
sources += [
"$root_gen_dir/chrome/intro_resources.pak",
@@ -104,12 +104,12 @@
kChromeUIProfileInternalsHost,
content::kChromeUIQuotaInternalsHost,
+ kHeliumSetupHost,
kChromeUISignInInternalsHost,
kChromeUISiteEngagementHost,
#if !BUILDFLAG(IS_ANDROID)
kChromeUIWebUIToolbarHost,
#endif
--- a/chrome/common/webui_url_constants.h
+++ b/chrome/common/webui_url_constants.h
@@ -597,6 +597,8 @@ inline constexpr char kChromeUIProfilePi
@@ -601,6 +601,8 @@ inline constexpr char kChromeUIProfilePi
inline constexpr char kChromeUIProfilePickerStartupQuery[] = "startup";
inline constexpr char kChromeUIProfilePickerGlicQuery[] = "glic";
inline constexpr char kChromeUIProfilePickerUrl[] = "chrome://profile-picker/";
@@ -120,7 +120,7 @@
"chrome://history-sync-optin/";
--- a/chrome/browser/ui/BUILD.gn
+++ b/chrome/browser/ui/BUILD.gn
@@ -164,6 +164,10 @@ static_library("ui") {
@@ -167,6 +167,10 @@ static_library("ui") {
"webui/net_internals/net_internals_ui.h",
"webui/ntp_tiles_internals_ui.cc",
"webui/ntp_tiles_internals_ui.h",
@@ -133,15 +133,15 @@
"webui/omnibox/omnibox_ui.cc",
--- a/chrome/browser/ui/webui/chrome_web_ui_configs.cc
+++ b/chrome/browser/ui/webui/chrome_web_ui_configs.cc
@@ -38,6 +38,7 @@
#include "chrome/browser/ui/webui/net_export_ui.h"
@@ -39,6 +39,7 @@
#include "chrome/browser/ui/webui/net_internals/net_internals_ui.h"
#include "chrome/browser/ui/webui/ntp_tiles_internals_ui.h"
+#include "chrome/browser/ui/webui/onboarding/onboarding_page_ui.h"
#include "chrome/browser/ui/webui/omnibox/omnibox_ui.h"
+#include "chrome/browser/ui/webui/onboarding/onboarding_page_ui.h"
#include "chrome/browser/ui/webui/policy/policy_ui.h"
#include "chrome/browser/ui/webui/predictors/predictors_ui.h"
@@ -417,6 +418,7 @@ void RegisterChromeWebUIConfigs() {
#include "chrome/browser/ui/webui/privacy_sandbox/privacy_sandbox_internals_ui.h"
@@ -430,6 +431,7 @@ void RegisterChromeWebUIConfigs() {
#if !BUILDFLAG(IS_CHROMEOS) && !BUILDFLAG(IS_ANDROID)
map.AddWebUIConfig(std::make_unique<ManagedUserProfileNoticeUIConfig>());
map.AddWebUIConfig(std::make_unique<IntroUIConfig>());
@@ -151,7 +151,7 @@
map.AddWebUIConfig(std::make_unique<SigninErrorUIConfig>());
--- /dev/null
+++ b/chrome/browser/ui/webui/onboarding/onboarding_page_ui.cc
@@ -0,0 +1,41 @@
@@ -0,0 +1,46 @@
+// Copyright 2025 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.
@@ -160,36 +160,41 @@
+
+#include "chrome/browser/profiles/profile.h"
+#include "chrome/browser/ui/webui/onboarding/onboarding_handler.h"
+#include "chrome/browser/ui/webui/settings/brave_import_data_handler.h"
+#include "chrome/browser/ui/webui/settings/search_engines_handler.h"
+#include "chrome/browser/ui/webui/settings/settings_default_browser_handler.h"
+#include "chrome/browser/ui/webui/settings/brave_import_data_handler.h"
+#include "chrome/common/webui_url_constants.h"
+#include "content/public/browser/web_ui_controller.h"
+#include "content/public/browser/web_ui_data_source.h"
+#include "components/helium_onboarding/resources/grit/helium_onboarding_generated.h"
+#include "components/helium_onboarding/resources/grit/helium_onboarding_generated_map.h"
+#include "content/public/browser/web_contents.h"
+#include "content/public/browser/web_ui_controller.h"
+#include "content/public/browser/web_ui_data_source.h"
+#include "ui/webui/webui_util.h"
+
+HeliumOnboardingPage::HeliumOnboardingPage(content::WebUI* web_ui) : WebUIController(web_ui) {
+ Profile* profile = Profile::FromWebUI(web_ui);
+ content::WebUIDataSource* source =
+ content::WebUIDataSource::CreateAndAdd(profile, chrome::kHeliumSetupHost);
+HeliumOnboardingPage::HeliumOnboardingPage(content::WebUI* web_ui)
+ : WebUIController(web_ui) {
+ content::BrowserContext* browser_context =
+ web_ui->GetWebContents()->GetBrowserContext();
+ Profile* profile = Profile::FromBrowserContext(browser_context);
+ content::WebUIDataSource* source =
+ content::WebUIDataSource::CreateAndAdd(profile, chrome::kHeliumSetupHost);
+
+ webui::SetupWebUIDataSource(
+ source, kHeliumOnboardingGenerated,
+ IDR_HELIUM_ONBOARDING_INDEX_HTML);
+ webui::SetupWebUIDataSource(source, kHeliumOnboardingGenerated,
+ IDR_HELIUM_ONBOARDING_INDEX_HTML);
+
+ source->UseStringsJs();
+ source->DisableTrustedTypesCSP();
+ // TODO: remove this call once the following issue/s are resolved:
+ // https://github.com/sveltejs/svelte/issues/10826
+ // https://github.com/sveltejs/svelte/issues/14438
+ source->DisableTrustedTypesCSP();
+
+ web_ui->AddMessageHandler(
+ std::make_unique<OnboardingMessageHandler>(profile));
+ web_ui->AddMessageHandler(
+ std::make_unique<settings::SearchEnginesHandler>(profile));
+ web_ui->AddMessageHandler(
+ std::make_unique<settings::DefaultBrowserHandler>());
+ web_ui->AddMessageHandler(
+ std::make_unique<settings::BraveImportDataHandler>());
+ web_ui->AddMessageHandler(
+ std::make_unique<OnboardingMessageHandler>(browser_context));
+ web_ui->AddMessageHandler(
+ std::make_unique<settings::SearchEnginesHandler>(profile));
+ web_ui->AddMessageHandler(
+ std::make_unique<settings::DefaultBrowserHandler>());
+ web_ui->AddMessageHandler(
+ std::make_unique<settings::BraveImportDataHandler>());
+}
+
+HeliumOnboardingPage::~HeliumOnboardingPage() = default;
@@ -204,8 +209,8 @@
+#define CHROME_BROWSER_UI_WEBUI_ONBOARDING_ONBOARDING_PAGE_UI_H_
+
+#include "chrome/common/webui_url_constants.h"
+#include "content/public/browser/webui_config.h"
+#include "content/public/browser/web_ui_controller.h"
+#include "content/public/browser/webui_config.h"
+
+class HeliumOnboardingPage;
+
@@ -213,23 +218,23 @@
+ : public content::DefaultWebUIConfig<HeliumOnboardingPage> {
+ public:
+ HeliumOnboardingPageConfig()
+ : DefaultWebUIConfig(content::kChromeUIScheme,
+ chrome::kHeliumSetupHost) {}
+ : DefaultWebUIConfig(content::kChromeUIScheme, chrome::kHeliumSetupHost) {
+ }
+};
+
+class HeliumOnboardingPage : public content::WebUIController {
+public:
+ explicit HeliumOnboardingPage(content::WebUI* web_ui);
+ public:
+ explicit HeliumOnboardingPage(content::WebUI* web_ui);
+
+ HeliumOnboardingPage(const HeliumOnboardingPage&) = delete;
+ HeliumOnboardingPage& operator=(const HeliumOnboardingPage&) = delete;
+ ~HeliumOnboardingPage() override;
+ HeliumOnboardingPage(const HeliumOnboardingPage&) = delete;
+ HeliumOnboardingPage& operator=(const HeliumOnboardingPage&) = delete;
+ ~HeliumOnboardingPage() override;
+};
+
+#endif // CHROME_BROWSER_UI_WEBUI_ONBOARDING_ONBOARDING_PAGE_UI_H_
+#endif // CHROME_BROWSER_UI_WEBUI_ONBOARDING_ONBOARDING_PAGE_UI_H_
--- /dev/null
+++ b/chrome/browser/ui/webui/onboarding/onboarding_handler.cc
@@ -0,0 +1,190 @@
@@ -0,0 +1,281 @@
+// Copyright 2025 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.
@@ -241,188 +246,279 @@
+#include "base/strings/utf_string_conversions.h"
+#include "base/values.h"
+#include "chrome/browser/browser_process.h"
+#include "chrome/browser/extensions/webstore_install_with_prompt.h"
+#include "chrome/browser/profiles/profile.h"
+#include "chrome/browser/profiles/profile_attributes_storage.h"
+#include "chrome/browser/profiles/profile_manager.h"
+#include "chrome/browser/profiles/profiles_state.h"
+#include "chrome/browser/themes/theme_service.h"
+#include "chrome/browser/themes/theme_service_factory.h"
+#include "chrome/browser/ui/color/chrome_color_id.h"
+#include "chrome/common/extensions/webstore_install_result.h"
+#include "components/helium_services/pref_names.h"
+#include "components/helium_services/schema.h"
+#include "components/prefs/pref_change_registrar.h"
+#include "components/prefs/pref_service.h"
+#include "content/public/browser/web_contents.h"
+#include "ui/color/color_provider.h"
+#include "ui/gfx/color_utils.h"
+#include "content/public/browser/web_ui.h"
+#include "extensions/browser/extension_registrar.h"
+#include "extensions/browser/extension_registry.h"
+#include "extensions/common/extension.h"
+
+OnboardingMessageHandler::OnboardingMessageHandler(Profile* profile)
+ : profile_(profile),
+ pref_service_(profile->GetPrefs()) {
+ pref_change_registrar_.Init(pref_service_);
+OnboardingMessageHandler::OnboardingMessageHandler(
+ content::BrowserContext* browser_context)
+ : browser_context_(browser_context),
+ profile_(Profile::FromBrowserContext(browser_context)),
+ pref_service_(profile_->GetPrefs()) {
+ pref_change_registrar_.Init(pref_service_);
+
+ for (const auto [ key, _ ] : GetPreferencesDict()) {
+ pref_change_registrar_.Add(
+ prefs::kHeliumPrefPrefix + key,
+ base::BindRepeating(
+ &OnboardingMessageHandler::OnPreferencesChanged,
+ base::Unretained(this)
+ )
+ );
+ }
+
+ ThemeServiceFactory::GetForProfile(profile_)->AddObserver(this);
+ for (const auto [key, _] : GetPreferencesDict()) {
+ pref_change_registrar_.Add(
+ prefs::kHeliumPrefPrefix + key,
+ base::BindRepeating(&OnboardingMessageHandler::OnPreferencesChanged,
+ base::Unretained(this)));
+ }
+}
+
+OnboardingMessageHandler::~OnboardingMessageHandler() {
+ ThemeServiceFactory::GetForProfile(profile_)->RemoveObserver(this);
+}
+OnboardingMessageHandler::~OnboardingMessageHandler() = default;
+
+base::Value::Dict OnboardingMessageHandler::GetPreferencesDict() {
+ std::vector<PrefService::PreferenceValueAndStore> values =
+ pref_service_->GetPreferencesValueAndStore();
+ base::Value::Dict output;
+ std::vector<PrefService::PreferenceValueAndStore> values =
+ pref_service_->GetPreferencesValueAndStore();
+ base::Value::Dict output;
+
+ for (const auto& [name, value, _] : values) {
+ if (!base::StartsWith(name, prefs::kHeliumPrefPrefix,
+ base::CompareCase::SENSITIVE)) {
+ continue;
+ }
+
+ output.Set(
+ name.substr(sizeof(prefs::kHeliumPrefPrefix) - 1),
+ value.Clone()
+ );
+ for (const auto& [name, value, _] : values) {
+ if (!base::StartsWith(name, prefs::kHeliumPrefPrefix,
+ base::CompareCase::SENSITIVE)) {
+ continue;
+ }
+
+ return output;
+}
+ output.Set(name.substr(sizeof(prefs::kHeliumPrefPrefix) - 1),
+ value.Clone());
+ }
+
+void OnboardingMessageHandler::OnThemeChanged() {
+ AllowJavascript();
+ FireWebUIListener("ntp-background-changed", GetNTPBackgroundColor());
+ return output;
+}
+
+void OnboardingMessageHandler::OnPreferencesChanged() {
+ AllowJavascript();
+ FireWebUIListener("helium-prefs-changed", GetPreferencesDict());
+ AllowJavascript();
+ FireWebUIListener("helium-prefs-changed", GetPreferencesDict());
+}
+
+void OnboardingMessageHandler::OnExtensionLoaded(
+ content::BrowserContext*,
+ const extensions::Extension* extension) {
+ AllowJavascript();
+ FireWebUIListener("extension-state-changed",
+ base::Value::Dict().Set(extension->id(), true));
+}
+
+void OnboardingMessageHandler::OnExtensionUnloaded(
+ content::BrowserContext*,
+ const extensions::Extension* extension,
+ extensions::UnloadedExtensionReason reason) {
+ using extensions::UnloadedExtensionReason;
+ if (reason != UnloadedExtensionReason::DISABLE &&
+ reason != UnloadedExtensionReason::UNINSTALL) {
+ return;
+ }
+
+ AllowJavascript();
+ FireWebUIListener("extension-state-changed",
+ base::Value::Dict().Set(extension->id(), false));
+}
+
+void OnboardingMessageHandler::RegisterMessages() {
+ web_ui()->RegisterMessageCallback(
+ "getPrefs",
+ base::BindRepeating(&OnboardingMessageHandler::HandleGetPreferences,
+ base::Unretained(this)));
+
+ web_ui()->RegisterMessageCallback(
+ "setPref",
+ base::BindRepeating(&OnboardingMessageHandler::HandleSetPreference,
+ base::Unretained(this)));
+
+ web_ui()->RegisterMessageCallback(
+ "getProfileName",
+ base::BindRepeating(&OnboardingMessageHandler::HandleGetProfileName,
+ base::Unretained(this)));
+
+ web_ui()->RegisterMessageCallback(
+ "setProfileName",
+ base::BindRepeating(&OnboardingMessageHandler::HandleSetProfileName,
+ base::Unretained(this)));
+
+ web_ui()->RegisterMessageCallback(
+ "getBackgroundColor",
+ base::BindRepeating(&OnboardingMessageHandler::HandleGetBackgroundColor,
+ base::Unretained(this)));
+ web_ui()->RegisterMessageCallback(
+ "getPrefs",
+ base::BindRepeating(&OnboardingMessageHandler::HandleGetPreferences,
+ base::Unretained(this)));
+ web_ui()->RegisterMessageCallback(
+ "setPref",
+ base::BindRepeating(&OnboardingMessageHandler::HandleSetPreference,
+ base::Unretained(this)));
+ web_ui()->RegisterMessageCallback(
+ "acceptLatestSchema",
+ base::BindRepeating(&OnboardingMessageHandler::HandleAcceptSchema,
+ base::Unretained(this)));
+ web_ui()->RegisterMessageCallback(
+ "getProfileName",
+ base::BindRepeating(&OnboardingMessageHandler::HandleGetProfileName,
+ base::Unretained(this)));
+ web_ui()->RegisterMessageCallback(
+ "setProfileName",
+ base::BindRepeating(&OnboardingMessageHandler::HandleSetProfileName,
+ base::Unretained(this)));
+ web_ui()->RegisterMessageCallback(
+ "getExtensions",
+ base::BindRepeating(&OnboardingMessageHandler::HandleGetExtensions,
+ base::Unretained(this)));
+ web_ui()->RegisterMessageCallback(
+ "installExtension",
+ base::BindRepeating(&OnboardingMessageHandler::HandleInstallExtension,
+ base::Unretained(this)));
+}
+
+base::Value OnboardingMessageHandler::GetNTPBackgroundColor() {
+ return base::Value(
+ color_utils::SkColorToRgbaString(
+ web_ui()
+ ->GetWebContents()
+ ->GetColorProvider().GetColor(kColorNewTabPageBackground)
+ )
+ );
+void OnboardingMessageHandler::HandleGetExtensions(
+ const base::Value::List& args) {
+ CHECK_EQ(1U, args.size());
+ const auto& callback_id = args[0].GetString();
+ auto* registry = extensions::ExtensionRegistry::Get(browser_context_);
+
+ base::Value::Dict filtered_extension_data;
+ for (const auto& extension : registry->enabled_extensions()) {
+ filtered_extension_data.Set(extension->id(), true);
+ }
+
+ for (const auto& extension : registry->disabled_extensions()) {
+ filtered_extension_data.Set(extension->id(), false);
+ }
+
+ // If no one asked for a list of extensions yet, they probably don't
+ // care about extension changes, so we defer the observer init to here
+ // to avoid sending useless events.
+ if (!extension_registry_observation_.IsObserving()) {
+ extension_registry_observation_.Observe(registry);
+ }
+
+ AllowJavascript();
+ ResolveJavascriptCallback(base::Value(std::move(callback_id)),
+ std::move(filtered_extension_data));
+}
+
+void OnboardingMessageHandler::HandleGetBackgroundColor(const base::Value::List& args) {
+ CHECK_EQ(1U, args.size());
+ const auto& callback_id = args[0].GetString();
+void OnboardingMessageHandler::HandleInstallExtension(
+ const base::Value::List& args) {
+ CHECK_EQ(2U, args.size());
+ const auto& callback_id = args[0].GetString();
+ const auto& extension_id = args[1].GetString();
+
+ AllowJavascript();
+ ResolveJavascriptCallback(
+ base::Value(callback_id), GetNTPBackgroundColor());
+ // If the extension is already installed, but disabled, enable it.
+ const auto* registry = extensions::ExtensionRegistry::Get(browser_context_);
+ if (const auto* extension = registry->GetInstalledExtension(extension_id)) {
+ DoEnableExtension(callback_id, extension->id());
+ return;
+ }
+
+ // Otherwise, do the whole dance of installing an extension.
+ DoInstallExtension(callback_id, extension_id);
+}
+
+void OnboardingMessageHandler::HandleGetPreferences(const base::Value::List& args) {
+ CHECK_EQ(1U, args.size());
+ const auto& callback_id = args[0].GetString();
+
+ AllowJavascript();
+ ResolveJavascriptCallback(
+ base::Value(callback_id), base::Value(GetPreferencesDict()));
+void OnboardingMessageHandler::DoEnableExtension(
+ const std::string& callback_id,
+ const std::string& extension_id) {
+ extensions::ExtensionRegistrar::Get(browser_context_)
+ ->EnableExtension(extension_id);
+ AllowJavascript();
+ ResolveJavascriptCallback(base::Value(callback_id), base::Value());
+}
+
+void OnboardingMessageHandler::HandleGetProfileName(const base::Value::List& args) {
+ CHECK_EQ(1U, args.size());
+ const auto& callback_id = args[0].GetString();
+void OnboardingMessageHandler::DoInstallExtension(
+ const std::string& callback_id,
+ const std::string& extension_id) {
+ gfx::NativeWindow window =
+ web_ui()->GetWebContents()->GetTopLevelNativeWindow();
+
+ ProfileAttributesEntry* entry =
+ g_browser_process->profile_manager()
+ ->GetProfileAttributesStorage()
+ .GetProfileAttributesWithPath(profile_->GetPath());
+ // Pass a weak_ptr for the callback, as WebstoreInstallWithPrompt is
+ // ref-counted and might outlive OnboardingMessageHandler.
+ auto installer = base::MakeRefCounted<extensions::WebstoreInstallWithPrompt>(
+ extension_id, profile_, window,
+ base::BindOnce(&OnboardingMessageHandler::OnExtensionInstallFinished,
+ weak_ptr_factory_.GetWeakPtr(), callback_id));
+
+ if (!entry) {
+ return RejectJavascriptCallback(callback_id, "entry not found");
+ }
+
+ AllowJavascript();
+ ResolveJavascriptCallback(
+ base::Value(callback_id),
+ base::Value(entry->GetLocalProfileName()));
+ installer->BeginInstall();
+}
+
+void OnboardingMessageHandler::HandleSetProfileName(const base::Value::List& args) {
+ CHECK_EQ(1U, args.size());
+ std::u16string new_name = base::UTF8ToUTF16(args[0].GetString());
+ base::TrimWhitespace(new_name, base::TRIM_ALL, &new_name);
+void OnboardingMessageHandler::OnExtensionInstallFinished(
+ std::string callback_id,
+ bool success,
+ const std::string& error,
+ extensions::webstore_install::Result result) {
+ AllowJavascript();
+ if (success) {
+ ResolveJavascriptCallback(base::Value(callback_id), base::Value());
+ return;
+ }
+
+ if (!new_name.empty()) {
+ profiles::UpdateProfileName(profile_, new_name);
+ }
+ RejectJavascriptCallback(
+ base::Value(callback_id),
+ base::Value::Dict().Set("error", error).Set("code", result));
+}
+
+void OnboardingMessageHandler::HandleSetPreference(const base::Value::List& args) {
+ if (args.size() == 0) {
+ return;
+ }
+void OnboardingMessageHandler::HandleGetPreferences(
+ const base::Value::List& args) {
+ CHECK_EQ(1U, args.size());
+ const auto& callback_id = args[0].GetString();
+
+ AllowJavascript();
+ AllowJavascript();
+ ResolveJavascriptCallback(base::Value(callback_id),
+ base::Value(GetPreferencesDict()));
+}
+
+ const auto& callback_id = args[0].GetString();
+ if (args.size() != 3) {
+ return RejectJavascriptCallback(callback_id, "invalid arguments");
+ }
+void OnboardingMessageHandler::HandleGetProfileName(
+ const base::Value::List& args) {
+ CHECK_EQ(1U, args.size());
+ const auto& callback_id = args[0].GetString();
+
+ if (!args[1].is_string()) {
+ return RejectJavascriptCallback(callback_id, "pref is not a string");
+ }
+ ProfileAttributesEntry* entry =
+ g_browser_process->profile_manager()
+ ->GetProfileAttributesStorage()
+ .GetProfileAttributesWithPath(profile_->GetPath());
+
+ const auto& pref_name = prefs::kHeliumPrefPrefix + args[1].GetString();
+ auto* pref = pref_service_->FindPreference(pref_name);
+ if (!pref) {
+ return RejectJavascriptCallback(callback_id, pref_name + " does not exist");
+ }
+ if (!entry) {
+ return RejectJavascriptCallback(callback_id, "entry not found");
+ }
+
+ if (args[2].type() != pref->GetType()) {
+ return RejectJavascriptCallback(callback_id, "invalid value type");
+ }
+ AllowJavascript();
+ ResolveJavascriptCallback(base::Value(callback_id),
+ base::Value(entry->GetLocalProfileName()));
+}
+
+ pref_service_->Set(pref_name, args[2].Clone());
+void OnboardingMessageHandler::HandleSetProfileName(
+ const base::Value::List& args) {
+ CHECK_EQ(1U, args.size());
+ std::u16string new_name = base::UTF8ToUTF16(args[0].GetString());
+ base::TrimWhitespace(new_name, base::TRIM_ALL, &new_name);
+
+ ResolveJavascriptCallback(callback_id, {});
+ if (!new_name.empty()) {
+ profiles::UpdateProfileName(profile_, new_name);
+ }
+}
+
+void OnboardingMessageHandler::HandleSetPreference(
+ const base::Value::List& args) {
+ if (args.size() == 0) {
+ return;
+ }
+
+ AllowJavascript();
+
+ const auto& callback_id = args[0].GetString();
+ if (args.size() != 3) {
+ return RejectJavascriptCallback(callback_id, "invalid arguments");
+ }
+
+ if (!args[1].is_string()) {
+ return RejectJavascriptCallback(callback_id, "pref is not a string");
+ }
+
+ const auto& pref_name = prefs::kHeliumPrefPrefix + args[1].GetString();
+ auto* pref = pref_service_->FindPreference(pref_name);
+ if (!pref) {
+ return RejectJavascriptCallback(callback_id, pref_name + " does not exist");
+ }
+
+ if (args[2].type() != pref->GetType()) {
+ return RejectJavascriptCallback(callback_id, "invalid value type");
+ }
+
+ pref_service_->Set(pref_name, args[2].Clone());
+
+ ResolveJavascriptCallback(callback_id, {});
+}
+
+void OnboardingMessageHandler::HandleAcceptSchema(const base::Value::List&) {
+ helium::AcceptCurrentSchema(*pref_service_);
+}
--- /dev/null
+++ b/chrome/browser/ui/webui/onboarding/onboarding_handler.h
@@ -0,0 +1,51 @@
@@ -0,0 +1,76 @@
+// Copyright 2025 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.
@@ -435,17 +531,23 @@
+
+#include "base/memory/raw_ptr.h"
+#include "base/memory/weak_ptr.h"
+#include "base/scoped_observation.h"
+#include "base/values.h"
+#include "chrome/browser/profiles/profile.h"
+#include "components/prefs/pref_service.h"
+#include "chrome/common/extensions/webstore_install_result.h"
+#include "components/prefs/pref_change_registrar.h"
+#include "components/prefs/pref_service.h"
+#include "content/public/browser/web_ui_message_handler.h"
+#include "chrome/browser/themes/theme_service_observer.h"
+#include "extensions/browser/extension_registry_observer.h"
+
+namespace content {
+class BrowserContext;
+}
+
+class OnboardingMessageHandler : public content::WebUIMessageHandler,
+ public ThemeServiceObserver {
+ public extensions::ExtensionRegistryObserver {
+ public:
+ explicit OnboardingMessageHandler(Profile* profile);
+ explicit OnboardingMessageHandler(content::BrowserContext* browser_context);
+ OnboardingMessageHandler(const OnboardingMessageHandler&) = delete;
+ OnboardingMessageHandler& operator=(const OnboardingMessageHandler&) = delete;
+ ~OnboardingMessageHandler() override;
@@ -455,38 +557,53 @@
+ private:
+ base::Value::Dict GetPreferencesDict();
+ void HandleGetPreferences(const base::Value::List& args);
+ void HandleAcceptSchema(const base::Value::List& args);
+ void HandleSetPreference(const base::Value::List& args);
+ void HandleGetProfileName(const base::Value::List& args);
+ void HandleSetProfileName(const base::Value::List& args);
+ void HandleGetBackgroundColor(const base::Value::List& args);
+ void HandleGetExtensions(const base::Value::List& args);
+ void HandleInstallExtension(const base::Value::List& args);
+ void OnPreferencesChanged();
+
+ base::Value GetNTPBackgroundColor();
+ void DoInstallExtension(const std::string& callback_id,
+ const std::string& extension_id);
+ void DoEnableExtension(const std::string& callback_id,
+ const std::string& extension_id);
+ void OnExtensionInstallFinished(std::string callback_id,
+ bool success,
+ const std::string& error,
+ extensions::webstore_install::Result);
+
+ // ThemeServiceObserver:
+ void OnThemeChanged() override;
+ // extensions::ExtensionRegistryObserver:
+ void OnExtensionLoaded(content::BrowserContext*,
+ const extensions::Extension*) override;
+ void OnExtensionUnloaded(content::BrowserContext*,
+ const extensions::Extension*,
+ extensions::UnloadedExtensionReason) override;
+
+ raw_ptr<content::BrowserContext> browser_context_ = nullptr;
+ raw_ptr<Profile> profile_ = nullptr;
+ raw_ptr<PrefService> pref_service_ = nullptr;
+ PrefChangeRegistrar pref_change_registrar_;
+
+ base::WeakPtrFactory<OnboardingMessageHandler> weak_ptr_factory_{this};
+
+ // extensions:ExtensionRegistryObserver:
+ base::ScopedObservation<extensions::ExtensionRegistry,
+ extensions::ExtensionRegistryObserver>
+ extension_registry_observation_{this};
+};
+
+#endif // CHROME_BROWSER_UI_WEBUI_ONBOARDING_ONBOARDING_HANDLER_H_
+#endif // CHROME_BROWSER_UI_WEBUI_ONBOARDING_ONBOARDING_HANDLER_H_
--- a/components/helium_services/helium_services_helpers.cc
+++ b/components/helium_services/helium_services_helpers.cc
@@ -53,12 +53,18 @@ GURL GetDummyURL() {
@@ -53,12 +53,14 @@ GURL GetDummyURL() {
}
bool ShouldAccessServices(const PrefService& prefs) {
- return prefs.GetBoolean(prefs::kHeliumServicesEnabled);
+ // onboarding was completed without touching kHeliumServicesEnabled,
+ // OR the user has explicitly enabled kHeliumServicesEnabled somewhere
+ // (either via onboarding, or user settings)
+ return prefs.GetBoolean(prefs::kHeliumServicesEnabled) &&
+ (prefs.GetBoolean(prefs::kHeliumServicesConsented)
+ || prefs.HasPrefPath(prefs::kHeliumServicesEnabled));
+ prefs.GetBoolean(prefs::kHeliumServicesConsented);
}
void ConfigurePrefChangeRegistrarFor(std::string_view pref_name,
@@ -494,8 +611,8 @@
registrar.Add(prefs::kHeliumServicesEnabled, observer);
+ registrar.Add(prefs::kHeliumServicesConsented, observer);
registrar.Add(prefs::kHeliumServicesOrigin, observer);
registrar.Add(prefs::kHeliumSchemaVersion, observer);
registrar.Add(pref_name, observer);
}
--- a/chrome/browser/ui/incognito_allowed_url.cc
+++ b/chrome/browser/ui/incognito_allowed_url.cc
@@ -48,7 +48,8 @@ bool IsHostAllowedInIncognito(const GURL
@@ -524,18 +641,18 @@
--- a/chrome/browser/favicon/favicon_utils.cc
+++ b/chrome/browser/favicon/favicon_utils.cc
@@ -189,6 +189,7 @@ bool ShouldThemifyFavicon(GURL url) {
url.host_piece() != chrome::kChromeUIVersionHost &&
url.host_piece() != chrome::kChromeUINetExportHost &&
url.host_piece() != chrome::kChromeUINewTabHost &&
+ url.host_piece() != chrome::kHeliumSetupHost &&
url.host_piece() != password_manager::kChromeUIPasswordManagerHost;
url.host() != chrome::kChromeUIVersionHost &&
url.host() != chrome::kChromeUINetExportHost &&
url.host() != chrome::kChromeUINewTabHost &&
+ url.host() != chrome::kHeliumSetupHost &&
url.host() != chrome::kChromeUIContextualTasksHost &&
url.host() != password_manager::kChromeUIPasswordManagerHost;
}
--- a/chrome/app/settings_strings.grdp
+++ b/chrome/app/settings_strings.grdp
@@ -1917,6 +1917,12 @@
<message name="IDS_SETTINGS_HELIUM_SERVICES_DESCRIPTION" desc="Description of the controls available on the Helium services settings page">
Manage what Helium services are allowed in your browser
@@ -1995,6 +1995,12 @@
<message name="IDS_SETTINGS_HELIUM_SCHEMA_IGNORE" desc="Checkbox label to ignore any future services change alerts">
Don't notify me again
</message>
+ <message name="IDS_SETTINGS_HELIUM_SERVICES_SETUP_PENDING_TEXT" desc="Description shown in services settings when user has not completed onboarding">
+ Helium services are not available until setup is complete to ensure your privacy and consent.
@@ -548,7 +665,7 @@
</message>
--- a/chrome/browser/extensions/api/settings_private/prefs_util.cc
+++ b/chrome/browser/extensions/api/settings_private/prefs_util.cc
@@ -357,6 +357,8 @@ const PrefsUtil::TypedPrefMap& PrefsUtil
@@ -365,6 +365,8 @@ const PrefsUtil::TypedPrefMap& PrefsUtil
settings_api::PrefType::kBoolean;
(*s_allowlist)[::prefs::kHeliumServicesOrigin] =
settings_api::PrefType::kString;
@@ -557,18 +674,26 @@
// Privacy Guide
(*s_allowlist)[::prefs::kPrivacyGuideViewed] =
--- a/chrome/browser/resources/settings/privacy_page/services_page.ts
+++ b/chrome/browser/resources/settings/privacy_page/services_page.ts
@@ -94,6 +94,10 @@ export class SettingsHeliumServicesPageE
this.setPrefValue('helium.services.origin_override', target.value);
}
+
+ private onServicesPendingButtonClick_() {
+ window.open('chrome://setup', '_blank');
+ }
}
declare global {
--- a/chrome/browser/resources/settings/privacy_page/services_page.html
+++ b/chrome/browser/resources/settings/privacy_page/services_page.html
@@ -2,10 +2,42 @@
.label-wrapper {
padding: var(--cr-section-vertical-padding) 0;
@@ -25,10 +25,37 @@
margin-top: var(--cr-changelog-padding);
padding-top: calc(var(--cr-changelog-padding) / 2);
}
+
+ #onboarding-link {
+ color: var(--text-color-action);
+ text-decoration: none;
+ }
+
+ #onboarding-text {
+ display: flex;
+ align-items: center;
@@ -590,19 +715,19 @@
+ <cr-icon icon="cr:security" aria-hidden="true"></cr-icon>
+ <span>$i18n{heliumServicesSetupPendingText}</span>
+ </div>
+ <cr-button class="action-button">
+ <a href="chrome://setup" target="_blank" id="onboarding-link">
+ $i18n{heliumServicesSetupPendingButton}
+ </a>
+ <cr-button
+ class="action-button"
+ on-click="onServicesPendingButtonClick_">
+ $i18n{heliumServicesSetupPendingButton}
+ </cr-button>
+ </div>
+ </template>
+
+ <template is="dom-if" if="[[prefs.helium.services.user_consented.value]]">
<settings-toggle-button id="servicesToggleButton"
pref="{{prefs.helium.services.enabled}}"
label="$i18n{heliumServicesToggle}"
@@ -15,6 +47,7 @@
<template is="dom-if" if="[[changes_.length]]">
<div id="changelog-notice">
<div id="changelog-title">$i18n{heliumSchemaUpdatedTitle}</div>
@@ -57,6 +84,7 @@
<cr-collapse id="servicesCollapse" opened="[[prefs.helium.services.enabled.value]]">
</cr-collapse>
</div>
@@ -612,7 +737,7 @@
--- a/chrome/browser/ui/webui/settings/settings_localized_strings_provider.cc
+++ b/chrome/browser/ui/webui/settings/settings_localized_strings_provider.cc
@@ -1969,6 +1969,8 @@ void AddPrivacyStrings(content::WebUIDat
@@ -2190,6 +2190,8 @@ void AddPrivacyStrings(content::WebUIDat
{"securityPageDescription", IDS_SETTINGS_SECURITY_DESCRIPTION},
{"heliumServicesTitle", IDS_SETTINGS_HELIUM_SERVICES},
{"heliumServicesDescription", IDS_SETTINGS_HELIUM_SERVICES_DESCRIPTION},
@@ -1,45 +1,19 @@
--- a/chrome/app/settings_strings.grdp
+++ b/chrome/app/settings_strings.grdp
@@ -267,6 +267,9 @@
<message name="IDS_SETTINGS_COLOR_SCHEME_MODE" desc="Text of the label for selecting a color scheme mode for the browser.">
Mode
</message>
+ <message name="IDS_SETTINGS_NEW_TAB_NEXT_TO_ACTIVE_BUTTON" desc="Label for the checkbox which enables or disables behaviour of opening new tabs next to current active tab.">
+ Open new tabs next to the active tab
+ </message>
<message name="IDS_SETTINGS_SHOW_HOME_BUTTON" desc="Label for the checkbox which enables or disables showing the home button in the toolbar.">
Show home button
</message>
--- a/chrome/browser/extensions/api/settings_private/prefs_util.cc
+++ b/chrome/browser/extensions/api/settings_private/prefs_util.cc
@@ -222,6 +222,10 @@ const PrefsUtil::TypedPrefMap& PrefsUtil
(*s_allowlist)[::prefs::kUseCustomChromeFrame] =
settings_api::PrefType::kBoolean;
#endif
+
+ (*s_allowlist)[::prefs::kNewTabNextToActive] =
+ settings_api::PrefType::kBoolean;
+
(*s_allowlist)[::prefs::kShowHomeButton] = settings_api::PrefType::kBoolean;
(*s_allowlist)[::prefs::kShowForwardButton] =
settings_api::PrefType::kBoolean;
--- a/chrome/browser/resources/settings/appearance_page/appearance_page.html
+++ b/chrome/browser/resources/settings/appearance_page/appearance_page.html
@@ -173,6 +173,11 @@
label="$i18n{showBookmarksBar}">
</settings-toggle-button>
--- a/chrome/common/pref_names.h
+++ b/chrome/common/pref_names.h
@@ -1305,6 +1305,10 @@ inline constexpr char
"restricted_managed_guest_session_extension_cleanup_exempt_list";
#endif // BUILDFLAG(IS_CHROMEOS)
+ <settings-toggle-button class="hr" id="newTabNextToActive"
+ pref="{{prefs.helium.browser.new_tab_next_to_active}}"
+ label="$i18n{openNewTabNextToActive}">
+ </settings-toggle-button>
+// A boolean pref set to true if new tabs should be created to the next of current active one,
+// instead of tab strip end.
+inline constexpr char kNewTabNextToActive[] = "helium.browser.new_tab_next_to_active";
+
<settings-toggle-button class="hr" id="showSavedTabGroups"
pref="{{prefs.bookmark_bar.show_tab_groups}}"
label="$i18n{showTabGroupsInBookmarksBar}">
// 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";
--- a/chrome/browser/ui/browser_ui_prefs.cc
+++ b/chrome/browser/ui/browser_ui_prefs.cc
@@ -110,6 +110,8 @@ void RegisterBrowserUserPrefs(user_prefs
@@ -113,6 +113,8 @@ void RegisterBrowserUserPrefs(user_prefs
registry->RegisterIntegerPref(prefs::kSessionRestoreInfoBarTimesShown, 0);
#endif // BUILDFLAG(IS_LINUX) || BUILDFLAG(IS_MAC) || BUILDFLAG(IS_WIN)
@@ -50,10 +24,10 @@
registry->RegisterBooleanPref(prefs::kShowHomeButton, false,
--- a/chrome/browser/ui/tabs/tab_strip_model.cc
+++ b/chrome/browser/ui/tabs/tab_strip_model.cc
@@ -81,12 +81,14 @@
#include "chrome/browser/web_applications/policy/web_app_policy_manager.h"
@@ -84,12 +84,14 @@
#include "chrome/browser/web_applications/web_app_provider.h"
#include "chrome/browser/web_applications/web_app_tab_helper.h"
#include "chrome/common/chrome_features.h"
+#include "chrome/common/pref_names.h"
#include "chrome/common/webui_url_constants.h"
#include "components/commerce/core/commerce_utils.h"
@@ -65,7 +39,7 @@
#include "components/reading_list/core/reading_list_model.h"
#include "components/tab_groups/tab_group_id.h"
#include "components/tab_groups/tab_group_visual_data.h"
@@ -1548,7 +1550,11 @@ void TabStripModel::AddTab(std::unique_p
@@ -1736,7 +1738,11 @@ void TabStripModel::AddTab(std::unique_p
// For all other types, respect what was passed to us, normalizing -1s and
// values that are too large.
if (index < 0 || index > count()) {
@@ -78,26 +52,52 @@
}
}
--- a/chrome/app/settings_strings.grdp
+++ b/chrome/app/settings_strings.grdp
@@ -270,6 +270,9 @@
<message name="IDS_SETTINGS_COLOR_SCHEME_MODE" desc="Text of the label for selecting a color scheme mode for the browser.">
Mode
</message>
+ <message name="IDS_SETTINGS_NEW_TAB_NEXT_TO_ACTIVE_BUTTON" desc="Label for the checkbox which enables or disables behaviour of opening new tabs next to current active tab.">
+ Open new tabs next to the active tab
+ </message>
<message name="IDS_SETTINGS_SHOW_HOME_BUTTON" desc="Label for the checkbox which enables or disables showing the home button in the toolbar.">
Show home button
</message>
--- a/chrome/browser/ui/webui/settings/settings_localized_strings_provider.cc
+++ b/chrome/browser/ui/webui/settings/settings_localized_strings_provider.cc
@@ -513,6 +513,7 @@ void AddAppearanceStrings(content::WebUI
@@ -522,6 +522,7 @@ void AddAppearanceStrings(content::WebUI
{"lightMode", IDS_NTP_CUSTOMIZE_CHROME_COLOR_SCHEME_MODE_LIGHT_LABEL},
{"darkMode", IDS_NTP_CUSTOMIZE_CHROME_COLOR_SCHEME_MODE_DARK_LABEL},
{"systemMode", IDS_NTP_CUSTOMIZE_CHROME_COLOR_SCHEME_MODE_SYSTEM_LABEL},
+ {"openNewTabNextToActive", IDS_SETTINGS_NEW_TAB_NEXT_TO_ACTIVE_BUTTON},
{"showHomeButton", IDS_SETTINGS_SHOW_HOME_BUTTON},
{"showBookmarksBar", IDS_SETTINGS_SHOW_BOOKMARKS_BAR},
{"allowSplitViewDragAndDrop",
--- a/chrome/common/pref_names.h
+++ b/chrome/common/pref_names.h
@@ -1306,6 +1306,10 @@ inline constexpr char
"restricted_managed_guest_session_extension_cleanup_exempt_list";
#endif // BUILDFLAG(IS_CHROMEOS)
+// A boolean pref set to true if new tabs should be created to the next of current active one,
+// instead of tab strip end.
+inline constexpr char kNewTabNextToActive[] = "helium.browser.new_tab_next_to_active";
{"tabStripPosition", IDS_SETTINGS_TAB_STRIP_POSITION},
--- a/chrome/browser/extensions/api/settings_private/prefs_util.cc
+++ b/chrome/browser/extensions/api/settings_private/prefs_util.cc
@@ -226,6 +226,10 @@ const PrefsUtil::TypedPrefMap& PrefsUtil
(*s_allowlist)[::prefs::kUseCustomChromeFrame] =
settings_api::PrefType::kBoolean;
#endif
+
// 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";
+ (*s_allowlist)[::prefs::kNewTabNextToActive] =
+ settings_api::PrefType::kBoolean;
+
(*s_allowlist)[::prefs::kShowHomeButton] = settings_api::PrefType::kBoolean;
(*s_allowlist)[::prefs::kShowForwardButton] =
settings_api::PrefType::kBoolean;
--- a/chrome/browser/resources/settings/appearance_page/appearance_behavior_page.html
+++ b/chrome/browser/resources/settings/appearance_page/appearance_behavior_page.html
@@ -1,6 +1,11 @@
<style include="cr-shared-style settings-shared"></style>
<settings-section page-title="$i18n{behaviorPageTitle}">
+ <settings-toggle-button id="newTabNextToActive"
+ pref="{{prefs.helium.browser.new_tab_next_to_active}}"
+ label="$i18n{openNewTabNextToActive}">
+ </settings-toggle-button>
+
<settings-toggle-button class="hr" id="copyPageUrlShortcut"
pref="{{prefs.helium.settings.a11y.copy_page_url_shortcut}}"
label="$i18n{copyPageUrlShortcut}">
@@ -10,7 +10,7 @@
inline constexpr char kViewSourceScheme[] = "view-source";
--- a/chrome/browser/profiles/profile_io_data.cc
+++ b/chrome/browser/profiles/profile_io_data.cc
@@ -44,6 +44,7 @@ bool ProfileIOData::IsHandledProtocol(co
@@ -44,6 +44,7 @@ bool ProfileIOData::IsHandledProtocol(st
extensions::kExtensionScheme,
#endif
content::kChromeUIScheme,
@@ -20,15 +20,15 @@
#if BUILDFLAG(IS_CHROMEOS)
--- a/content/common/url_schemes.cc
+++ b/content/common/url_schemes.cc
@@ -33,6 +33,7 @@ const char* const kDefaultSavableSchemes
@@ -30,6 +30,7 @@ const char* const kDefaultSavableSchemes
url::kFileSystemScheme,
kChromeDevToolsScheme,
kChromeUIScheme,
+ kHeliumUIScheme,
url::kDataScheme,
url::kJavaScriptScheme,
url::kMailToScheme,
@@ -68,6 +69,7 @@ void RegisterContentSchemes(bool should_
url::kDataScheme
};
@@ -60,6 +61,7 @@ void RegisterContentSchemes(bool should_
url::AddStandardScheme(kChromeDevToolsScheme, url::SCHEME_WITH_HOST);
url::AddStandardScheme(kChromeUIScheme, url::SCHEME_WITH_HOST);
@@ -36,7 +36,7 @@
url::AddStandardScheme(kChromeUIUntrustedScheme, url::SCHEME_WITH_HOST);
url::AddStandardScheme(kChromeErrorScheme, url::SCHEME_WITH_HOST);
for (auto& scheme : schemes.standard_schemes)
@@ -78,6 +80,7 @@ void RegisterContentSchemes(bool should_
@@ -70,6 +72,7 @@ void RegisterContentSchemes(bool should_
schemes.secure_schemes.push_back(kChromeDevToolsScheme);
schemes.secure_schemes.push_back(kChromeUIScheme);
@@ -44,7 +44,7 @@
schemes.secure_schemes.push_back(kChromeUIUntrustedScheme);
schemes.secure_schemes.push_back(kChromeErrorScheme);
for (auto& scheme : schemes.secure_schemes)
@@ -98,6 +101,7 @@ void RegisterContentSchemes(bool should_
@@ -90,6 +93,7 @@ void RegisterContentSchemes(bool should_
url::AddNoAccessScheme(scheme.c_str());
schemes.cors_enabled_schemes.push_back(kChromeUIScheme);
@@ -52,7 +52,7 @@
schemes.cors_enabled_schemes.push_back(kChromeUIUntrustedScheme);
for (auto& scheme : schemes.cors_enabled_schemes)
url::AddCorsEnabledScheme(scheme.c_str());
@@ -126,6 +130,7 @@ void RegisterContentSchemes(bool should_
@@ -118,6 +122,7 @@ void RegisterContentSchemes(bool should_
// service workers don't work for chrome[-untrusted]:// when the flag is not
// enabled.
schemes.service_worker_schemes.push_back(kChromeUIScheme);
@@ -62,7 +62,7 @@
// Prevent future modification of the scheme lists. This is to prevent
--- a/content/renderer/render_thread_impl.cc
+++ b/content/renderer/render_thread_impl.cc
@@ -887,10 +887,18 @@ void RenderThreadImpl::RegisterSchemes()
@@ -823,10 +823,18 @@ void RenderThreadImpl::RegisterSchemes()
chrome_scheme);
WebSecurityPolicy::RegisterURLSchemeAsWebUI(chrome_scheme);
@@ -95,21 +95,21 @@
+++ b/chrome/browser/ui/incognito_allowed_url.cc
@@ -19,7 +19,8 @@ namespace {
bool IsHostAllowedInIncognito(const GURL& url) {
std::string scheme = url.scheme();
std::string_view host = url.host_piece();
std::string scheme = url.GetScheme();
std::string_view host = url.host();
- if (scheme != content::kChromeUIScheme) {
+ if (scheme != content::kChromeUIScheme
+ && scheme != content::kHeliumUIScheme) {
+ if (scheme != content::kChromeUIScheme &&
+ scheme != content::kHeliumUIScheme) {
return true;
}
--- a/chrome/browser/ui/browser_navigator.cc
+++ b/chrome/browser/ui/browser_navigator.cc
@@ -544,6 +544,12 @@ base::WeakPtr<content::NavigationHandle>
@@ -558,6 +558,12 @@ base::WeakPtr<content::NavigationHandle>
}
}
+ if (params->url.scheme_piece() == content::kHeliumUIScheme) {
+ if (params->url.scheme() == content::kHeliumUIScheme) {
+ GURL::Replacements replacements;
+ replacements.SetSchemeStr(content::kChromeUIScheme);
+ params->url = params->url.ReplaceComponents(replacements);
@@ -120,7 +120,7 @@
// handling.
--- a/chrome/browser/extensions/extension_tab_util.cc
+++ b/chrome/browser/extensions/extension_tab_util.cc
@@ -1297,7 +1297,8 @@ bool ExtensionTabUtil::IsKillURL(const G
@@ -1099,7 +1099,8 @@ bool ExtensionTabUtil::IsKillURL(const G
return true;
}
@@ -132,7 +132,7 @@
--- a/chrome/browser/ui/browser.cc
+++ b/chrome/browser/ui/browser.cc
@@ -2287,6 +2287,13 @@ void Browser::SetContentsBounds(WebConte
@@ -2257,6 +2257,13 @@ void Browser::SetContentsBounds(WebConte
}
void Browser::UpdateTargetURL(WebContents* source, const GURL& url) {
@@ -146,7 +146,7 @@
std::vector<StatusBubble*> status_bubbles = GetStatusBubbles();
for (StatusBubble* status_bubble : status_bubbles) {
StatusBubbleViews* status_bubble_views =
@@ -2294,7 +2301,7 @@ void Browser::UpdateTargetURL(WebContent
@@ -2264,7 +2271,7 @@ void Browser::UpdateTargetURL(WebContent
ContentsWebView* anchor =
static_cast<ContentsWebView*>(status_bubble_views->base_view());
if (source == anchor->GetWebContents()) {
@@ -185,10 +185,10 @@
#include "base/threading/thread_local_storage.h"
#include "build/build_config.h"
+#include "content/public/common/url_constants.h"
#include "components/url_formatter/spoof_checks/idn_spoof_checker.h"
#include "net/base/registry_controlled_domains/registry_controlled_domain.h"
#include "third_party/icu/source/common/unicode/uidna.h"
#include "third_party/icu/source/common/unicode/utypes.h"
@@ -564,6 +565,7 @@ const FormatUrlType kFormatUrlTrimAfterH
@@ -561,6 +562,7 @@ const FormatUrlType kFormatUrlTrimAfterH
const FormatUrlType kFormatUrlOmitFileScheme = 1 << 7;
const FormatUrlType kFormatUrlOmitMailToScheme = 1 << 8;
const FormatUrlType kFormatUrlOmitMobilePrefix = 1 << 9;
@@ -196,7 +196,7 @@
const FormatUrlType kFormatUrlOmitDefaults =
kFormatUrlOmitUsernamePassword | kFormatUrlOmitHTTP |
@@ -626,6 +628,18 @@ std::u16string FormatUrlWithAdjustments(
@@ -623,6 +625,18 @@ std::u16string FormatUrlWithAdjustments(
prefix_end, adjustments);
}
@@ -228,7 +228,7 @@
// bitmask of FormatUrlTypes, see it for details. |unescape_rules| defines how
--- a/chrome/browser/ui/web_applications/app_browser_controller.cc
+++ b/chrome/browser/ui/web_applications/app_browser_controller.cc
@@ -223,7 +223,8 @@ std::u16string AppBrowserController::For
@@ -242,7 +242,8 @@ std::u16string AppBrowserController::For
url_formatter::FormatUrlTypes format_types) {
auto origin = url::Origin::Create(url);
return url_formatter::FormatUrl(origin.opaque() ? url : origin.GetURL(),
@@ -303,14 +303,76 @@
bool devtools_url = (scheme == kDevToolsScheme);
if (chrome_url || devtools_url || url::IsStandard(scheme)) {
// Replace the about: scheme with the chrome: scheme.
@@ -754,7 +759,9 @@ bool IsEquivalentScheme(const std::strin
@@ -754,7 +759,11 @@ bool IsEquivalentScheme(const std::strin
const std::string& scheme2) {
return scheme1 == scheme2 ||
(scheme1 == url::kAboutScheme && scheme2 == kChromeUIScheme) ||
- (scheme1 == kChromeUIScheme && scheme2 == url::kAboutScheme);
+ (scheme1 == kChromeUIScheme && scheme2 == url::kAboutScheme) ||
+ (scheme1 == kHeliumUIScheme && scheme2 == url::kAboutScheme) ||
+ (scheme1 == url::kAboutScheme && scheme2 == kHeliumUIScheme);
+ (scheme1 == url::kAboutScheme && scheme2 == kHeliumUIScheme) ||
+ (scheme1 == kHeliumUIScheme && scheme2 == kChromeUIScheme) ||
+ (scheme1 == kChromeUIScheme && scheme2 == kHeliumUIScheme);
}
} // namespace url_formatter
--- a/chrome/browser/autocomplete/chrome_autocomplete_provider_client.cc
+++ b/chrome/browser/autocomplete/chrome_autocomplete_provider_client.cc
@@ -374,7 +374,7 @@ std::string ChromeAutocompleteProviderCl
std::string
ChromeAutocompleteProviderClient::GetEmbedderRepresentationOfAboutScheme()
const {
- return content::kChromeUIScheme;
+ return content::kHeliumUIScheme;
}
std::vector<std::u16string> ChromeAutocompleteProviderClient::GetBuiltinURLs() {
--- a/components/omnibox/browser/builtin_provider.cc
+++ b/components/omnibox/browser/builtin_provider.cc
@@ -73,7 +73,9 @@ void BuiltinProvider::DoBuiltinAutocompl
// Include some common builtin URLs as the user types the scheme.
for (const std::u16string& url :
client_->GetBuiltinsToProvideAsUserTypes()) {
- AddBuiltinMatch(url, std::u16string(), styles);
+ DCHECK(url.starts_with(u"chrome://"));
+ AddBuiltinMatch(std::u16string(url).replace(0, 6, u"helium"),
+ std::u16string(), styles);
}
} else {
// Match input about: or |embedderAbout| URL input against builtin URLs.
--- a/chrome/browser/ui/browser_commands.cc
+++ b/chrome/browser/ui/browser_commands.cc
@@ -172,6 +172,7 @@
#include "components/tabs/public/tab_interface.h"
#include "components/translate/core/browser/language_state.h"
#include "components/translate/core/browser/translate_manager.h"
+#include "components/url_formatter/url_formatter.h"
#include "components/user_education/common/feature_promo/feature_promo_controller.h"
#include "components/web_modal/web_contents_modal_dialog_manager.h"
#include "components/webapps/common/web_app_id.h"
@@ -2484,7 +2485,12 @@ bool IsDebuggerAttachedToCurrentTab(Brow
void CopyURL(BrowserWindowInterface* bwi, content::WebContents* web_contents) {
ui::ScopedClipboardWriter scw(ui::ClipboardBuffer::kCopyPaste);
- scw.WriteText(base::UTF8ToUTF16(web_contents->GetVisibleURL().spec()));
+ const std::u16string formatted_url =
+ url_formatter::FormatUrl(web_contents->GetVisibleURL(),
+ url_formatter::kFormatReplaceChromeProtocol,
+ base::UnescapeRule::NORMAL, nullptr,
+ nullptr, nullptr);
+ scw.WriteText(formatted_url);
#if !BUILDFLAG(IS_ANDROID)
if (toast_features::IsEnabled(toast_features::kLinkCopiedToast)) {
--- a/chrome/browser/ui/views/tabs/tab_hover_card_bubble_view.cc
+++ b/chrome/browser/ui/views/tabs/tab_hover_card_bubble_view.cc
@@ -565,7 +565,8 @@ void TabHoverCardBubbleView::UpdateCardC
url_formatter::kFormatUrlOmitDefaults |
url_formatter::kFormatUrlOmitHTTPS |
url_formatter::kFormatUrlOmitTrivialSubdomains |
- url_formatter::kFormatUrlTrimAfterHost,
+ url_formatter::kFormatUrlTrimAfterHost |
+ url_formatter::kFormatReplaceChromeProtocol,
base::UnescapeRule::NORMAL, nullptr, nullptr, nullptr);
}
@@ -1,6 +1,6 @@
--- a/chrome/common/chrome_features.cc
+++ b/chrome/common/chrome_features.cc
@@ -969,7 +969,7 @@ BASE_FEATURE(kHttpsFirstBalancedMode, ba
@@ -1229,7 +1229,7 @@ BASE_FEATURE(kHttpsFirstBalancedMode, ba
// Automatically enables HTTPS-First Mode in a balanced configuration when
// possible.
BASE_FEATURE(kHttpsFirstBalancedModeAutoEnable,
@@ -16,7 +16,7 @@
const char kChromeWebstoreApiURL[] = "trk:07:https://chromewebstore.googleapis.com/";
const char kAppMenuUtmSource[] = "ext_app_menu";
@@ -72,6 +72,7 @@ GURL GetNewWebstoreLaunchURL() {
@@ -77,6 +77,7 @@ GURL GetNewWebstoreLaunchURL() {
}
GURL AppendUtmSource(const GURL& url, std::string_view utm_source_value) {
@@ -24,7 +24,7 @@
return net::AppendQueryParameter(url, "utm_source", utm_source_value);
}
@@ -85,6 +86,8 @@ std::string GetWebstoreItemDetailURLPref
@@ -90,6 +91,8 @@ std::string GetWebstoreItemDetailURLPref
}
GURL GetWebstoreItemSnippetURL(const extensions::ExtensionId& extension_id) {
@@ -33,7 +33,7 @@
if (g_item_snippet_url_for_test_) {
// Return `<base URL><extension_id>`. There is no suffix if the URL is
// overridden by a test.
@@ -114,9 +117,6 @@ GURL GetDefaultWebstoreUpdateUrl() {
@@ -119,9 +122,6 @@ GURL GetDefaultWebstoreUpdateUrl() {
}
GURL GetWebstoreUpdateUrl() {
@@ -95,12 +95,12 @@
+
+bool CanPatchUpdateUrl(const GURL& url) {
+ GURL chrome_webstore = GetOriginalWebstoreUpdateUrl();
+ return chrome_webstore.host_piece() == url.host_piece();
+ return chrome_webstore.host() == url.host();
+}
+
+GURL PatchUpdateUrl(const GURL& url) {
+ GURL chrome_webstore = GetOriginalWebstoreUpdateUrl();
+ if (chrome_webstore.host_piece() == url.host_piece()) {
+ if (chrome_webstore.host() == url.host()) {
+ return GetDefaultWebstoreUpdateUrl();
+ }
+
@@ -133,7 +133,7 @@
+#endif // EXTENSIONS_COMMON_MANIFEST_URL_PATCHER_H_
--- a/extensions/common/BUILD.gn
+++ b/extensions/common/BUILD.gn
@@ -457,6 +457,8 @@ static_library("common") {
@@ -464,6 +464,8 @@ static_library("common") {
"manifest_handlers/webview_info.h",
"manifest_url_handlers.cc",
"manifest_url_handlers.h",
@@ -166,7 +166,7 @@
--- a/chrome/browser/extensions/api/settings_private/prefs_util.cc
+++ b/chrome/browser/extensions/api/settings_private/prefs_util.cc
@@ -355,6 +355,8 @@ const PrefsUtil::TypedPrefMap& PrefsUtil
@@ -363,6 +363,8 @@ const PrefsUtil::TypedPrefMap& PrefsUtil
// Helium services page
(*s_allowlist)[::prefs::kHeliumServicesEnabled] =
settings_api::PrefType::kBoolean;
@@ -177,9 +177,9 @@
(*s_allowlist)[::prefs::kHeliumServicesConsented] =
--- a/chrome/browser/ui/browser_ui_prefs.cc
+++ b/chrome/browser/ui/browser_ui_prefs.cc
@@ -208,6 +208,7 @@ void RegisterBrowserUserPrefs(user_prefs
{
@@ -215,6 +215,7 @@ void RegisterBrowserUserPrefs(user_prefs
registry->RegisterIntegerPref(prefs::kHeliumSchemaVersion, 0);
registry->RegisterBooleanPref(prefs::kHeliumDisableSchemaAlerts, false);
registry->RegisterBooleanPref(prefs::kHeliumServicesEnabled, true);
+ registry->RegisterBooleanPref(prefs::kHeliumExtProxyEnabled, true);
registry->RegisterStringPref(prefs::kHeliumServicesOrigin, "");
@@ -187,7 +187,7 @@
registry->RegisterBooleanPref(prefs::kHeliumServicesConsented, false);
--- a/chrome/browser/resources/settings/privacy_page/services_page.html
+++ b/chrome/browser/resources/settings/privacy_page/services_page.html
@@ -45,6 +45,11 @@
@@ -82,6 +82,11 @@
</settings-toggle-button>
<div class="cr-col">
<cr-collapse id="servicesCollapse" opened="[[prefs.helium.services.enabled.value]]">
@@ -201,10 +201,10 @@
</template>
--- a/chrome/browser/ui/webui/settings/settings_localized_strings_provider.cc
+++ b/chrome/browser/ui/webui/settings/settings_localized_strings_provider.cc
@@ -1973,6 +1973,10 @@ void AddPrivacyStrings(content::WebUIDat
{"heliumServicesToggle", IDS_SETTINGS_HELIUM_SERVICES_TOGGLE},
{"heliumServicesToggleDescription",
IDS_SETTINGS_HELIUM_SERVICES_TOGGLE_DESCRIPTION},
@@ -2201,6 +2201,10 @@ void AddPrivacyStrings(content::WebUIDat
IDS_SETTINGS_HELIUM_SCHEMA_NOTICE_DESCRIPTION},
{"heliumGotIt", IDS_SETTINGS_GOT_IT},
{"heliumSchemaIgnore", IDS_SETTINGS_HELIUM_SCHEMA_IGNORE},
+ {"heliumExtProxyToggle",
+ IDS_SETTINGS_HELIUM_SERVICES_EXT_PROXY_TOGGLE},
+ {"heliumExtProxyToggleDescription",
@@ -214,7 +214,7 @@
IDS_SETTINGS_HELIUM_SERVICES_OVERRIDE_DESCRIPTION},
--- a/chrome/app/settings_strings.grdp
+++ b/chrome/app/settings_strings.grdp
@@ -1939,6 +1939,12 @@
@@ -2023,6 +2023,12 @@
<message name="IDS_SETTINGS_HELIUM_SERVICES_TOGGLE_DESCRIPTION" desc="Description of the toggle for enabling/disabling of all Helium services">
When enabled, Helium will be able to connect to anonymous web services to provide additional functionality. When disabled, additional features will not work.
</message>
@@ -229,7 +229,7 @@
</message>
--- a/components/helium_services/pref_names.h
+++ b/components/helium_services/pref_names.h
@@ -21,6 +21,9 @@ inline constexpr char kHeliumServicesCon
@@ -27,6 +27,9 @@ inline constexpr char kHeliumServicesCon
inline constexpr char kHeliumDidOnboarding[] =
"helium.completed_onboarding";
@@ -241,8 +241,16 @@
#endif // COMPONENTS_HELIUM_SERVICES_PREF_NAMES_H_
--- a/components/helium_services/helium_services_helpers.cc
+++ b/components/helium_services/helium_services_helpers.cc
@@ -61,6 +61,28 @@ bool ShouldAccessServices(const PrefServ
|| prefs.HasPrefPath(prefs::kHeliumServicesEnabled));
@@ -7,6 +7,7 @@
#include <optional>
#include "base/functional/bind.h"
+#include "base/strings/stringprintf.h"
#include "components/helium_services/pref_names.h"
#include "components/prefs/pref_service.h"
#include "net/base/url_util.h"
@@ -57,6 +58,28 @@ bool ShouldAccessServices(const PrefServ
prefs.GetBoolean(prefs::kHeliumServicesConsented);
}
+bool ShouldAccessExtensionService(const PrefService& prefs) {
@@ -272,9 +280,9 @@
registrar.Add(prefs::kHeliumServicesEnabled, observer);
--- a/components/helium_services/helium_services_helpers.h
+++ b/components/helium_services/helium_services_helpers.h
@@ -18,8 +18,11 @@ const char kHeliumDefaultOrigin[] =
const char kHeliumDummyOrigin[] =
"https://helium-services-are-disabled.qjz9zk";
@@ -20,8 +20,11 @@ const char kHeliumDummyOrigin[] =
bool ShouldAccessServices(const PrefService& prefs);
+COMPONENT_EXPORT(HELIUM) bool ShouldAccessExtensionService(const PrefService& prefs);
COMPONENT_EXPORT(HELIUM) GURL GetServicesBaseURL(const PrefService& prefs);
@@ -286,8 +294,8 @@
PrefChangeRegistrar& registrar, const base::RepeatingClosure& observer);
--- a/chrome/browser/extensions/BUILD.gn
+++ b/chrome/browser/extensions/BUILD.gn
@@ -559,6 +559,7 @@ source_set("extensions") {
"//components/enterprise",
@@ -561,6 +561,7 @@ source_set("extensions") {
"//components/favicon/content",
"//components/guest_view/buildflags",
"//components/guest_view/common",
+ "//components/helium_services",
@@ -296,7 +304,7 @@
"//components/no_state_prefetch/browser",
--- a/extensions/browser/pending_extension_manager.cc
+++ b/extensions/browser/pending_extension_manager.cc
@@ -14,11 +14,14 @@
@@ -13,11 +13,14 @@
#include "base/version.h"
#include "build/build_config.h"
#include "content/public/browser/browser_thread.h"
@@ -311,7 +319,7 @@
#include "url/gurl.h"
namespace {
@@ -214,11 +217,11 @@ bool PendingExtensionManager::AddFromExt
@@ -213,11 +216,11 @@ bool PendingExtensionManager::AddFromExt
creation_flags, mark_acknowledged, kRemoteInstall);
}
@@ -326,11 +334,11 @@
ManifestLocation install_source = it.second.install_source();
// Some install sources read a CRX from the filesystem. They can
@@ -230,6 +233,17 @@ std::list<std::string> PendingExtensionM
@@ -229,6 +232,17 @@ std::list<std::string> PendingExtensionM
continue;
}
+ if (it.second.update_url().host_piece() == baseUrl.host_piece()) {
+ if (it.second.update_url().host() == baseUrl.host()) {
+ Profile* profile = Profile::FromBrowserContext(context_.get());
+ PrefService* prefs = profile->GetPrefs();
+
@@ -346,7 +354,7 @@
--- a/chrome/browser/extensions/updater/extension_updater.cc
+++ b/chrome/browser/extensions/updater/extension_updater.cc
@@ -35,7 +35,10 @@
@@ -34,7 +34,10 @@
#include "chrome/browser/profiles/keep_alive/profile_keep_alive_types.h"
#include "chrome/browser/profiles/keep_alive/scoped_profile_keep_alive.h"
#include "chrome/browser/profiles/profile.h"
@@ -357,7 +365,7 @@
#include "components/update_client/update_query_params.h"
#include "content/public/browser/browser_context.h"
#include "content/public/browser/browser_task_traits.h"
@@ -213,9 +216,6 @@ void ExtensionUpdater::EnsureDownloaderC
@@ -212,9 +215,6 @@ void ExtensionUpdater::EnsureDownloaderC
if (!downloader_.get()) {
downloader_ = downloader_factory_.Run(this);
}
@@ -367,7 +375,7 @@
}
void ExtensionUpdater::Start() {
@@ -234,6 +234,15 @@ void ExtensionUpdater::Start() {
@@ -233,6 +233,15 @@ void ExtensionUpdater::Start() {
CheckSoon();
ScheduleNextCheck();
}
@@ -383,7 +391,7 @@
}
void ExtensionUpdater::Stop() {
@@ -360,7 +369,6 @@ void ExtensionUpdater::AddToDownloader(
@@ -359,7 +368,6 @@ void ExtensionUpdater::AddToDownloader(
int request_id,
DownloadFetchPriority fetch_priority,
ExtensionUpdateCheckParams* update_check_params) {
@@ -391,7 +399,7 @@
// In Kiosk mode extensions are downloaded and updated by the ExternalCache.
// Therefore we skip updates here to avoid conflicts.
@@ -461,7 +469,7 @@ void ExtensionUpdater::CheckNow(CheckPar
@@ -467,7 +475,7 @@ void ExtensionUpdater::CheckNow(CheckPar
// Add fetch records for extensions that should be fetched by an update URL.
// These extensions are not yet installed. They come from group policy
// and external install sources.
@@ -400,7 +408,7 @@
PendingExtensionManager::Get(profile_);
ExtensionUpdateCheckParams update_check_params;
@@ -595,7 +603,7 @@ void ExtensionUpdater::CheckNow(CheckPar
@@ -601,7 +609,7 @@ void ExtensionUpdater::CheckNow(CheckPar
// OnExtensionDownloadFinished for each extension that was checked.
downloader_->StartAllPending(extension_cache_);
@@ -409,7 +417,7 @@
update_check_params.priority =
params.fetch_priority == DownloadFetchPriority::kBackground
? ExtensionUpdateCheckParams::UpdateCheckPriority::BACKGROUND
@@ -816,6 +824,10 @@ void ExtensionUpdater::CleanUpCrxFileIfN
@@ -822,6 +830,10 @@ void ExtensionUpdater::CleanUpCrxFileIfN
bool ExtensionUpdater::CanUseUpdateService(
const ExtensionId& extension_id) const {
@@ -422,7 +430,7 @@
}
--- a/chrome/browser/extensions/webstore_installer.cc
+++ b/chrome/browser/extensions/webstore_installer.cc
@@ -45,6 +45,7 @@
@@ -43,6 +43,7 @@
#include "components/crx_file/id_util.h"
#include "components/download/public/common/download_url_parameters.h"
#include "components/update_client/update_query_params.h"
@@ -430,7 +438,7 @@
#include "content/public/browser/browser_thread.h"
#include "content/public/browser/download_manager.h"
#include "content/public/browser/navigation_controller.h"
@@ -206,7 +207,7 @@ GURL WebstoreInstaller::GetWebstoreInsta
@@ -207,7 +208,7 @@ GURL WebstoreInstaller::GetWebstoreInsta
if (!install_source.empty())
params.push_back(installsource_param);
params.push_back("uc");
@@ -461,11 +469,10 @@
#include "components/pref_registry/pref_registry_syncable.h"
#include "components/prefs/pref_service.h"
#include "content/public/common/content_switches.h"
@@ -128,6 +130,12 @@ ExtensionManagement::ExtensionManagement
pref_change_registrar_.Add(
pref_names::kExtensionForceInstallWithNonMalwareViolationsEnabled,
pref_change_callback);
+
@@ -126,6 +128,11 @@ ExtensionManagement::ExtensionManagement
pref_change_registrar_.Add(pref_names::kExtensionUnpublishedAvailability,
pref_change_callback);
+ helium::ConfigurePrefChangeRegistrarFor(
+ prefs::kHeliumExtProxyEnabled,
+ pref_change_registrar_,
@@ -474,7 +481,7 @@
// Note that both |global_settings_| and |default_settings_| will be null
// before first call to Refresh(), so in order to resolve this, Refresh() must
// be called in the initialization of ExtensionManagement.
@@ -282,12 +290,20 @@ GURL ExtensionManagement::GetEffectiveUp
@@ -291,12 +298,20 @@ GURL ExtensionManagement::GetEffectiveUp
<< "Update URL cannot be overridden to be the webstore URL!";
return update_url;
}
@@ -483,7 +490,7 @@
+ const GURL& original_url = ManifestURL::GetUpdateURL(&extension);
+ const GURL& dummy_url = extension_urls::GetDefaultWebstoreUpdateUrl();
+
+ if (dummy_url.host_piece() == original_url.host_piece()) {
+ if (dummy_url.host() == original_url.host()) {
+ return helium::GetExtensionUpdateURL(*profile_->GetPrefs());
+ }
+
@@ -563,7 +570,7 @@
// A POST request is sent with an override to GET due to server requirements.
--- a/chrome/browser/extensions/webstore_data_fetcher.h
+++ b/chrome/browser/extensions/webstore_data_fetcher.h
@@ -50,7 +50,8 @@ class WebstoreDataFetcher {
@@ -51,7 +51,8 @@ class WebstoreDataFetcher {
FetchItemSnippetResponse* mock_response);
// Starts the request to fetch web store data using the item snippets API.
@@ -575,7 +582,7 @@
max_auto_retries_ = max_retries;
--- a/chrome/browser/extensions/webstore_standalone_installer.cc
+++ b/chrome/browser/extensions/webstore_standalone_installer.cc
@@ -20,6 +20,7 @@
@@ -19,6 +19,7 @@
#include "chrome/browser/extensions/webstore_data_fetcher.h"
#include "chrome/browser/profiles/profile.h"
#include "components/crx_file/id_util.h"
@@ -1,6 +1,6 @@
--- a/chrome/browser/spellchecker/spellcheck_hunspell_dictionary.cc
+++ b/chrome/browser/spellchecker/spellcheck_hunspell_dictionary.cc
@@ -22,8 +22,10 @@
@@ -24,8 +24,10 @@
#include "base/task/thread_pool.h"
#include "base/threading/scoped_blocking_call.h"
#include "build/build_config.h"
@@ -11,7 +11,7 @@
#include "components/spellcheck/browser/spellcheck_platform.h"
#include "components/spellcheck/common/spellcheck_common.h"
#include "components/spellcheck/common/spellcheck_features.h"
@@ -276,15 +278,26 @@ GURL SpellcheckHunspellDictionary::GetDi
@@ -277,15 +279,26 @@ GURL SpellcheckHunspellDictionary::GetDi
std::string bdict_file = dictionary_file_.path.BaseName().MaybeAsASCII();
DCHECK(!bdict_file.empty());
@@ -45,7 +45,7 @@
--- a/components/helium_services/helium_services_helpers.cc
+++ b/components/helium_services/helium_services_helpers.cc
@@ -66,6 +66,11 @@ bool ShouldAccessExtensionService(const
@@ -63,6 +63,11 @@ bool ShouldAccessExtensionService(const
prefs.GetBoolean(prefs::kHeliumExtProxyEnabled);
}
@@ -57,7 +57,7 @@
bool ShouldFetchBangs(const PrefService& prefs) {
return ShouldAccessServices(prefs) &&
prefs.GetBoolean(prefs::kHeliumBangsEnabled);
@@ -88,6 +93,14 @@ GURL GetWebstoreSnippetURL(const PrefSer
@@ -85,6 +90,14 @@ GURL GetWebstoreSnippetURL(const PrefSer
base::StringPrintf("/ext/cws_snippet?id=%s", id));
}
@@ -74,7 +74,7 @@
registrar.Add(prefs::kHeliumServicesEnabled, observer);
--- a/components/helium_services/helium_services_helpers.h
+++ b/components/helium_services/helium_services_helpers.h
@@ -24,6 +24,7 @@ COMPONENT_EXPORT(HELIUM) GURL GetService
@@ -26,6 +26,7 @@ COMPONENT_EXPORT(HELIUM) GURL GetService
COMPONENT_EXPORT(HELIUM) GURL GetDummyURL();
COMPONENT_EXPORT(HELIUM) GURL GetExtensionUpdateURL(const PrefService& prefs);
COMPONENT_EXPORT(HELIUM) GURL GetWebstoreSnippetURL(const PrefService& prefs, std::string_view id);
@@ -84,7 +84,7 @@
PrefChangeRegistrar& registrar, const base::RepeatingClosure& observer);
--- a/components/helium_services/pref_names.h
+++ b/components/helium_services/pref_names.h
@@ -27,6 +27,9 @@ inline constexpr char kHeliumExtProxyEna
@@ -33,6 +33,9 @@ inline constexpr char kHeliumExtProxyEna
inline constexpr char kHeliumBangsEnabled[] =
"helium.services.bangs";
@@ -96,7 +96,7 @@
#endif // COMPONENTS_HELIUM_SERVICES_PREF_NAMES_H_
--- a/chrome/browser/BUILD.gn
+++ b/chrome/browser/BUILD.gn
@@ -8264,6 +8264,8 @@ static_library("browser") {
@@ -8255,6 +8255,8 @@ static_library("browser") {
deps += [
"//components/spellcheck/browser",
"//components/spellcheck/common",
@@ -107,7 +107,7 @@
if (!is_android) {
--- a/chrome/browser/extensions/api/settings_private/prefs_util.cc
+++ b/chrome/browser/extensions/api/settings_private/prefs_util.cc
@@ -359,6 +359,8 @@ const PrefsUtil::TypedPrefMap& PrefsUtil
@@ -367,6 +367,8 @@ const PrefsUtil::TypedPrefMap& PrefsUtil
settings_api::PrefType::kBoolean;
(*s_allowlist)[::prefs::kHeliumBangsEnabled] =
settings_api::PrefType::kBoolean;
@@ -118,7 +118,7 @@
(*s_allowlist)[::prefs::kHeliumServicesConsented] =
--- a/chrome/browser/ui/browser_ui_prefs.cc
+++ b/chrome/browser/ui/browser_ui_prefs.cc
@@ -210,6 +210,7 @@ void RegisterBrowserUserPrefs(user_prefs
@@ -217,6 +217,7 @@ void RegisterBrowserUserPrefs(user_prefs
registry->RegisterBooleanPref(prefs::kHeliumServicesEnabled, true);
registry->RegisterBooleanPref(prefs::kHeliumBangsEnabled, true);
registry->RegisterBooleanPref(prefs::kHeliumExtProxyEnabled, true);
@@ -128,7 +128,7 @@
registry->RegisterBooleanPref(prefs::kHeliumServicesConsented, false);
--- a/chrome/browser/resources/settings/privacy_page/services_page.html
+++ b/chrome/browser/resources/settings/privacy_page/services_page.html
@@ -55,6 +55,13 @@
@@ -92,6 +92,13 @@
label="$i18n{heliumBangsToggle}"
sub-label="$i18n{heliumBangsToggleDescription}">
</settings-toggle-button>
@@ -144,7 +144,17 @@
</template>
--- a/chrome/app/settings_strings.grdp
+++ b/chrome/app/settings_strings.grdp
@@ -1951,6 +1951,12 @@
@@ -1330,6 +1330,9 @@
<message name="IDS_SETTINGS_LANGUAGES_DICTIONARY_DOWNLOAD_FAILED_HELP" desc="Error message when spell dictionary download fails more than once possibly due to a network policy or configuration.">
Please check with your network administrator to make sure that the firewall is not blocking downloads from Google servers.
</message>
+ <message name="IDS_SETTINGS_LANGUAGES_DICTIONARY_DOWNLOAD_FAILED_HELP_HELIUM" desc="Error message when spell dictionary download fails more than once possibly due to a network policy or configuration.">
+ Please check that Helium services are enabled (including spell check downloads) and make sure that the firewall is not blocking downloads from Helium servers.
+ </message>
</if>
</if>
<if expr="is_chromeos">
@@ -2035,6 +2038,12 @@
<message name="IDS_SETTINGS_HELIUM_SERVICES_BANGS_TOGGLE_DESCRIPTION" desc="Description of the toggle for enabling/disabling of downloading bangs">
Helium will fetch a list of bangs that help you browse the Internet faster, such as !w or !gh. When disabled, bangs will not work.
</message>
@@ -159,16 +169,25 @@
</message>
--- a/chrome/browser/ui/webui/settings/settings_localized_strings_provider.cc
+++ b/chrome/browser/ui/webui/settings/settings_localized_strings_provider.cc
@@ -1976,6 +1976,9 @@ void AddPrivacyStrings(content::WebUIDat
@@ -1267,7 +1267,7 @@ void AddLanguagesStrings(content::WebUID
{"languagesDictionaryDownloadError",
IDS_SETTINGS_LANGUAGES_DICTIONARY_DOWNLOAD_FAILED},
{"languagesDictionaryDownloadErrorHelp",
- IDS_SETTINGS_LANGUAGES_DICTIONARY_DOWNLOAD_FAILED_HELP},
+ IDS_SETTINGS_LANGUAGES_DICTIONARY_DOWNLOAD_FAILED_HELP_HELIUM},
#endif
#endif // !BUILDFLAG(IS_CHROMEOS)
#if BUILDFLAG(IS_CHROMEOS)
@@ -2208,6 +2208,9 @@ void AddPrivacyStrings(content::WebUIDat
{"heliumBangsToggle", IDS_SETTINGS_HELIUM_SERVICES_BANGS_TOGGLE},
{"heliumBangsToggleDescription",
IDS_SETTINGS_HELIUM_SERVICES_BANGS_TOGGLE_DESCRIPTION},
+ {"heliumSpellcheckToggle", IDS_SETTINGS_HELIUM_SERVICES_SPELLCHECK_TOGGLE},
+ {"heliumSpellcheckToggleDescription",
+ IDS_SETTINGS_HELIUM_SERVICES_SPELLCHECK_TOGGLE_DESCRIPTION},
{"heliumExtProxyToggle",
IDS_SETTINGS_HELIUM_SERVICES_EXT_PROXY_TOGGLE},
{"heliumExtProxyToggleDescription",
{"heliumOriginOverride", IDS_SETTINGS_HELIUM_SERVICES_OVERRIDE},
{"heliumOriginOverrideDescription",
IDS_SETTINGS_HELIUM_SERVICES_OVERRIDE_DESCRIPTION},
--- a/chrome/common/features.gni
+++ b/chrome/common/features.gni
@@ -10,6 +10,7 @@ import("//components/compose/features.gn
@@ -179,7 +198,7 @@
import("//components/supervised_user/buildflags.gni")
import("//content/public/common/features.gni")
import("//crypto/features.gni")
@@ -102,4 +103,5 @@ chrome_grit_defines = [
@@ -114,4 +115,5 @@ chrome_grit_defines = [
"optimize_webui=$optimize_webui",
"chrome_root_store_cert_management_ui=$chrome_root_store_cert_management_ui",
"use_nss_certs=$use_nss_certs",
@@ -19,15 +19,6 @@
DCHECK_CALLED_ON_VALID_SEQUENCE(sequence_checker_);
if (url_source_override_.is_valid()) {
return {GURL(url_source_override_)};
@@ -123,7 +125,7 @@ bool ConfiguratorImpl::EnabledDeltas() c
bool ConfiguratorImpl::EnabledComponentUpdates() const {
DCHECK_CALLED_ON_VALID_SEQUENCE(sequence_checker_);
- return true;
+ return false;
}
bool ConfiguratorImpl::EnabledBackgroundDownloader() const {
@@ -133,7 +135,7 @@ bool ConfiguratorImpl::EnabledBackground
bool ConfiguratorImpl::EnabledCupSigning() const {
@@ -39,7 +30,7 @@
// The default implementation for most embedders returns an empty string.
--- a/extensions/browser/updater/extension_downloader.cc
+++ b/extensions/browser/updater/extension_downloader.cc
@@ -346,6 +346,10 @@ void ExtensionDownloader::DoStartAllPend
@@ -347,6 +347,10 @@ void ExtensionDownloader::DoStartAllPend
AddToFetches(fetches_preparing, std::move(task));
pending_tasks_.clear();
@@ -1,6 +1,6 @@
--- a/chrome/browser/ui/webui/side_panel/customize_chrome/customize_toolbar/customize_toolbar_handler.cc
+++ b/chrome/browser/ui/webui/side_panel/customize_chrome/customize_toolbar/customize_toolbar_handler.cc
@@ -37,15 +37,6 @@ MojoActionForChromeAction(actions::Actio
@@ -42,28 +42,12 @@ MojoActionForChromeAction(actions::Actio
return side_panel::customize_chrome::mojom::ActionId::kShowBookmarks;
case kActionSidePanelShowHistoryCluster:
return side_panel::customize_chrome::mojom::ActionId::kShowHistoryCluster;
@@ -16,8 +16,7 @@
case kActionHome:
return side_panel::customize_chrome::mojom::ActionId::kHome;
case kActionForward:
@@ -56,13 +47,6 @@ MojoActionForChromeAction(actions::Actio
return side_panel::customize_chrome::mojom::ActionId::kExtensions;
return side_panel::customize_chrome::mojom::ActionId::kForward;
case kActionNewIncognitoWindow:
return side_panel::customize_chrome::mojom::ActionId::kNewIncognitoWindow;
- case kActionShowPasswordsBubbleOrPage:
@@ -30,7 +29,7 @@
case kActionShowDownloads:
return side_panel::customize_chrome::mojom::ActionId::kShowDownloads;
case kActionClearBrowsingData:
@@ -101,14 +85,6 @@ std::optional<actions::ActionId> ChromeA
@@ -104,26 +88,12 @@ std::optional<actions::ActionId> ChromeA
return kActionSidePanelShowBookmarks;
case side_panel::customize_chrome::mojom::ActionId::kShowHistoryCluster:
return kActionSidePanelShowHistoryCluster;
@@ -45,8 +44,7 @@
case side_panel::customize_chrome::mojom::ActionId::kHome:
return kActionHome;
case side_panel::customize_chrome::mojom::ActionId::kForward:
@@ -119,12 +95,6 @@ std::optional<actions::ActionId> ChromeA
return kActionExtensions;
return kActionForward;
case side_panel::customize_chrome::mojom::ActionId::kNewIncognitoWindow:
return kActionNewIncognitoWindow;
- case side_panel::customize_chrome::mojom::ActionId::kShowPasswordManager:
@@ -58,7 +56,7 @@
case side_panel::customize_chrome::mojom::ActionId::kShowDownloads:
return kActionShowDownloads;
case side_panel::customize_chrome::mojom::ActionId::kClearBrowsingData:
@@ -322,16 +292,8 @@ void CustomizeToolbarHandler::ListAction
@@ -332,16 +302,8 @@ void CustomizeToolbarHandler::ListAction
add_action(kActionNewIncognitoWindow,
side_panel::customize_chrome::mojom::CategoryId::kNavigation);
@@ -75,7 +73,7 @@
add_action(kActionSidePanelShowHistoryCluster,
side_panel::customize_chrome::mojom::CategoryId::kYourChrome);
add_action(kActionShowDownloads,
@@ -345,18 +307,12 @@ void CustomizeToolbarHandler::ListAction
@@ -355,18 +317,12 @@ void CustomizeToolbarHandler::ListAction
}
add_action(kActionPrint,
side_panel::customize_chrome::mojom::CategoryId::kTools);
@@ -1,7 +1,7 @@
--- a/chrome/browser/profiles/profiles_state.cc
+++ b/chrome/browser/profiles/profiles_state.cc
@@ -326,7 +326,7 @@ std::u16string GetDefaultNameForNewEnter
name = base::UTF8ToUTF16(hosted_domain);
@@ -328,7 +328,7 @@ std::u16string GetDefaultNameForNewEnter
name = base::UTF8ToUTF16(*hosted_domain);
} else {
name = l10n_util::GetStringUTF16(
- IDS_SIGNIN_DICE_WEB_INTERCEPT_ENTERPRISE_PROFILE_NAME);
@@ -141,7 +141,7 @@
// See http://standards.freedesktop.org/basedir-spec/basedir-spec-latest.html
--- a/chrome/common/chrome_paths_win.cc
+++ b/chrome/common/chrome_paths_win.cc
@@ -49,6 +49,14 @@ bool GetDefaultUserDataDirectory(base::F
@@ -47,6 +47,14 @@ bool GetDefaultUserDataDirectory(base::F
return true;
}
@@ -0,0 +1,56 @@
--- a/third_party/search_engines_data/resources/definitions/prepopulated_engines.json
+++ b/third_party/search_engines_data/resources/definitions/prepopulated_engines.json
@@ -52,7 +52,7 @@
"bing": {
"name": "Microsoft Bing",
"keyword": "bing.com",
- "favicon_url": "https://www.bing.com/sa/simg/bing_p_rr_teal_min.ico",
+ "favicon_url": "",
"base_builtin_resource_id": "SEARCH_ENGINE_BING",
"logo_url": "https://cdn.sapphire.microsoftapp.net/icons/bing_144.png",
"search_url": "https://www.bing.com/search?q={searchTerms}",
@@ -120,7 +120,7 @@
"duckduckgo": {
"name": "DuckDuckGo",
"keyword": "duckduckgo.com",
- "favicon_url": "https://duckduckgo.com/favicon.ico",
+ "favicon_url": "",
"base_builtin_resource_id": "SEARCH_ENGINE_DUCKDUCKGO",
"logo_url": "https://staticcdn.duckduckgo.com/android/DuckDuckGoLogo.png",
"search_url": "https://duckduckgo.com/?q={searchTerms}",
@@ -139,7 +139,7 @@
"ecosia": {
"name": "Ecosia",
"keyword": "ecosia.org",
- "favicon_url": "https://cdn.ecosia.org/assets/images/ico/favicon.ico",
+ "favicon_url": "",
"base_builtin_resource_id": "SEARCH_ENGINE_ECOSIA",
"logo_url": "https://www.ecosia.org/static/icons/ecosia-logo-app-144x144.png",
"search_url": "https://www.ecosia.org/search?q={searchTerms}",
@@ -173,7 +173,7 @@
"break_stuff_google": {
"name": "Google",
"keyword": "google.com",
- "favicon_url": "https://www.google.com/images/branding/product/ico/googleg_alldp.ico",
+ "favicon_url": "",
"base_builtin_resource_id": "SEARCH_ENGINE_GOOGLE",
"search_url": "https://www.google.com/search?q={searchTerms}",
"suggest_url": "https://www.google.com/complete/search?client=chrome&q={searchTerms}",
@@ -197,7 +197,7 @@
"search_url": "https://kagi.com/search?q={searchTerms}",
"suggest_url": "https://kagisuggest.com/api/autosuggest?q={searchTerms}",
"new_tab_url": "https://kagi.com/",
- "favicon_url": "https://kagi.com/favicon.ico",
+ "favicon_url": "",
"base_builtin_resource_id": "SEARCH_ENGINE_KAGI",
"type": "SEARCH_ENGINE_KAGI",
"id": 115
@@ -339,7 +339,7 @@
"qwant": {
"name": "Qwant",
"keyword": "qwant.com",
- "favicon_url": "https://www.qwant.com/favicon.ico",
+ "favicon_url": "",
"base_builtin_resource_id": "SEARCH_ENGINE_QWANT",
"search_url": "https://www.qwant.com/?q={searchTerms}",
"suggest_url": "https://api.qwant.com/api/suggest/?q={searchTerms}",
@@ -1,7 +1,7 @@
--- a/components/search_engines/template_url_prepopulate_data.cc
+++ b/components/search_engines/template_url_prepopulate_data.cc
@@ -261,7 +261,7 @@ std::unique_ptr<TemplateURLData> GetPrep
std::vector<const TemplateURLPrepopulateData::PrepopulatedEngine*>
@@ -257,7 +257,7 @@ std::unique_ptr<TemplateURLData> GetPrep
const std::vector<const PrepopulatedEngine*>&
regional_prepopulated_engines) {
return FindPrepopulatedEngineInternal(prefs, regional_prepopulated_engines,
- google.id,
@@ -1,8 +1,8 @@
--- a/build/config/chrome_build.gni
+++ b/build/config/chrome_build.gni
@@ -92,4 +92,4 @@ declare_args() {
@@ -104,4 +104,4 @@ declare_args() {
# Whether to enable built-in branding assets (logos & marketing snippets) for
# search providers in choice UIs.
-enable_builtin_search_provider_assets = is_chrome_branded
-enable_builtin_search_provider_assets = is_internal_chrome_branded
+enable_builtin_search_provider_assets = true
@@ -8,7 +8,7 @@
#include "chrome/browser/signin/account_consistency_mode_manager.h"
#include "chrome/browser/signin/account_consistency_mode_manager_factory.h"
#include "chrome/browser/signin/chrome_signin_client_factory.h"
@@ -84,7 +83,6 @@
@@ -83,7 +82,6 @@
#include "components/plus_addresses/core/browser/plus_address_service.h"
#include "components/plus_addresses/core/common/features.h"
#include "components/prefs/pref_service.h"
@@ -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"
@@ -2505,14 +2503,9 @@ void AddSearchStrings(content::WebUIData
@@ -2795,14 +2793,9 @@ void AddSearchStrings(content::WebUIData
html_source->AddString("searchExplanationLearnMoreURL",
chrome::kOmniboxLearnMoreURL);
@@ -34,7 +34,7 @@
"saveGuestChoiceText", IDS_SEARCH_ENGINE_CHOICE_GUEST_SESSION_CHECKBOX);
--- a/components/regional_capabilities/regional_capabilities_service.cc
+++ b/components/regional_capabilities/regional_capabilities_service.cc
@@ -167,6 +167,8 @@ std::pair<CountryId, LoadedCountrySource
@@ -218,6 +218,8 @@ std::pair<CountryId, LoadedCountrySource
// Pass `out_scope_check_outcome` to collect information about the outcome of
// the program checks.
Program CountryIdToProgram(const CountryId& country_id) {
@@ -43,7 +43,24 @@
static constexpr Program kCountryDerivedPrograms[] = {
#if BUILDFLAG(IS_IOS)
// Only iOS can derive Taiyaki scope directly from the country.
@@ -351,6 +353,7 @@ RegionalCapabilitiesService::GetChoiceSc
@@ -341,14 +343,13 @@ RegionalCapabilitiesService::GetRegional
}
bool RegionalCapabilitiesService::IsInSearchEngineChoiceScreenRegion() {
- return GetChoiceScreenEligibilityConfig().has_value();
+ return true;
}
// static
bool RegionalCapabilitiesService::IsInSearchEngineChoiceScreenRegion(
const country_codes::CountryId& tested_country_id) {
- return GetSettingsForProgram(CountryIdToProgram(tested_country_id))
- .choice_screen_eligibility_config.has_value();
+ return true;
}
bool RegionalCapabilitiesService::
@@ -454,6 +455,7 @@ RegionalCapabilitiesService::GetChoiceSc
}
bool RegionalCapabilitiesService::IsInEeaCountry() {
@@ -51,21 +68,10 @@
// Feature behaviour was directly based on the current country, as a
// decentralised way to express a concept we are now framing as "program
// settings". Here we check for the program reference directly as command line
--- a/components/regional_capabilities/regional_capabilities_utils.cc
+++ b/components/regional_capabilities/regional_capabilities_utils.cc
@@ -55,7 +55,7 @@ void ShufflePrepopulatedEngines(std::vec
} // namespace
bool IsEeaCountry(country_codes::CountryId country_id) {
- return kEeaChoiceCountriesIds.contains(country_id);
+ return true;
}
std::optional<SearchEngineCountryOverride> GetSearchEngineCountryOverride() {
--- a/components/search_engine_choice_strings.grdp
+++ b/components/search_engine_choice_strings.grdp
@@ -106,6 +106,10 @@
These search engines are popular in your region
@@ -19,6 +19,10 @@
<ph name="SEARCH_ENGINE_NAME">$1<ex>Google</ex></ph> is now your default search engine
</message>
+ <message name="IDS_SEARCH_ENGINE_CHOICE_SETTINGS_SUBTITLE_HELIUM" desc="This is the body text of a dialog where the user can change their default search engine. This string explains that the list of search engines is randomized (not in order of recommendation).">
@@ -0,0 +1,13 @@
--- a/chrome/browser/ui/omnibox/omnibox_view.cc
+++ b/chrome/browser/ui/omnibox/omnibox_view.cc
@@ -135,10 +135,6 @@ ui::ImageModel OmniboxView::GetIcon(int
return ui::ImageModel::FromImage(icon);
}
}
- favicon = turl ? controller()->client()->GetFaviconForKeywordSearchProvider(
- turl, std::move(on_icon_fetched))
- : controller()->client()->GetFaviconForDefaultSearchProvider(
- std::move(on_icon_fetched));
} else if (match.type != AutocompleteMatchType::HISTORY_CLUSTER) {
// The starter pack suggestions are a unique case. These suggestions
@@ -1,6 +1,6 @@
--- a/chrome/chrome_repack_locales.gni
+++ b/chrome/chrome_repack_locales.gni
@@ -100,12 +100,6 @@ template("chrome_repack_locales") {
@@ -99,12 +99,6 @@ template("chrome_repack_locales") {
}
compress = true
}
@@ -26,7 +26,7 @@
namespace {
const bool kEnableBuiltinSearchProviderAssets =
@@ -1878,18 +1874,6 @@ std::string TemplateURL::GetBuiltinDescr
@@ -1945,18 +1941,6 @@ std::string TemplateURL::GetBuiltinDescr
}
std::optional<std::u16string> TemplateURL::GetBuiltinMarketingSnippet() const {
+410 -46
View File
@@ -1,6 +1,6 @@
--- a/chrome/app/settings_strings.grdp
+++ b/chrome/app/settings_strings.grdp
@@ -1911,6 +1911,31 @@
@@ -1980,6 +1980,40 @@
<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>
@@ -10,6 +10,15 @@
+ <message name="IDS_SETTINGS_HELIUM_SERVICES_DESCRIPTION" desc="Description of the controls available on the Helium services settings page">
+ Manage what Helium services are allowed in your browser
+ </message>
+ <message name="IDS_SETTINGS_HELIUM_SCHEMA_NOTICE_TITLE" desc="Title of the alert shown when Helium services have a change in behavior">
+ Updates to Helium services:
+ </message>
+ <message name="IDS_SETTINGS_HELIUM_SCHEMA_NOTICE_DESCRIPTION" desc="Description of the alert shown when Helium services have a change in behavior">
+ These changes are not active until you dismiss this notice.
+ </message>
+ <message name="IDS_SETTINGS_HELIUM_SCHEMA_IGNORE" desc="Checkbox label to ignore any future services change alerts">
+ Don't notify me again
+ </message>
+ <message name="IDS_SETTINGS_HELIUM_SERVICES_TOGGLE" desc="Global toggle for enabling/disabling of all Helium services">
+ Allow connecting to Helium services
+ </message>
@@ -34,8 +43,8 @@
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
@@ -1967,6 +1967,18 @@ void AddPrivacyStrings(content::WebUIDat
{"permissionsPageDescription", IDS_SETTINGS_PERMISSIONS_DESCRIPTION},
@@ -2188,6 +2188,23 @@ void AddPrivacyStrings(content::WebUIDat
{"siteSettingsSublabel", IDS_SETTINGS_PERMISSIONS_DESCRIPTION},
{"securityPageTitle", IDS_SETTINGS_SECURITY},
{"securityPageDescription", IDS_SETTINGS_SECURITY_DESCRIPTION},
+ {"heliumServicesTitle", IDS_SETTINGS_HELIUM_SERVICES},
@@ -43,6 +52,11 @@
+ {"heliumServicesToggle", IDS_SETTINGS_HELIUM_SERVICES_TOGGLE},
+ {"heliumServicesToggleDescription",
+ IDS_SETTINGS_HELIUM_SERVICES_TOGGLE_DESCRIPTION},
+ {"heliumSchemaUpdatedTitle", IDS_SETTINGS_HELIUM_SCHEMA_NOTICE_TITLE},
+ {"heliumSchemaUpdatedDescription",
+ IDS_SETTINGS_HELIUM_SCHEMA_NOTICE_DESCRIPTION},
+ {"heliumGotIt", IDS_SETTINGS_GOT_IT},
+ {"heliumSchemaIgnore", IDS_SETTINGS_HELIUM_SCHEMA_IGNORE},
+ {"heliumOriginOverride", IDS_SETTINGS_HELIUM_SERVICES_OVERRIDE},
+ {"heliumOriginOverrideDescription",
+ IDS_SETTINGS_HELIUM_SERVICES_OVERRIDE_DESCRIPTION},
@@ -55,9 +69,9 @@
{"advancedProtectionProgramDesc",
--- a/chrome/browser/resources/settings/privacy_page/privacy_page.html
+++ b/chrome/browser/resources/settings/privacy_page/privacy_page.html
@@ -67,6 +67,11 @@
sub-label="$i18n{permissionsPageDescription}"
on-click="onPermissionsPageClick_"
@@ -58,6 +58,11 @@
sub-label="$i18n{siteSettingsSublabel}"
on-click="onSiteSettingsLinkRowClick_"
role-description="$i18n{subpageArrowRoleDescription}"></cr-link-row>
+ <cr-link-row id="heliumServicesLinkRow" start-icon="cr:chrome-product"
+ class="hr" label="$i18n{heliumServicesTitle}"
@@ -69,7 +83,7 @@
</cr-toast>
--- a/chrome/browser/resources/settings/privacy_page/privacy_page_index.html
+++ b/chrome/browser/resources/settings/privacy_page/privacy_page_index.html
@@ -45,6 +45,14 @@
@@ -39,6 +39,14 @@
</settings-privacy-page>
</template>
@@ -83,10 +97,10 @@
+
<template is="dom-if" if="[[isAdPrivacyAvailable_]]" restamp>
<template is="dom-if" if="[[renderView_(
routes_.PRIVACY_SANDBOX, currentRoute, inSearchMode)]]">
routes_.PRIVACY_SANDBOX, currentRoute, inSearchMode)]]"
--- a/chrome/browser/resources/settings/privacy_page/privacy_page.ts
+++ b/chrome/browser/resources/settings/privacy_page/privacy_page.ts
@@ -171,6 +171,12 @@ export class SettingsPrivacyPageElement
@@ -165,6 +165,12 @@ export class SettingsPrivacyPageElement
Router.getInstance().navigateTo(routes.SITE_SETTINGS);
}
@@ -99,7 +113,7 @@
private onSecurityPageClick_() {
this.interactedWithPage_();
this.metricsBrowserProxy_.recordAction(
@@ -253,6 +259,10 @@ export class SettingsPrivacyPageElement
@@ -232,6 +238,10 @@ export class SettingsPrivacyPageElement
override getFocusConfig() {
const map = new Map();
@@ -110,7 +124,7 @@
if (routes.COOKIES) {
map.set(routes.COOKIES.path, '#thirdPartyCookiesLinkRow');
}
@@ -286,6 +296,9 @@ export class SettingsPrivacyPageElement
@@ -259,6 +269,9 @@ export class SettingsPrivacyPageElement
override getAssociatedControlFor(childViewId: string): HTMLElement {
let triggerId: string|null = null;
switch (childViewId) {
@@ -128,8 +142,8 @@
GLIC_SECTION: Route;
+ HELIUM_SERVICES: Route;
HISTORY_SEARCH: Route;
INCOGNITO_TRACKING_PROTECTIONS: Route;
LANGUAGES: Route;
MANAGE_PROFILE: Route;
--- a/chrome/browser/resources/settings/route.ts
+++ b/chrome/browser/resources/settings/route.ts
@@ -18,6 +18,8 @@ function addPrivacyChildRoutes(r: Partia
@@ -143,25 +157,75 @@
if (visibility.safetyHub !== false) {
--- a/chrome/browser/resources/settings/BUILD.gn
+++ b/chrome/browser/resources/settings/BUILD.gn
@@ -155,6 +155,7 @@ build_webui("build") {
"privacy_page/security_keys_subpage.ts",
"privacy_page/security_page_v2.ts",
"privacy_page/security_page.ts",
@@ -157,6 +157,7 @@ build_webui("build") {
"privacy_page/security/security_page_v2.ts",
"privacy_page/security/security_page.ts",
"privacy_page/security/security_page_feature_row.ts",
+ "privacy_page/services_page.ts",
"privacy_sandbox/privacy_sandbox_ad_measurement_subpage.ts",
"privacy_sandbox/privacy_sandbox_fledge_subpage.ts",
"privacy_sandbox/privacy_sandbox_interest_item.ts",
@@ -396,6 +397,7 @@ build_webui("build") {
"languages_page/languages_util.ts",
"people_page/import_data_browser_proxy.ts",
"people_page/manage_profile_browser_proxy.ts",
+ "privacy_page/changelog_proxy.ts",
"system_page/system_page_browser_proxy.ts",
]
}
--- /dev/null
+++ b/chrome/browser/resources/settings/privacy_page/services_page.html
@@ -0,0 +1,47 @@
@@ -0,0 +1,89 @@
+<style include="cr-shared-style settings-shared">
+ .label-wrapper {
+ padding: var(--cr-section-vertical-padding) 0;
+ }
+
+ #changelog-notice {
+ --cr-changelog-padding: 16px;
+ border-radius: calc(var(--cr-changelog-padding) / 2);
+ margin: var(--cr-changelog-padding);
+ margin-top: 0;
+ padding: var(--cr-changelog-padding);
+ background: var(--md-background-color);
+ }
+
+ #changelog-title {
+ font-size: 15px;
+ font-weight: 500;
+ }
+
+ #changelog-notice-actions {
+ --cr-checkbox-label-padding-start: 8px;
+ display: flex;
+ gap: var(--cr-changelog-padding);
+ border-top: var(--cr-separator-line);
+ margin-top: var(--cr-changelog-padding);
+ padding-top: calc(var(--cr-changelog-padding) / 2);
+ }
+</style>
+
+<settings-subpage page-title="$i18n{heliumServicesTitle}" route-path$="[[routePath]]">
+<div class="cr-col first">
+ <template is="dom-if" if="[[changes_.length]]">
+ <div id="changelog-notice">
+ <div id="changelog-title">$i18n{heliumSchemaUpdatedTitle}</div>
+ <ul>
+ <template is="dom-repeat" items="[[changes_]]" as="change">
+ <li>[[change]]</li>
+ </template>
+ </ul>
+ <div id="changelog-description">
+ $i18n{heliumSchemaUpdatedDescription}
+ </div>
+ <div id="changelog-notice-actions">
+ <cr-button on-click="onAcknowledgedChangelog_">$i18n{heliumGotIt}</cr-button>
+ <cr-checkbox id="checkbox" checked="{{ignoreChecked_}}">
+ $i18n{heliumSchemaIgnore}
+ </cr-checkbox>
+ </div>
+ </div>
+ </template>
+ <settings-toggle-button id="servicesToggleButton"
+ pref="{{prefs.helium.services.enabled}}"
+ label="$i18n{heliumServicesToggle}"
@@ -196,31 +260,44 @@
+ aria-label="$i18n{heliumOriginOverrideLabel}"
+ auto-validate
+ error-message="Invalid origin"
+ spellcheck="false"
+ />
+ spellcheck="false">
+ </cr-input>
+ </div>
+</div>
+</settings-subpage>
--- /dev/null
+++ b/chrome/browser/resources/settings/privacy_page/services_page.ts
@@ -0,0 +1,67 @@
@@ -0,0 +1,105 @@
+// Copyright 2025 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.
+
+import {HelpBubbleMixin} from 'chrome://resources/cr_components/help_bubble/help_bubble_mixin.js';
+import {I18nMixin} from 'chrome://resources/cr_elements/i18n_mixin.js';
+import '../controls/settings_toggle_button.js';
+import '../settings_page/settings_subpage.js';
+import 'chrome://resources/cr_elements/cr_button/cr_button.js';
+import 'chrome://resources/cr_elements/cr_checkbox/cr_checkbox.js';
+import 'chrome://resources/cr_elements/cr_collapse/cr_collapse.js';
+import 'chrome://resources/cr_elements/cr_icon/cr_icon.js';
+import 'chrome://resources/cr_elements/cr_input/cr_input.js';
+
+import {PrefsMixin} from '/shared/settings/prefs/prefs_mixin.js';
+import {PolymerElement} from 'chrome://resources/polymer/v3_0/polymer/polymer_bundled.min.js';
+import {getTemplate} from './services_page.html.js';
+import {HelpBubbleMixin} from 'chrome://resources/cr_components/help_bubble/help_bubble_mixin.js';
+import type {CrInputElement} from 'chrome://resources/cr_elements/cr_input/cr_input.js';
+import {I18nMixin} from 'chrome://resources/cr_elements/i18n_mixin.js';
+import {PolymerElement} from 'chrome://resources/polymer/v3_0/polymer/polymer_bundled.min.js';
+
+import type {HeliumServicesChangeHandler} from './changelog_proxy.js';
+import {HeliumServicesChangeHandlerImpl} from './changelog_proxy.js';
+import {getTemplate} from './services_page.html.js';
+
+const SettingsHeliumServicesPageElementBase =
+ HelpBubbleMixin(I18nMixin(PrefsMixin(PolymerElement)));
+
+export class SettingsHeliumServicesPageElement
+ extends SettingsHeliumServicesPageElementBase
+{
+export class SettingsHeliumServicesPageElement extends
+ SettingsHeliumServicesPageElementBase {
+ private changeProxy_: HeliumServicesChangeHandler =
+ HeliumServicesChangeHandlerImpl.getInstance();
+
+ static get is() {
+ return 'settings-helium-services-page';
+ }
@@ -230,9 +307,15 @@
+ }
+
+ static get properties() {
+ return {};
+ return {
+ ignoreChecked_: Boolean,
+ changes_: Array,
+ };
+ }
+
+ declare private changes_: string[];
+ declare private ignoreChecked_: boolean;
+
+ private toOrigin(thing: string) {
+ try {
+ return new URL(thing).origin;
@@ -241,6 +324,25 @@
+ }
+ }
+
+ private updateChangelogState(changes: string[]) {
+ this.changes_ = changes.flatMap(ch => ch.split('\n'));
+ }
+
+ private requestChangelog() {
+ this.changeProxy_.requestChangelog().then(
+ this.updateChangelogState.bind(this));
+ }
+
+ private onAcknowledgedChangelog_() {
+ this.changeProxy_.acknowledgeChanges(this.ignoreChecked_);
+ this.requestChangelog();
+ }
+
+ override ready() {
+ super.ready();
+ this.requestChangelog();
+ }
+
+ protected onOriginOverrideKeydown_(event: KeyboardEvent) {
+ const target = event.target as CrInputElement;
+
@@ -273,22 +375,22 @@
+customElements.define(SettingsHeliumServicesPageElement.is, SettingsHeliumServicesPageElement);
--- a/chrome/browser/resources/settings/lazy_load.ts
+++ b/chrome/browser/resources/settings/lazy_load.ts
@@ -35,6 +35,7 @@ import './privacy_sandbox/privacy_sandbo
import './privacy_page/security_keys_subpage.js';
import './privacy_page/security_page_v2.js';
import './privacy_page/security_page.js';
@@ -27,6 +27,7 @@ import './privacy_page/privacy_guide/pri
import './privacy_page/security/security_keys_subpage.js';
import './privacy_page/security/security_page_v2.js';
import './privacy_page/security/security_page.js';
+import './privacy_page/services_page.js';
import './safety_hub/safety_hub_page.js';
import './safety_hub/safety_hub_entry_point.js';
import './site_settings/ads_page.js';
@@ -243,6 +244,7 @@ export {ResetDialogPage, SettingsSecurit
export {SetPinDialogPage, SettingsSecurityKeysSetPinDialogElement} from './privacy_page/security_keys_set_pin_dialog.js';
export {SecurityKeysSubpageElement} from './privacy_page/security_keys_subpage.js';
export {HttpsFirstModeSetting, SafeBrowsingSetting, SettingsSecurityPageElement} from './privacy_page/security_page.js';
import './privacy_sandbox/privacy_sandbox_ad_measurement_subpage.js';
import './privacy_sandbox/privacy_sandbox_fledge_subpage.js';
import './privacy_sandbox/privacy_sandbox_interest_item.js';
@@ -272,6 +273,7 @@ export {SecurityKeysSubpageElement} from
export {HttpsFirstModeSetting, SettingsSecurityPageElement} from './privacy_page/security/security_page.js';
export {SecurityPageFeatureRowElement} from './privacy_page/security/security_page_feature_row.js';
export {SecuritySettingsBundleSetting, SettingsSecurityPageV2Element} from './privacy_page/security/security_page_v2.js';
+export {SettingsHeliumServicesPageElement} from './privacy_page/services_page.js';
export {SecuritySettingsBundleSetting, SettingsSecurityPageV2Element} from './privacy_page/security_page_v2.js';
export {SettingsPrivacySandboxAdMeasurementSubpageElement} from './privacy_sandbox/privacy_sandbox_ad_measurement_subpage.js';
export {SettingsPrivacySandboxFledgeSubpageElement} from './privacy_sandbox/privacy_sandbox_fledge_subpage.js';
export {PrivacySandboxInterestItemElement} from './privacy_sandbox/privacy_sandbox_interest_item.js';
--- a/chrome/browser/ui/browser_ui_prefs.cc
+++ b/chrome/browser/ui/browser_ui_prefs.cc
@@ -14,6 +14,7 @@
@@ -299,11 +401,13 @@
#include "components/policy/core/common/policy_pref_names.h"
#include "components/pref_registry/pref_registry_syncable.h"
#include "components/prefs/pref_registry_simple.h"
@@ -201,6 +202,11 @@ void RegisterBrowserUserPrefs(user_prefs
@@ -206,6 +207,13 @@ void RegisterBrowserUserPrefs(user_prefs
false);
#endif
+ {
+ registry->RegisterIntegerPref(prefs::kHeliumSchemaVersion, 0);
+ registry->RegisterBooleanPref(prefs::kHeliumDisableSchemaAlerts, false);
+ registry->RegisterBooleanPref(prefs::kHeliumServicesEnabled, true);
+ registry->RegisterStringPref(prefs::kHeliumServicesOrigin, "");
+ }
@@ -321,7 +425,7 @@
#include "components/language/core/browser/pref_names.h"
#include "components/live_caption/pref_names.h"
#include "components/media_router/common/pref_names.h"
@@ -351,6 +352,12 @@ const PrefsUtil::TypedPrefMap& PrefsUtil
@@ -359,6 +360,12 @@ const PrefsUtil::TypedPrefMap& PrefsUtil
settings_api::PrefType::kString;
#endif
@@ -336,7 +440,7 @@
settings_api::PrefType::kBoolean;
--- /dev/null
+++ b/components/helium_services/BUILD.gn
@@ -0,0 +1,20 @@
@@ -0,0 +1,22 @@
+# Copyright 2025 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.
@@ -346,6 +450,8 @@
+ "helium_services_helpers.cc",
+ "helium_services_helpers.h",
+ "pref_names.h",
+ "schema.cc",
+ "schema.h",
+ ]
+
+ public_deps = [
@@ -359,7 +465,7 @@
+}
--- /dev/null
+++ b/components/helium_services/helium_services_helpers.cc
@@ -0,0 +1,66 @@
@@ -0,0 +1,67 @@
+// Copyright 2025 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.
@@ -422,13 +528,14 @@
+ PrefChangeRegistrar& registrar, const base::RepeatingClosure& observer) {
+ registrar.Add(prefs::kHeliumServicesEnabled, observer);
+ registrar.Add(prefs::kHeliumServicesOrigin, observer);
+ registrar.Add(prefs::kHeliumSchemaVersion, observer);
+ registrar.Add(pref_name, observer);
+}
+
+} // namespace helium
--- /dev/null
+++ b/components/helium_services/helium_services_helpers.h
@@ -0,0 +1,28 @@
@@ -0,0 +1,30 @@
+// Copyright 2025 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.
@@ -449,6 +556,8 @@
+const char kHeliumDummyOrigin[] =
+ "https://helium-services-are-disabled.qjz9zk";
+
+bool ShouldAccessServices(const PrefService& prefs);
+
+COMPONENT_EXPORT(HELIUM) GURL GetServicesBaseURL(const PrefService& prefs);
+COMPONENT_EXPORT(HELIUM) GURL GetDummyURL();
+COMPONENT_EXPORT(HELIUM) std::optional<GURL> GetValidUserOverridenURL(std::string_view user_url_);
@@ -459,7 +568,7 @@
+#endif // COMPONENTS_HELIUM_SERVICES_HELIUM_SERVICES_HELPERS_H_
--- /dev/null
+++ b/components/helium_services/pref_names.h
@@ -0,0 +1,18 @@
@@ -0,0 +1,24 @@
+// Copyright 2025 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.
@@ -469,6 +578,12 @@
+
+namespace prefs {
+
+inline constexpr char kHeliumSchemaVersion[] =
+ "helium.services.schema_version";
+
+inline constexpr char kHeliumDisableSchemaAlerts[] =
+ "helium.services.disable_schema_alerts";
+
+inline constexpr char kHeliumServicesEnabled[] =
+ "helium.services.enabled";
+
@@ -478,3 +593,252 @@
+} // namespace prefs
+
+#endif // COMPONENTS_HELIUM_SERVICES_PREF_NAMES_H_
--- /dev/null
+++ b/chrome/browser/resources/settings/privacy_page/changelog_proxy.ts
@@ -0,0 +1,40 @@
+// Copyright 2025 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.
+
+/**
+ * @fileoverview A helper object used from the "Helium services" section
+ * to request a changelog (if one exists).
+ */
+
+// clang-format off
+import {sendWithPromise} from 'chrome://resources/js/cr.js';
+// clang-format on
+
+export interface HeliumServicesChangeHandler {
+ // Get the pending changes to Helium services to announce
+ // to the user.
+ requestChangelog(): Promise<string[]>;
+ acknowledgeChanges(ignoreAllChangelogs: boolean): void;
+}
+
+export class HeliumServicesChangeHandlerImpl implements
+ HeliumServicesChangeHandler {
+ requestChangelog() {
+ return sendWithPromise('getServicesSchemaChangelog');
+ }
+
+ acknowledgeChanges(ignoreAllChangelogs: boolean) {
+ chrome.send('updateServicesSchemaVersion', [ignoreAllChangelogs]);
+ }
+
+ static getInstance(): HeliumServicesChangeHandler {
+ return instance || (instance = new HeliumServicesChangeHandlerImpl());
+ }
+
+ static setInstance(obj: HeliumServicesChangeHandler) {
+ instance = obj;
+ }
+}
+
+let instance: HeliumServicesChangeHandler|null = null;
--- /dev/null
+++ b/chrome/browser/ui/webui/settings/services_schema_handler.h
@@ -0,0 +1,36 @@
+// Copyright 2025 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.
+
+#ifndef CHROME_BROWSER_UI_WEBUI_SETTINGS_SERVICES_SCHEMA_HANDLER_H_
+#define CHROME_BROWSER_UI_WEBUI_SETTINGS_SERVICES_SCHEMA_HANDLER_H_
+
+#include <optional>
+#include <string>
+
+#include "base/memory/raw_ptr.h"
+#include "base/values.h"
+#include "content/public/browser/web_ui_message_handler.h"
+
+class Profile;
+class PrefService;
+
+class HeliumServicesSchemaHandler : public content::WebUIMessageHandler {
+ public:
+ explicit HeliumServicesSchemaHandler(Profile* profile);
+ HeliumServicesSchemaHandler(const HeliumServicesSchemaHandler&) = delete;
+ HeliumServicesSchemaHandler& operator=(const HeliumServicesSchemaHandler&) =
+ delete;
+ ~HeliumServicesSchemaHandler() override;
+
+ // SettingsPageUIHandler:
+ void RegisterMessages() override;
+
+ private:
+ void HandleChangelogRequest(const base::Value::List&);
+ void HandleChangelogAcknowledgment(const base::Value::List&);
+
+ raw_ptr<PrefService> pref_service_ = nullptr;
+};
+
+#endif // CHROME_BROWSER_UI_WEBUI_SETTINGS_SERVICES_SCHEMA_HANDLER_H_
--- /dev/null
+++ b/components/helium_services/schema.cc
@@ -0,0 +1,40 @@
+// Copyright 2025 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.
+
+#include "components/helium_services/schema.h"
+
+#include "components/helium_services/helium_services_helpers.h"
+#include "components/helium_services/pref_names.h"
+#include "components/prefs/pref_service.h"
+
+namespace helium {
+
+bool HasAcceptedSchema(const PrefService& prefs, int version) {
+ return prefs.GetBoolean(prefs::kHeliumDisableSchemaAlerts) ||
+ prefs.GetInteger(prefs::kHeliumSchemaVersion) >= version;
+}
+
+void AcceptCurrentSchema(PrefService& prefs) {
+ prefs.SetInteger(prefs::kHeliumSchemaVersion, kHeliumCurrentSchemaVersion);
+}
+
+bool ShouldShowSchemaNotification(const PrefService& prefs) {
+ return ShouldAccessServices(prefs) &&
+ !HasAcceptedSchema(prefs, kHeliumCurrentSchemaVersion);
+}
+
+ServicesChangelog& GetChangelog() {
+ static constexpr auto kHeliumSchemaChangelog =
+ base::MakeFixedFlatMap<int, std::string_view>({
+ {
+ 1,
+ "Automatic component updates are now available. They're managed by the same toggle that enables automatic browser updates.\n"
+ "From now on, you'll be notified about major changes to Helium services. Even though these notifications are extremely rare, you can choose to ignore them and accept all future changes automatically."
+ }
+ });
+
+ return kHeliumSchemaChangelog;
+}
+
+} // namespace helium
--- /dev/null
+++ b/components/helium_services/schema.h
@@ -0,0 +1,30 @@
+// Copyright 2025 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.
+
+#ifndef COMPONENTS_HELIUM_SERVICES_SCHEMA_H_
+#define COMPONENTS_HELIUM_SERVICES_SCHEMA_H_
+
+#include "base/component_export.h"
+#include "base/containers/fixed_flat_map.h"
+#include "components/prefs/pref_service.h"
+
+namespace helium {
+
+inline constexpr int kHeliumCurrentSchemaVersion = 1;
+
+using ServicesChangelog = const base::
+ fixed_flat_map<int, std::string_view, kHeliumCurrentSchemaVersion>;
+
+#define EX COMPONENT_EXPORT(HELIUM)
+
+EX bool HasAcceptedSchema(const PrefService& prefs, int version);
+EX void AcceptCurrentSchema(PrefService& prefs);
+EX bool ShouldShowSchemaNotification(const PrefService& prefs);
+EX ServicesChangelog& GetChangelog();
+
+#undef EX
+
+} // namespace helium
+
+#endif // COMPONENTS_HELIUM_SERVICES_SCHEMA_H_
--- a/chrome/browser/ui/BUILD.gn
+++ b/chrome/browser/ui/BUILD.gn
@@ -1301,6 +1301,8 @@ static_library("ui") {
"webui/settings/search_engines_handler.h",
"webui/settings/security_settings_provider.cc",
"webui/settings/security_settings_provider.h",
+ "webui/settings/services_schema_handler.cc",
+ "webui/settings/services_schema_handler.h",
"webui/settings/settings_clear_browsing_data_handler.cc",
"webui/settings/settings_clear_browsing_data_handler.h",
"webui/settings/settings_localized_strings_privacy_sandbox_provider.cc",
--- /dev/null
+++ b/chrome/browser/ui/webui/settings/services_schema_handler.cc
@@ -0,0 +1,58 @@
+// Copyright 2025 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.
+
+#include "chrome/browser/ui/webui/settings/services_schema_handler.h"
+
+#include "base/functional/bind.h"
+#include "base/values.h"
+#include "chrome/browser/profiles/profile.h"
+#include "components/helium_services/pref_names.h"
+#include "components/helium_services/schema.h"
+#include "components/prefs/pref_service.h"
+
+HeliumServicesSchemaHandler::HeliumServicesSchemaHandler(Profile* profile)
+ : pref_service_(profile->GetPrefs()) {}
+
+HeliumServicesSchemaHandler::~HeliumServicesSchemaHandler() = default;
+
+void HeliumServicesSchemaHandler::RegisterMessages() {
+ web_ui()->RegisterMessageCallback(
+ "getServicesSchemaChangelog",
+ base::BindRepeating(&HeliumServicesSchemaHandler::HandleChangelogRequest,
+ base::Unretained(this)));
+ web_ui()->RegisterMessageCallback(
+ "updateServicesSchemaVersion",
+ base::BindRepeating(
+ &HeliumServicesSchemaHandler::HandleChangelogAcknowledgment,
+ base::Unretained(this)));
+}
+
+void HeliumServicesSchemaHandler::HandleChangelogRequest(
+ const base::Value::List& args) {
+ CHECK_EQ(1U, args.size());
+ const auto& callback_id = args[0].GetString();
+ base::Value::List out;
+
+ if (helium::ShouldShowSchemaNotification(*pref_service_)) {
+ int user_version = pref_service_->GetInteger(prefs::kHeliumSchemaVersion);
+ auto& changelog = helium::GetChangelog();
+
+ for (auto it = changelog.upper_bound(user_version); it != changelog.end();
+ ++it) {
+ out.Append(it->second);
+ }
+ }
+
+ AllowJavascript();
+ ResolveJavascriptCallback(base::Value(callback_id), std::move(out));
+}
+
+void HeliumServicesSchemaHandler::HandleChangelogAcknowledgment(
+ const base::Value::List& args) {
+ CHECK_EQ(1U, args.size());
+ bool ignore_alerts = args[0].GetBool();
+
+ helium::AcceptCurrentSchema(*pref_service_);
+ pref_service_->SetBoolean(prefs::kHeliumDisableSchemaAlerts, ignore_alerts);
+}
--- a/chrome/browser/ui/webui/settings/settings_ui.cc
+++ b/chrome/browser/ui/webui/settings/settings_ui.cc
@@ -76,6 +76,7 @@
#include "chrome/browser/ui/webui/settings/saved_info_handler.h"
#include "chrome/browser/ui/webui/settings/search_engines_handler.h"
#include "chrome/browser/ui/webui/settings/security_settings_provider.h"
+#include "chrome/browser/ui/webui/settings/services_schema_handler.h"
#include "chrome/browser/ui/webui/settings/settings_clear_browsing_data_handler.h"
#include "chrome/browser/ui/webui/settings/settings_localized_strings_provider.h"
#include "chrome/browser/ui/webui/settings/settings_media_devices_selection_handler.h"
@@ -259,6 +260,8 @@ SettingsUI::SettingsUI(content::WebUI* w
AddSettingsPageUIHandler(std::make_unique<ProtocolHandlersHandler>(profile));
AddSettingsPageUIHandler(std::make_unique<PrivacySandboxHandler>());
AddSettingsPageUIHandler(std::make_unique<SearchEnginesHandler>(profile));
+ AddSettingsPageUIHandler(
+ std::make_unique<HeliumServicesSchemaHandler>(profile));
AddSettingsPageUIHandler(std::make_unique<SecureDnsHandler>());
AddSettingsPageUIHandler(std::make_unique<SiteSettingsHandler>(profile));
AddSettingsPageUIHandler(std::make_unique<StartupPagesHandler>(web_ui));
@@ -0,0 +1,232 @@
--- a/chrome/app/chromium_strings.grd
+++ b/chrome/app/chromium_strings.grd
@@ -967,6 +967,10 @@ Chromium is unable to recover your setti
Customize and control Chromium. Update is available.
</message>
+ <message name="IDS_APPMENU_TOOLTIP_HELIUM_SERVICES_UPDATE" desc="The tooltip to show for the browser menu when Helium services schema changes">
+ Helium services have been updated. Please review the changes.
+ </message>
+
<message name="IDS_APPMENU_TOOLTIP_ALERT" desc="The tooltip to show for the browser menu when a non-update alert is displayed">
Customize and control Chromium. Something needs your attention - click for details.
</message>
@@ -1659,6 +1663,11 @@ Chromium is unable to recover your setti
Chromium couldn't update to the latest version, so you're missing out on new features and security fixes.
</message>
+ <!-- Helium services schema change bubble -->
+ <message name="IDS_HELIUM_SERVICES_SCHEMA_MENU_ITEM" desc="Text for the bubble that notifies the user of a schema change in Helium services.">
+ Review Helium services updates
+ </message>
+
<!-- User menu errors -->
<message name="IDS_SYNC_ERROR_USER_MENU_UPGRADE_BUTTON" desc="Button in the header of desktop user menu that prompts the user to update Chrome to fix the out-of-date Chrome client error.">
Update Chromium
--- a/chrome/app/generated_resources.grd
+++ b/chrome/app/generated_resources.grd
@@ -13409,6 +13409,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>
+ <message name="IDS_APP_MENU_BUTTON_HELIUM_SERVICES_UPDATE" desc="Short label next to app-menu button when Helium services behavior changes.">
+ Services updated
+ </message>
<if expr="is_win or is_macosx or is_linux">
<message name="IDS_APP_MENU_BUTTON_UPDATE_ALT1" desc="Alternate short label next to app-menu button when an update is available.">
Finish update
--- a/chrome/app/chrome_command_ids.h
+++ b/chrome/app/chrome_command_ids.h
@@ -304,6 +304,7 @@
#define IDC_SHOW_COMMENTS_SIDE_PANEL 40297
#define IDC_RECENT_TABS_SEE_DEVICE_TABS 40298
#define IDC_SHOW_AI_MODE_OMNIBOX_BUTTON 40299
+#define IDC_HELIUM_SERVICES_OPEN 40300
// Spell-check
// Insert any additional suggestions before _LAST; these have to be consecutive.
--- a/chrome/browser/ui/chrome_pages.h
+++ b/chrome/browser/ui/chrome_pages.h
@@ -138,6 +138,7 @@ void ShowSafeBrowsingEnhancedProtectionW
safe_browsing::SafeBrowsingSettingReferralMethod referral_method);
void ShowImportDialog(Browser* browser);
void ShowAboutChrome(Browser* browser);
+void ShowHeliumServices(Browser* browser);
void ShowSearchEngineSettings(Browser* browser);
void ShowWebStore(Browser* browser, std::string_view utm_source_value);
void ShowPrivacySandboxSettings(Browser* browser);
--- a/chrome/browser/ui/chrome_pages.cc
+++ b/chrome/browser/ui/chrome_pages.cc
@@ -616,6 +616,11 @@ void ShowAboutChrome(Browser* browser) {
ShowSingletonTabIgnorePathOverwriteNTP(browser, GURL(kChromeUIHelpURL));
}
+void ShowHeliumServices(Browser* browser) {
+ ShowSingletonTabIgnorePathOverwriteNTP(
+ browser, GURL("chrome://settings/privacy/services"));
+}
+
void ShowSearchEngineSettings(Browser* browser) {
base::RecordAction(UserMetricsAction("EditSearchEngines"));
ShowSettingsSubPage(browser, kSearchEnginesSubPage);
--- a/chrome/browser/ui/browser_command_controller.cc
+++ b/chrome/browser/ui/browser_command_controller.cc
@@ -1095,6 +1095,9 @@ bool BrowserCommandController::ExecuteCo
case IDC_UPGRADE_DIALOG:
OpenUpdateChromeDialog(browser_);
break;
+ case IDC_HELIUM_SERVICES_OPEN:
+ ShowHeliumServices(browser_->GetBrowserForOpeningWebUi());
+ break;
case IDC_OPEN_SAFETY_HUB:
ShowSettingsSubPage(browser_->GetBrowserForOpeningWebUi(),
chrome::kSafetyHubSubPage);
@@ -1686,6 +1689,7 @@ void BrowserCommandController::InitComma
// These are always enabled; the menu determines their menu item visibility.
command_updater_.UpdateCommandEnabled(IDC_UPGRADE_DIALOG, true);
+ command_updater_.UpdateCommandEnabled(IDC_HELIUM_SERVICES_OPEN, true);
command_updater_.UpdateCommandEnabled(IDC_SET_BROWSER_AS_DEFAULT, true);
// Safety Hub commands.
--- a/chrome/browser/ui/toolbar/app_menu_model.h
+++ b/chrome/browser/ui/toolbar/app_menu_model.h
@@ -288,6 +288,9 @@ class AppMenuModel : public ui::SimpleMe
// boolean indicating whether any menu items were added.
bool AddDefaultBrowserMenuItems();
+ // Adds a nag to review Helium services permission changes
+ bool AddHeliumSchemaItem();
+
// Adds the Safety Hub menu notifications to the menu. Returns a boolean
// indicating whether any menu items were added.
[[nodiscard]] bool AddSafetyHubMenuItem();
--- a/chrome/browser/ui/toolbar/app_menu_model.cc
+++ b/chrome/browser/ui/toolbar/app_menu_model.cc
@@ -103,6 +103,7 @@
#include "components/dom_distiller/core/url_utils.h"
#include "components/feature_engagement/public/event_constants.h"
#include "components/feature_engagement/public/feature_constants.h"
+#include "components/helium_services/schema.h"
#include "components/lens/lens_features.h"
#include "components/omnibox/browser/vector_icons.h"
#include "components/password_manager/content/common/web_ui_constants.h"
@@ -2100,7 +2101,8 @@ bool AppMenuModel::AddGlobalErrorMenuIte
// how update the menu if new errors are added.
const GlobalErrorService::GlobalErrorList& errors =
GlobalErrorServiceFactory::GetForProfile(browser_->profile())->errors();
- bool menu_items_added = false;
+ bool menu_items_added = AddHeliumSchemaItem();
+
for (GlobalError* error : errors) {
DCHECK(error);
if (error->HasMenuItem()) {
@@ -2164,6 +2166,22 @@ bool AppMenuModel::AddSafetyHubMenuItem(
return true;
}
+bool AppMenuModel::AddHeliumSchemaItem() {
+ if (!helium::ShouldShowSchemaNotification(
+ *browser()->profile()->GetPrefs())) {
+ return false;
+ }
+
+ const auto update_icon = ui::ImageModel::FromVectorIcon(
+ omnibox::kProductChromeRefreshIcon, ui::kColorMenuIcon, kDefaultIconSize);
+ AddItemWithIcon(
+ IDC_HELIUM_SERVICES_OPEN,
+ l10n_util::GetStringUTF16(IDS_HELIUM_SERVICES_SCHEMA_MENU_ITEM),
+ update_icon);
+
+ return true;
+}
+
#if BUILDFLAG(IS_CHROMEOS)
void AppMenuModel::UpdateSettingsItemState() {
bool is_disabled =
--- a/chrome/browser/ui/toolbar/app_menu_icon_controller.cc
+++ b/chrome/browser/ui/toolbar/app_menu_icon_controller.cc
@@ -8,11 +8,15 @@
#include "build/build_config.h"
#include "chrome/app/vector_icons/vector_icons.h"
#include "chrome/browser/defaults.h"
+#include "chrome/browser/profiles/profile.h"
#include "chrome/browser/ui/global_error/global_error.h"
#include "chrome/browser/ui/global_error/global_error_service_factory.h"
#include "chrome/browser/ui/ui_features.h"
#include "chrome/browser/upgrade_detector/upgrade_detector.h"
#include "chrome/common/channel_info.h"
+#include "components/helium_services/pref_names.h"
+#include "components/helium_services/schema.h"
+#include "components/prefs/pref_change_registrar.h"
#include "components/version_info/channel.h"
#include "ui/gfx/paint_vector_icon.h"
@@ -109,6 +113,14 @@ AppMenuIconController::AppMenuIconContro
GlobalErrorServiceFactory::GetForProfile(profile_));
upgrade_detector_->AddObserver(this);
+
+ if (auto* prefs = profile->GetPrefs()) {
+ registrar_.Init(prefs);
+ registrar_.Add(
+ prefs::kHeliumSchemaVersion,
+ base::BindRepeating(&AppMenuIconController::OnGlobalErrorsChanged,
+ base::Unretained(this)));
+ }
}
AppMenuIconController::~AppMenuIconController() {
@@ -141,6 +153,12 @@ AppMenuIconController::GetTypeAndSeverit
->GetHighestSeverityGlobalErrorWithAppMenuItem()) {
return {IconType::kGlobalError, SeverityFromError(error)};
}
+
+ if (auto* prefs = profile_->GetPrefs()) {
+ if (helium::ShouldShowSchemaNotification(*prefs)) {
+ return {IconType::kHeliumServicesUpdate, Severity::kLow};
+ }
+ }
#endif
return {IconType::kNone, Severity::kNone};
--- a/chrome/browser/ui/toolbar/app_menu_icon_controller.h
+++ b/chrome/browser/ui/toolbar/app_menu_icon_controller.h
@@ -15,6 +15,7 @@
#include "chrome/browser/ui/global_error/global_error_observer.h"
#include "chrome/browser/ui/global_error/global_error_service.h"
#include "chrome/browser/upgrade_detector/upgrade_observer.h"
+#include "components/prefs/pref_change_registrar.h"
#include "third_party/skia/include/core/SkColor.h"
#include "ui/base/models/image_model.h"
@@ -29,6 +30,7 @@ class AppMenuIconController : public Glo
enum class IconType {
kNone,
kUpgradeNotification,
+ kHeliumServicesUpdate,
kGlobalError,
};
enum class Severity {
@@ -93,6 +95,7 @@ class AppMenuIconController : public Glo
const raw_ptr<Delegate> delegate_;
base::ScopedObservation<GlobalErrorService, GlobalErrorObserver>
global_error_observation_{this};
+ PrefChangeRegistrar registrar_;
};
#endif // CHROME_BROWSER_UI_TOOLBAR_APP_MENU_ICON_CONTROLLER_H_
--- a/chrome/browser/ui/views/toolbar/browser_app_menu_button.cc
+++ b/chrome/browser/ui/views/toolbar/browser_app_menu_button.cc
@@ -214,6 +214,11 @@ void BrowserAppMenuButton::UpdateTextAnd
#else
text = l10n_util::GetStringUTF16(IDS_APP_MENU_BUTTON_UPDATE);
#endif
+ } else if (type_and_severity_.type ==
+ AppMenuIconController::IconType::kHeliumServicesUpdate) {
+ tooltip_message_id = IDS_APPMENU_TOOLTIP_HELIUM_SERVICES_UPDATE;
+ text =
+ l10n_util::GetStringUTF16(IDS_APP_MENU_BUTTON_HELIUM_SERVICES_UPDATE);
} else {
tooltip_message_id = IDS_APPMENU_TOOLTIP_ALERT;
const int text_id =
+74 -163
View File
@@ -1,61 +1,3 @@
--- a/chrome/browser/ui/ui_features.cc
+++ b/chrome/browser/ui/ui_features.cc
@@ -107,14 +107,14 @@ BASE_FEATURE(kReloadSelectionModel, base
// Enforces close tab hotkey to only close the active view of a split tab,
// when it is the only tab in selection model.
BASE_FEATURE(kCloseActiveTabInSplitViewViaHotkey,
- base::FEATURE_DISABLED_BY_DEFAULT);
+ base::FEATURE_ENABLED_BY_DEFAULT);
#if BUILDFLAG(IS_MAC)
// Add tab group colours when viewing tab groups using the top mac OS menu bar.
BASE_FEATURE(kShowTabGroupsMacSystemMenu, base::FEATURE_DISABLED_BY_DEFAULT);
#endif // BUILDFLAG(IS_MAC)
-BASE_FEATURE(kSideBySide, base::FEATURE_DISABLED_BY_DEFAULT);
+BASE_FEATURE(kSideBySide, base::FEATURE_ENABLED_BY_DEFAULT);
// The delay before showing the drop target for the side-by-side drag-and-drop
// entrypoint.
@@ -132,17 +132,17 @@ BASE_FEATURE_PARAM(int,
kSideBySideDropTargetMinWidth,
&kSideBySide,
"drop_target_min_width",
- 120);
+ 50);
BASE_FEATURE_PARAM(int,
kSideBySideDropTargetMaxWidth,
&kSideBySide,
"drop_target_max_width",
- 360);
+ 200);
BASE_FEATURE_PARAM(int,
kSideBySideDropTargetTargetWidthPercentage,
&kSideBySide,
"drop_target_width_percentage",
- 30);
+ 10);
BASE_FEATURE_PARAM(int,
kSideBySideDropTargetHideForOSWidth,
&kSideBySide,
@@ -243,7 +243,7 @@ BASE_FEATURE_PARAM(int,
// When enabled along with SideBySide flag, split tabs will be restored on
// startup.
-BASE_FEATURE(kSideBySideSessionRestore, base::FEATURE_DISABLED_BY_DEFAULT);
+BASE_FEATURE(kSideBySideSessionRestore, base::FEATURE_ENABLED_BY_DEFAULT);
bool IsRestoringSplitViewEnabled() {
return base::FeatureList::IsEnabled(features::kSideBySide) &&
@@ -252,7 +252,7 @@ bool IsRestoringSplitViewEnabled() {
BASE_FEATURE(kSideBySideLinkMenuNewBadge, base::FEATURE_DISABLED_BY_DEFAULT);
-BASE_FEATURE(kSideBySideKeyboardShortcut, base::FEATURE_DISABLED_BY_DEFAULT);
+BASE_FEATURE(kSideBySideKeyboardShortcut, base::FEATURE_ENABLED_BY_DEFAULT);
bool IsSideBySideKeyboardShortcutEnabled() {
return base::FeatureList::IsEnabled(features::kSideBySide) &&
--- a/chrome/browser/ui/views/frame/multi_contents_resize_area.cc
+++ b/chrome/browser/ui/views/frame/multi_contents_resize_area.cc
@@ -24,8 +24,8 @@
@@ -79,16 +21,16 @@
namespace content {
class WebContents;
@@ -56,7 +55,7 @@ class MultiContentsView : public views::
@@ -56,8 +55,6 @@ class MultiContentsView : public views::
double end_width = 0;
};
- static constexpr int kSplitViewContentInset = 8;
+ static constexpr int kSplitViewContentInset = 0;
-
MultiContentsView(BrowserView* browser_view,
std::unique_ptr<MultiContentsViewDelegate> delegate);
@@ -168,10 +167,6 @@ class MultiContentsView : public views::
MultiContentsView(const MultiContentsView&) = delete;
@@ -159,10 +156,6 @@ class MultiContentsView : public views::
return contents_container_views_[1]->contents_view();
}
@@ -99,7 +41,7 @@
MultiContentsBackgroundView* background_view_for_testing() const {
return background_view_;
}
@@ -280,10 +275,6 @@ class MultiContentsView : public views::
@@ -277,10 +270,6 @@ class MultiContentsView : public views::
// Nullopt if not currently resizing.
std::optional<double> initial_start_width_on_resize_;
@@ -131,7 +73,7 @@
#include "chrome/browser/ui/views/frame/scrim_view.h"
#include "chrome/browser/ui/views/frame/top_container_background.h"
#include "chrome/browser/ui/views/new_tab_footer/footer_web_view.h"
@@ -57,11 +56,7 @@ MultiContentsView::MultiContentsView(
@@ -63,11 +62,7 @@ MultiContentsView::MultiContentsView(
BrowserView* browser_view,
std::unique_ptr<MultiContentsViewDelegate> delegate)
: browser_view_(browser_view),
@@ -144,7 +86,7 @@
SetLayoutManager(std::make_unique<views::DelegatingLayoutManager>(this));
SetProperty(views::kElementIdentifierKey, kMultiContentsViewElementId);
@@ -360,11 +355,8 @@ void MultiContentsView::OnResize(int res
@@ -329,11 +324,8 @@ void MultiContentsView::OnResize(int res
std::make_optional(contents_container_views_[0]->size().width());
}
double total_width = contents_container_views_[0]->size().width() +
@@ -157,7 +99,7 @@
static_cast<double>(resize_amount));
// If end_width is within the snap point widths, update to the snap point.
@@ -473,11 +465,6 @@ views::ProposedLayout MultiContentsView:
@@ -441,11 +433,6 @@ views::ProposedLayout MultiContentsView:
gfx::Rect end_rect(resize_rect.top_right(),
gfx::Size(widths.end_width, available_space.height()));
@@ -169,7 +111,7 @@
layouts.child_layouts.emplace_back(contents_container_views_[0],
contents_container_views_[0]->GetVisible(),
start_rect);
@@ -612,8 +599,10 @@ MultiContentsView::ViewWidths MultiConte
@@ -580,8 +567,10 @@ MultiContentsView::ViewWidths MultiConte
widths.resize_width = resize_area_->GetPreferredSize().width();
widths.start_width =
start_ratio_ * (available_space.width() - widths.resize_width);
@@ -181,7 +123,7 @@
} else {
CHECK(!contents_container_views_[1]->GetVisible());
widths.start_width = available_space.width();
@@ -686,10 +675,6 @@ void MultiContentsView::SetShouldShowTop
@@ -675,10 +664,6 @@ void MultiContentsView::SetShouldShowTop
return;
}
contents_separators_.should_show_top = should_show;
@@ -190,29 +132,29 @@
- end_contents_view_inset_.set_top(
- should_show ? 0 : MultiContentsView::kSplitViewContentInset);
InvalidateLayout();
}
@@ -699,8 +684,6 @@ void MultiContentsView::SetShouldShowLea
// This can be called during BrowserView layout, so protect against creating a
// layout loop.
@@ -690,8 +675,6 @@ void MultiContentsView::SetShouldShowLea
return;
}
contents_separators_.should_show_leading = should_show;
- start_contents_view_inset_.set_left(
- should_show ? 0 : MultiContentsView::kSplitViewContentInset);
InvalidateLayout();
}
@@ -710,8 +693,6 @@ void MultiContentsView::SetShouldShowTra
// This can be called during BrowserView layout, so protect against creating a
// layout loop.
@@ -703,8 +686,6 @@ void MultiContentsView::SetShouldShowTra
return;
}
contents_separators_.should_show_trailing = should_show;
- end_contents_view_inset_.set_right(
- should_show ? 0 : MultiContentsView::kSplitViewContentInset);
InvalidateLayout();
}
// This can be called during BrowserView layout, so protect against creating a
// layout loop.
--- a/chrome/browser/ui/views/frame/contents_container_view.cc
+++ b/chrome/browser/ui/views/frame/contents_container_view.cc
@@ -20,7 +20,6 @@
@@ -21,7 +21,6 @@
#include "chrome/browser/ui/views/frame/contents_container_outline.h"
#include "chrome/browser/ui/views/frame/contents_separator.h"
#include "chrome/browser/ui/views/frame/contents_web_view.h"
@@ -220,7 +162,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"
@@ -51,10 +50,6 @@
@@ -55,10 +54,6 @@
#endif
namespace {
@@ -231,22 +173,20 @@
constexpr int kNewTabFooterSeparatorHeight = 1;
constexpr int kNewTabFooterHeight = 56;
} // namespace
@@ -122,14 +117,6 @@ ContentsContainerView::ContentsContainer
@@ -134,12 +129,6 @@ ContentsContainerView::ContentsContainer
}
#endif
- if (base::FeatureList::IsEnabled(features::kSideBySide)) {
- mini_toolbar_ = AddChildView(std::make_unique<MultiContentsViewMiniToolbar>(
- browser_view, contents_view_));
- mini_toolbar_ = AddChildView(std::make_unique<MultiContentsViewMiniToolbar>(
- browser_view, contents_view_));
-
- container_outline_ =
- AddChildView(std::make_unique<ContentsContainerOutline>(mini_toolbar_));
- }
- container_outline_ =
- AddChildView(std::make_unique<ContentsContainerOutline>(mini_toolbar_));
-
view_bounds_observer_.Observe(contents_view_);
}
@@ -152,110 +139,11 @@ std::vector<views::View*> ContentsContai
@@ -162,130 +151,11 @@ std::vector<views::View*> ContentsContai
void ContentsContainerView::UpdateBorderAndOverlay(bool is_in_split,
bool is_active,
bool is_highlighted) {
@@ -259,6 +199,11 @@
- ClearBorderRoundedCorners();
- mini_toolbar_->SetVisible(false);
- container_outline_->SetVisible(false);
- if (capture_contents_border_widget_) {
- static_cast<ContentsCaptureBorderView*>(
- capture_contents_border_widget_->GetContentsView())
- ->SetIsInSplit(false);
- }
- return;
- }
-
@@ -270,6 +215,11 @@
- // 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())
- ->SetIsInSplit(true);
- }
-}
-
-void ContentsContainerView::UpdateBorderRoundedCorners() {
@@ -320,6 +270,12 @@
- content_lower_rounded_corners);
- }
-
- if (actor_overlay_web_view_) {
- // ActorOverlayWebView should use the same radii as the contents view since
- // it acts as a full transparent layer directly over the main web content.
- actor_overlay_web_view_->holder()->SetCornerRadii(radii);
- }
-
-#if BUILDFLAG(ENABLE_GLIC)
- if (glic_border_) {
- glic_border_->SetRoundedCorners(content_rounded_corners);
@@ -342,6 +298,10 @@
-
- contents_scrim_view_->SetRoundedCorners(kNoRoundedCorners);
-
- if (actor_overlay_web_view_) {
- actor_overlay_web_view_->holder()->SetCornerRadii(kNoRoundedCorners);
- }
-
-#if BUILDFLAG(ENABLE_GLIC)
- if (glic_border_) {
- glic_border_->SetRoundedCorners(kNoRoundedCorners);
@@ -359,7 +319,7 @@
}
void ContentsContainerView::Layout(PassKey pass_key) {
@@ -269,9 +157,6 @@ void ContentsContainerView::Layout(PassK
@@ -299,9 +169,6 @@ void ContentsContainerView::Layout(PassK
void ContentsContainerView::OnViewBoundsChanged(View* observed_view) {
if (observed_view == contents_view_) {
UpdateDevToolsDockedPlacement();
@@ -369,7 +329,16 @@
}
}
@@ -523,30 +408,6 @@ views::ProposedLayout ContentsContainerV
@@ -414,7 +281,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);
@@ -568,30 +435,6 @@ views::ProposedLayout ContentsContainerV
non_devtools_contents_bounds, size_bounds);
}
@@ -410,7 +379,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_; }
@@ -91,9 +90,6 @@ class ContentsContainerView : public vie
@@ -94,9 +93,6 @@ class ContentsContainerView : public vie
enterprise_watermark::WatermarkView* watermark_view() {
return watermark_view_;
}
@@ -420,7 +389,7 @@
TabModalDialogHost* web_contents_modal_dialog_host() {
return &web_contents_modal_dialog_host_;
}
@@ -131,9 +127,6 @@ class ContentsContainerView : public vie
@@ -134,9 +130,6 @@ class ContentsContainerView : public vie
// container that holds both contents_webview and devtools_webview.
void UpdateDevToolsDockedPlacement();
@@ -430,9 +399,9 @@
// views::View:
void ChildVisibilityChanged(View* child) override;
void Layout(PassKey) override;
@@ -180,10 +173,6 @@ class ContentsContainerView : public vie
@@ -187,10 +180,6 @@ class ContentsContainerView : public vie
// The glic browser view that renders around the web contents area.
raw_ptr<glic::GlicBorderView> glic_border_ = nullptr;
raw_ptr<glic::ContextSharingBorderView> glic_border_ = nullptr;
- raw_ptr<MultiContentsViewMiniToolbar> mini_toolbar_ = nullptr;
-
@@ -457,7 +426,7 @@
} // namespace
@@ -61,19 +59,12 @@ MultiContentsDropTargetView::MultiConten
@@ -61,17 +59,12 @@ MultiContentsDropTargetView::MultiConten
->SetOrientation(views::LayoutOrientation::kVertical)
.SetMainAxisAlignment(views::LayoutAlignment::kCenter)
.SetCrossAxisAlignment(views::LayoutAlignment::kCenter)
@@ -468,16 +437,14 @@
views::MaximumFlexSizeRule::kUnbounded));
auto inner_container = std::make_unique<views::View>();
- inner_container->SetPaintToLayer(ui::LAYER_SOLID_COLOR);
- inner_container->layer()->SetName(
- inner_container->SetBackground(views::CreateLayerBasedRoundedBackground(
- ui::kColorSysSurface3, gfx::RoundedCornersF(kInnerCornerRadius)));
- inner_container->background()->SetInternalName(
- "MultiContentsDropTargetView/InnerContainer");
- inner_container->layer()->SetRoundedCornerRadius(
- gfx::RoundedCornersF(kInnerCornerRadius));
- inner_container->layer()->SetIsFastRoundedCorner(true);
inner_container_layout_ =
&inner_container->SetLayoutManager(std::make_unique<views::FlexLayout>())
@@ -92,13 +83,13 @@ MultiContentsDropTargetView::MultiConten
@@ -90,13 +83,13 @@ MultiContentsDropTargetView::MultiConten
icon_view_->SetPaintToLayer(ui::LAYER_TEXTURED);
icon_view_->layer()->SetFillsBoundsOpaquely(false);
icon_view_->SetImage(ui::ImageModel::FromVectorIcon(
@@ -493,65 +460,24 @@
label_->SetElideBehavior(gfx::NO_ELIDE);
label_->SetSubpixelRenderingEnabled(false);
@@ -279,8 +270,6 @@ void MultiContentsDropTargetView::Disabl
void MultiContentsDropTargetView::OnThemeChanged() {
views::View::OnThemeChanged();
- inner_container_->layer()->SetColor(
- GetColorProvider()->GetColor(ui::kColorSysSurface3));
}
bool MultiContentsDropTargetView::GetDropFormats(
--- a/chrome/browser/ui/views/frame/browser_view_layout.cc
+++ b/chrome/browser/ui/views/frame/browser_view_layout.cc
@@ -874,27 +874,6 @@ void BrowserViewLayout::LayoutContentsCo
!layout_result.side_panel_right_aligned);
left_aligned_side_panel_separator_->SetBoundsRect(
layout_result.separator_bounds);
-
- SetViewVisibility(side_panel_rounded_corner_,
- layout_result.side_panel_visible);
- if (layout_result.side_panel_visible) {
- // Adjust the rounded corner bounds based on the side panel bounds.
- const int corner_size =
- side_panel_rounded_corner_->GetPreferredSize().width();
-
- const int top_separator_height = views::Separator::kThickness;
- if (layout_result.contents_container_after_side_panel) {
- side_panel_rounded_corner_->SetBounds(
- layout_result.side_panel_bounds.right(),
- layout_result.side_panel_bounds.y() - top_separator_height,
- corner_size, corner_size);
- } else {
- side_panel_rounded_corner_->SetBounds(
- layout_result.side_panel_bounds.x() - corner_size,
- layout_result.side_panel_bounds.y() - top_separator_height,
- corner_size, corner_size);
- }
- }
}
}
--- a/chrome/browser/ui/views/frame/browser_view.cc
+++ b/chrome/browser/ui/views/frame/browser_view.cc
@@ -136,7 +136,6 @@
@@ -148,7 +148,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"
-#include "chrome/browser/ui/views/frame/multi_contents_view_mini_toolbar.h"
#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"
#include "chrome/browser/ui/views/frame/tab_strip_region_view.h"
@@ -2209,12 +2208,6 @@ void BrowserView::UpdateToolbar(content:
@@ -2345,10 +2344,6 @@ void BrowserView::UpdateToolbar(content:
if (toolbar_) {
toolbar_->Update(contents);
}
- if (multi_contents_view_) {
- for (ContentsContainerView* contents_container :
- multi_contents_view_->contents_container_views()) {
- contents_container->mini_toolbar()->UpdateContents();
- }
- }
}
bool BrowserView::UpdateToolbarSecurityState() {
@@ -565,7 +491,7 @@
#include "chrome/browser/profiles/profile.h"
#include "chrome/browser/ui/browser.h"
#include "chrome/browser/ui/browser_list.h"
@@ -125,16 +124,6 @@ SplitTabMenuModel::SplitTabMenuModel(Tab
@@ -130,16 +129,6 @@ SplitTabMenuModel::SplitTabMenuModel(Tab
SetElementIdentifierAt(
GetIndexOfCommandId(GetCommandIdInt(CommandId::kExitSplit)).value(),
kExitSplitMenuItem);
@@ -582,7 +508,7 @@
}
SplitTabMenuModel::~SplitTabMenuModel() = default;
@@ -216,9 +205,6 @@ void SplitTabMenuModel::ExecuteCommand(i
@@ -221,9 +210,6 @@ void SplitTabMenuModel::ExecuteCommand(i
case CommandId::kExitSplit:
tab_strip_model_->RemoveSplit(split_id);
break;
@@ -592,13 +518,14 @@
}
base::UmaHistogramEnumeration(
@@ -260,10 +246,3 @@ void SplitTabMenuModel::CloseTabAtIndex(
@@ -265,11 +251,3 @@ void SplitTabMenuModel::CloseTabAtIndex(
index, TabCloseTypes::CLOSE_USER_GESTURE |
TabCloseTypes::CLOSE_CREATE_HISTORICAL_TAB);
}
-
-void SplitTabMenuModel::SendFeedback() {
- Browser* const browser = GetBrowserWithTabStripModel(tab_strip_model_);
- BrowserWindowInterface* const browser =
- GetBrowserWithTabStripModel(tab_strip_model_);
- CHECK(browser);
- chrome::ShowFeedbackPage(browser, feedback::kFeedbackSourceSplitView, "", "",
- "split_view", "");
@@ -623,19 +550,3 @@
raw_ptr<TabStripModel> tab_strip_model_ = nullptr;
--- a/chrome/browser/ui/browser_commands.cc
+++ b/chrome/browser/ui/browser_commands.cc
@@ -499,8 +499,12 @@ void ReloadInternal(BrowserWindowInterfa
WebContents* const active_contents = tab_strip_model->GetActiveWebContents();
std::vector<WebContents*> tabs_to_reload;
+ const bool only_active_split_tab_selected =
+ browser->GetTabStripModel()->IsActiveTabSplit() &&
+ browser->GetTabStripModel()->selection_model().size() == 2;
- if (base::FeatureList::IsEnabled(features::kReloadSelectionModel)) {
+ if (base::FeatureList::IsEnabled(features::kReloadSelectionModel) ||
+ only_active_split_tab_selected) {
tabs_to_reload.push_back(active_contents);
} else {
// Reloading a tab may change the selection (see crbug.com/339061099), so

Some files were not shown because too many files have changed in this diff Show More