This change adds a new WebGPU web-compat content settings type. This would allow showing a brand new "Webgpu" toggle inside the Brave shields > "Block fingerprinting" secondary UI.
This change also connects the current webgpu scrubbing to this new content setting type which was webgl before. This allows the users to turn on/off the fingerprinting protections selectively on WebGPU APIs w/o changing WebGL.
Resolves: https://github.com/brave/brave-browser/issues/55927
* update
Adds a privacy setting for controlling how long browsing history is kept, including options to disable history saving or keep history indefinitely. Updates the history expiration backend when the setting changes and shows a notice on the history page when saving is disabled.
Co-authored-by: InjectorExe <68108452+InjectorExe@users.noreply.github.com>
Chromium change:
https://source.chromium.org/chromium/chromium/src/+/9d9fbd3410b1f7fde453b6396fa5b16bd4db598d
commit 9d9fbd3410b1f7fde453b6396fa5b16bd4db598d
Author: Mike Wittman <wittman@chromium.org>
Date: Thu Apr 30 09:10:10 2026 -0700
[embeddings] Enforce embeddings normalization
Embeddings are guaranteed to be normalized in production. This
change documents that guarantee, removes the unnecessary Normalize()
and Magnitude() member functions, and updates Embeddings in tests to
be consistently normalized.
Bug: 499323089
Chromium change:
https://chromium.googlesource.com/chromium/src.git/+/009e12b95d04c
commit 009e12b95d04c14133718b7519809c59370fc1d2
Author: Mike Wittman <wittman@chromium.org>
Date: Thu Apr 23 10:54:06 2026 -0700
[embeddings] Simplify test embedding vector specification
Many of the tests that make use of Embedding specify vectors
of size 768, even though the code under test does not depend on
that size. This change reduces the sizes to 3 and uses literal
initializers where feasible to avoid unnecessary size assumptions
and reduce complexity in the tests.
Bug: 499323089
The new type is THEMES_ANDROID.
https://chromium.googlesource.com/chromium/src.git/+/0c6882b3
commit 0c6882b3eb6e3c2573c9276999817d8a3e8c6f56
Author: Xinyi Ji <xinyiji@google.com>
Date: Fri Apr 24 06:26:48 2026 -0700
[NTP Customization Sync] Add scaffold for THEMES_ANDROID data type
This CL adds the initial scaffolding for the THEMES_ANDROID data type.
- DataType enumeration entry.
- TODOs for mapping to selectable types.
- Histogram entries.
Bug: 488439751
build step: cxx "./obj/components/permissions/permissions/speaker_selection_permission_context.obj"
siso_rule: clang-cl/cxx
stderr:
In file included from ../../components/permissions/contexts/speaker_selection_permission_context.cc:5:
In file included from ../../components/permissions/contexts/speaker_selection_permission_context.h:8:
In file included from ../../components/permissions/content_setting_permission_context_base.h:8:
In file included from ../../brave/chromium_src/components/permissions/permission_context_base.h:9:
../../components/permissions/permission_context_base.h(293,31): error: no class named 'PermissionContextBase' in namespace 'permissions'
293 | friend class ::permissions::PermissionContextBase;
| ~~~~~~~~~~~~~~~^
1 error generated.
Chromium changes:
https://chromium.googlesource.com/chromium/src/+/d78abe4e930bc802ef45f8a9a1c5ca2919e6b4bd
commit d78abe4e930bc802ef45f8a9a1c5ca2919e6b4bd
Author: Victor Hugo Vianna Silva <victorvianna@google.com>
Date: Mon Apr 20 05:59:44 2026 -0700
[sync/android] Remove isInitialSyncFeatureSetupComplete()
Along with the corresponding setter and UserActionableError::
{kNeedsSettingsConfirmation,kUnrecoverableError}, which are unreachable
in production code.
OBSOLETE_HISTOGRAMS=Sync setup incomplete and unrecoverable error states were removed on Android, along with their histograms.
NO_IFTTT=UserActionableError values are not obsoleted on all platforms.
Bug: 40066949
Change-Id: I903ee43392dfe960e359404338d7d3f07873f784
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/7772435
Reviewed-by: Marc Treib <treib@chromium.org>
Commit-Queue: Victor Vianna <victorvianna@google.com>
Cr-Commit-Position: refs/heads/main@{#1617442}
This change reruns the plasters, and adds an update to the call for the
constructor of `DeviceInfo` to pass the newly added argument.
Chromium changes:
https://chromium.googlesource.com/chromium/src/+/390ff11a3d7dee78459be3ad5a0f7ca614700bd7
commit 390ff11a3d7dee78459be3ad5a0f7ca614700bd7
Author: Theodore Olsauskas-Warren <sauski@google.com>
Date: Fri Apr 24 12:04:14 2026 -0700
[GLIC] Include experimental_triggering opt-in state in DeviceInfo
A new function which represents the combination of GLIC FRE +
Actuation + Experimental actuation is added to GlicEnabling, and
the value is included in the DeviceInfo FeatureSpecificFields.
Many test call sites which construct a DeviceInfo object are updated,
and given we are updating these sites anyway, the singular default
value for MobilePromoOnDesktopPromoTypeSet in the DeviceInfo
constructor is removed and call sites updated.
Bug: b:505510293
Change-Id: I3943e1eddf83ae6d431cc62b8446876c1bd35105
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/7783606
Reviewed-by: Mikel Astiz <mastiz@chromium.org>
Reviewed-by: James Cook <jamescook@chromium.org>
Reviewed-by: Rohit Rao <rohitrao@chromium.org>
Commit-Queue: Theodore Olsauskas-Warren <sauski@google.com>
Reviewed-by: Tommy Nyquist <nyquist@chromium.org>
Cr-Commit-Position: refs/heads/main@{#1620378}
Otherwise there is an error:
../../brave/chromium_src/components/password_manager/core/browser/password_store_factory_util.cc:18:5: error: unknown type name 'PrefService'
18 | PrefService* prefs) {
Chromium changes:
https://chromium.googlesource.com/chromium/src/+/37a52a3a3a7babdf79058424bae296faa5b4a61e
commit 37a52a3a3a7babdf79058424bae296faa5b4a61e
Author: Victor Hugo Vianna Silva <victorvianna@google.com>
Date: Wed Sep 3 11:17:38 2025 -0700
Unify Create{Profile,Account}PasswordStoreBackend() into 1 function
After recent changes, they are almost the same and can share code.
Also:
- IWYU.
- Emit a TRACE_EVENT for the creation of the account store backend,
not just the profile one.
- Remove IsAccountStore parameter from PasswordStoreAndroidBackend,
it was always IsAccountStore(true)
- Changes in the store factories:
* Reduce vertical space, some of these functions look a lot bigger
than they need to be.
* "ProfilePasswordStore", not "PasswordStore".
* Consistently add DependsOn() for the affiliation service factory.
I think in practice this isn't needed today because the
AffiliatedMatchHelper is destroyed on Shutdown() [1], ahead of the
destructor. But that could easily change. The new code is also
more consistent (before the change, some factories listed the
dependency and others didn't).
[1] https://source.chromium.org/chromium/chromium/src/+/main:components/password_manager/core/browser/password_store/password_store.cc;l=430;drc=391e98eeaee80326c3a9d9e9dd731570dba0981a
Bug: None
Change-Id: Iabccc1284135d8de0e80898da80f0e145cd3a1c5
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/6909469
Commit-Queue: Victor Vianna <victorvianna@google.com>
Reviewed-by: Ioana Pandele <ioanap@chromium.org>
Cr-Commit-Position: refs/heads/main@{#1510417}
This change corrects several places to pass `TranslateUrlFetcher` into
`TranslateLanguageList`.
Chromium changes:
https://chromium.googlesource.com/chromium/src/+/6aef37c345ee6449713a213c04878417dd87d0c4
commit 6aef37c345ee6449713a213c04878417dd87d0c4
Author: Danilo Françoso Tedeschi <danft@google.com>
Date: Wed Apr 8 06:26:11 2026 -0700
Replace static DisableUpdate with dependency injection for TranslateLanguageList.
This change removes the global static flag `update_is_disabled` from TranslateLanguageList and instead allows injecting a TranslateUrlFetcher instance. This improves testability by allowing mock fetchers to be used without relying on global state. TranslateDownloadManager now has a setter for its TranslateLanguageList.
Change-Id: I739659aba52e95e6236e0b5d85fd9672b090c864
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/7719220
Reviewed-by: Basia Zimirska <basiaz@google.com>
Commit-Queue: Danilo Françoso Tedeschi <danft@google.com>
Cr-Commit-Position: refs/heads/main@{#1611437}
This PR moves to `chromium_src` code that can live in there, and does
with no need for `#define` macro uses. This keeps plaster files shorter,
which reduces the noise in them, and it also permits C++ code to live
in C++ sources, that can benefit from code formatting, and DEPS
validation.
The use of `bool` for `DeviceInfo` fields has led to bugs in the past.
This has been correct with plaster, however we should also convert the
field to an enum to make sure we follow the upstream practice of using
enums in this type.
Resolves https://github.com/brave/brave-browser/issues/55018
Preparation to BraveConfirmInfoBar refactor
Deleted unused code to make refactoring more easier.
No production delegate ever used BUTTON_EXTRA.
Remove it together with the GetButtons override, GetButtonsOrder, IsProminent, and
ExtraButtonPressed virtuals that only existed to support it.
Delete the chromium_src patch that injected BUTTON_EXTRA into upstream's enum.
Cleaned up dead code from confirm_infobar.h overriding
Resolves - subtask of brave/brave-browser#48822
First step of the BraveConfirmInfoBar refactor.
Before refactoring BraveConfirmInfoBar, removed unused BraveConfirmInfoBar subclass.
Dev channel deprecation infobar: not used anymore. Remove.
Resolves - subtask of brave/brave-browser#48822
* [Android][Sync] Fix for regression after OSCrypt migration
This commit fixes situation when the Sync seed is wiped
right after Android app restart
Resolves https://github.com/brave/brave-browser/issues/55359
The upstream Chromium test BrowserContextDestructionVsCookieRemoval
flakes because document.cookie (set via JavaScript in the renderer)
uses a different Mojo pipe than GetAllCookies (queried from the browser
via CookieManager), with no ordering guarantee between the two.
Brave amplifies this from the upstream ~0.6 % rate because Ephemeral
Storage forces every cookie operation through IPC (disabling Chromium's
cookie cache optimization in CookieJar::IPCNeeded).
Add a chromium_src override for browsing_data_test_util.cc that calls
HasDataForType after SetDataForType. For cookies this forces a
round-trip through RestrictedCookieManager → CookieStore, serialising
with the prior SetCanonicalCookieAsync on the same CookieMonster task
runner and guaranteeing the cookie is committed before any subsequent
GetAllCookies query.
The BrowserContextDestructionVsCookieRemoval test has a separate issue:
BlockUntilCompletion() never returns after the incognito profile is
destroyed during data removal. CookieIncognitoDeletion also hangs in
incognito mode. Both remain disabled in the filter file.
Resolvesbrave/brave-browser#54537
* [BraveSync] Migrate from os_crypt/sync to async
Starting from cr149 components/os_crypt/sync will be
removed completely in a favor of components/os_crypt/async.
Resolves https://github.com/brave/brave-browser/issues/55192
This PR rewrites our overrides relating to `DeviceInfo` specifically
into plaster. This involves dropping `BraveDeviceInfo` and implementing
the functionality in terms of extending `DeviceInfo`
Resolves https://github.com/brave/brave-browser/issues/55018
Disable `IsCardBenefitsFeatureEnabled` as we don't want this feature
We were disabling card benefits by disabling the individual card features, but
new ones are added periodically. I also just noticed that the feature flags and
function are going away in cr149. Given that, let's just hide the toggle in
settings.
`UpdateMatchDestinationURLWithInvocationSource` now appends source=chrome.ob to
all omnibox search URLs via `AppendOrReplaceQueryParameter`. This is
Chrome-specific attribution telemetry intended for Google's servers, but it also
overwrites any existing source parameter - including the `source=desktop` /
`source=android` value we bake into the Brave Search URL template in
brave_prepopulated_engines.cc.
This fix suppresses the injection by overriding the upstream injection function
to do nothing.
Chromium changes:
https://source.chromium.org/chromium/chromium/src/+/170478de25798c69727e9e3fa31be2dc8ac8ca1d
commit 170478de25798c69727e9e3fa31be2dc8ac8ca1d
Author: Nihar Majmudar <niharm@google.com>
Date: Thu Apr 9 09:45:19 2026 -0700
[omnibox] Add source param for omnibox and realbox navigations.
Adds chrome.ob and chrome.rb source params to search queries from the
realbox and omnibox.
Change-Id: I3c833294ef6f0be891265d615815f46e1bd530fc
Bug: 497828304
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/7710442
Reviewed-by: Emilia Paz <emiliapaz@chromium.org>
Commit-Queue: Nihar Majmudar <niharm@google.com>
Reviewed-by: Moe Ahmadi <mahmadi@chromium.org>
Cr-Commit-Position: refs/heads/main@{#1612307}
Resolves - simple cleanup issue.
We can set disable kIPHSideBySidePinnableFeature/kIPHSideBySideTabSwitchFeature as default state.
Don't need to suppress them in rumtime. All deleted and add state overriding to
chromium_src/components/feature_engagement/public/feature_constants.cc
It was added by #32937
[plaster] `PermissionContextBase` migration
The introduction of plasters for `PermissionContextBase` gets rid of a
lot of replacement cruft that was really difficult to make sense of.
This change also tweaks the interface for
`BraveCanBypassEmbeddingOriginCheck`, so it can make the plaster simpler
for this substitution too.
The core of this change is to move `PermissionContextBase` in upstream
into `chromium_impl::`, and derive our own implementatiom from that,
which simplifies a lot of the issues with naming replacement everywhere.
Resolves https://github.com/brave/brave-browser/issues/54952
This PR migrates all macros in `components/permissions/request_type.cc`
to plaster. The use of macros here particularly hid the fact that we
failed to override the correct functions, in particular the way we were
treating brave keys for `RequestTypeToContentSettingsType` and
`IsRequestablePermissionType` was incorrect as both these functions are
callers of `ContentSettingsTypeToRequestTypeIfExists`, and this fucntion
has been slipping through all this time.
Resolves https://github.com/brave/brave-browser/issues/54949
Chromium changes:
https://chromium.googlesource.com/chromium/src/+/a2ebdc2ea47eb842b1c0ddbb8a1d223e9ffd4d9b
commit a2ebdc2ea47eb842b1c0ddbb8a1d223e9ffd4d9b
Author: Ryan Sultanem <rsult@google.com>
Date: Fri Apr 3 03:23:54 2026 -0700
Migrating Session.TotalDurationMax1Day to per-profile tracking.
Update SyncSessionDurationsMetricsRecorder and
HistorySyncSessionDurationsMetricsRecorder to use ProfileMetricsService
for recording Session.TotalDurationMax1Day histograms with the
.Profile variant. This ensures metrics are correctly attribute to the
profile context.
Inject ProfileMetricsService through factories to recorders.
Extend MetricsService to support custom time histograms per profile.
Update histograms.xml to support {ProfileIndex} variants.
Update unit tests to verify both base and per-profile metrics.
Bug: 417921579
Change-Id: I300fb9671a557294339fd413ab7cd71425781860
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/7705052
Reviewed-by: Olivier Robin <olivierrobin@chromium.org>
Commit-Queue: Ryan Sultanem <rsult@google.com>
Reviewed-by: Marc Treib <treib@chromium.org>
Reviewed-by: Alexei Svitkine <asvitkine@chromium.org>
Cr-Commit-Position: refs/heads/main@{#1609736}
Recent upstream change to `ScopedObservation` default `RawPtrTraits` exposed a
latent dangling pointer in `CrxUpdateService` where callbacks used
`base::Unretained(this)`. Async install/update callbacks could outlive the
service during shutdown, triggering dangling pointer checks. Replace with
`WeakPtr` bindings to safely drop callbacks after destruction.
Chromium changes:
https://source.chromium.org/chromium/chromium/src/+/95eade2523f5c839c531717a7a0ff5eccbced8d2
commit 95eade2523f5c839c531717a7a0ff5eccbced8d2
Author: Sylvain Defresne <sdefresne@chromium.org>
Date: Thu Apr 2 09:20:00 2026 -0700
[base] Change default value of RawPtrTraits of ScopedObservation<...>
After all dangling ScopedObservation<...> have been identified, it is
possible to change the default value of RawPtrTraits to kEmpty (i.e.
not dangling).
Bug: 493572976
Change-Id: I18be9cd98e88d82a75c84a87cdd58440c71807b9
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/7720939
Reviewed-by: Daniel Cheng <dcheng@chromium.org>
Commit-Queue: Daniel Cheng <dcheng@chromium.org>
Auto-Submit: Sylvain Defresne <sdefresne@chromium.org>
Cr-Commit-Position: refs/heads/main@{#1609274}
This function's implementation has been moved from the header and into
the translation unit. This change moves the override to match that too.
Chromium changes:
https://chromium.googlesource.com/chromium/src/+/8ba91b3cd483e2a39ddc37d754e30877855bfeaf
commit 8ba91b3cd483e2a39ddc37d754e30877855bfeaf
Author: Mikel Astiz <mastiz@chromium.org>
Date: Tue Mar 31 12:54:12 2026 -0700
[sync] Centralize more datatype traits in a table
Refactoring without noticeable behavioral changes: the general idea is
that datatype-specific traits (most notably including product decisions)
should be centralized in a configuration-like table, instead of having
this information distributed throughout the codebase.
This is achieved by introducing a struct, including members that
leverage newly-introduced enums to make the information as readable as
possible.
Bug: None
Change-Id: I04a9352e7ab6ddf62ad150fef7cad2a7bd96d156
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/7707933
Reviewed-by: Rohit Rao <rohitrao@chromium.org>
Commit-Queue: Mikel Astiz <mastiz@chromium.org>
Reviewed-by: Maksim Moskvitin <mmoskvitin@google.com>
Cr-Commit-Position: refs/heads/main@{#1608038}
This function is merely stubbed to make it nullopt, and this change
corrects this signature to match the override.
Chromium changes:
https://chromium.googlesource.com/chromium/src/+/140daa67c68da98cc9c0d0501143fd8ee0b2e3ef
commit 140daa67c68da98cc9c0d0501143fd8ee0b2e3ef
Author: Florian Leimgruber <fleimgruber@google.com>
Date: Mon Mar 23 02:03:05 2026 -0700
Private passes: Require a ConsentAuditor::SessionId for saves
When the user accepts saving a new private pass from Chrome, Chrome
calls a Wallet API to create the pass. Before doing so, it will call
the API from crrev.com/c/7653495 to record the consent given. This
consent will be identified by a SessionId, which needs to be included in
the Wallet API request.
For updates, no consent logging is required, since the pass already
exists in Wallet.
This CL adapts the client-side API to require a session ID when saving
a new pass. Specifically:
- Adds an optional<SessionId> parameter to
WalletHttpClient::UpsertPrivatePass(pass).
This is the components/wallet API that distinguishes between saves and
updates based on the presence of a pass.id. A CHECK enforces that
either pass.id is set or the session ID is not nullopt.
- Adds logic to UpsertPrivatePassRequest::GetRequestContent() to
populate the session ID field of the request proto field, added in
crrev.com/c/7679158.
Tested through a new unit test.
- Adds a SessionId parameter to
WalletPassAccessManager::SaveWalletEntityInstance() and forwards it
to the internal WalletHttpClient::UpsertPrivatePass() call.
WalletPassAccessManager::UpdateWalletEntityInstance() remains
unchanged.
This is tested by adapting the expected parameters that the
MockWalletHttpClient receives in
wallet_pass_access_manager_impl_unittest.cc.
- Adapts the callers of
WalletPassAccessManager::SaveWalletEntityInstance() to pass a dummy
session ID. Leaves a TODO for a follow-up CL to actually log the
consent and pass the proper session ID.
- Adds ConsentAuditor::GenerateSessionId() and uses
ConsentAuditor::SessionId everywhere, rather than the underlying Uuid
functions. This communicates the purpose of the Uuid better.
This requires adding dependencies on consent_auditor in a few places.
Bug: 478783796, 489354073
Change-Id: I8c36f00f02e15133ae9ac28b58ca4a78fb0e3370
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/7680076
Commit-Queue: Florian Leimgruber <fleimgruber@google.com>
Reviewed-by: Marc Treib <treib@chromium.org>
Reviewed-by: Norge Vizcay <vizcay@google.com>
Cr-Commit-Position: refs/heads/main@{#1603317}
This class is not using prot-generated types in its interface anymore.
This means our own extended version of this class needs to be corrected,
and that callers of this contructor also need to be adjusted.
Chromium changes:
https://chromium.googlesource.com/chromium/src/+/165bf33e52b7a4b1744d405f2e430380f97be855
commit 165bf33e52b7a4b1744d405f2e430380f97be855
Author: Pengyuan Wang <pengyuanwang@microsoft.com>
Date: Tue Mar 24 02:59:58 2026 -0700
[Sync] Decouple syncer::DeviceInfo from sync protocol types
syncer::DeviceInfo currently exposes fields that use proto types
defined in components/sync/protocol (sync_pb). As a result, clients
that only need DeviceInfo must depend on the protocol layer.
Refactor DeviceInfo to use native C++ types instead. Proto conversions
are handled internally within the sync implementation, which keeps the
protocol dependency out of the public interface. This improves layering
and reduces unnecessary dependencies.
Bug: 364331851
Change-Id: I1289c5338e3490dc4c7f266e84194ad39db027e8
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/7665692
Reviewed-by: Mikel Astiz <mastiz@chromium.org>
Commit-Queue: Marc Treib <treib@chromium.org>
Reviewed-by: Marc Treib <treib@chromium.org>
Cr-Commit-Position: refs/heads/main@{#1603992}
Removed PREF_LOYALTY_CARDS from preferences.
Chromium change:
https://source.chromium.org/chromium/chromium/src/+/9d45f2f1f7f2f4e07a9ebf93be1873fd2bc34109
commit 9d45f2f1f7f2f4e07a9ebf93be1873fd2bc34109
Author: Norge Vizcay <vizcay@google.com>
Date: Fri Mar 13 07:52:52 2026 -0700
Remove kAutofillEnableLoyaltyCardsFilling feature flag
The AutofillEnableLoyaltyCardsFilling feature has been launched.
This CL removes the feature flag and all related code/tests that
were conditionally enabled by it. All loyalty card filling
functionality is now enabled by default.
Bug: 395831853
Test: CQ passes
Change-Id: I1a686fcdf1724138ade660229b54760d563f4d66
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/7661784
Reviewed-by: Christoph Schwering <schwering@google.com>
Reviewed-by: Florian Leimgruber <fleimgruber@google.com>
Commit-Queue: Norge Vizcay <vizcay@google.com>
Cr-Commit-Position: refs/heads/main@{#1599049}
The use of this constant for inserting a new key on the same enum class
is too fragile, and has fallen apart with with a new mention of
`kMaxStarterPackId` being introduced.
Chromium changes:
https://chromium.googlesource.com/chromium/src/+/ed834a558a91d08a5a47995444a932d66b5638ad
commit ed834a558a91d08a5a47995444a932d66b5638ad
Author: Amelie Schneider <amelies@google.com>
Date: Tue Mar 17 10:54:29 2026 -0700
[Search] Refactor disabled starter pack IDs retrieval
Until now, it was determined directly in
`TemplateURLTableModel::Reload()` whether starter packs should be
disabled or not. Since we will have to use this logic directly inside
the `TemplateURLService`, move it to the `SearchEnginesHandler` instead.
Bug: 490314640
Change-Id: I0f49443617b56cfdb71124b468a39200e90312a6
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/7670799
Reviewed-by: Nicolas Dossou-Gbété <dgn@chromium.org>
Commit-Queue: Amelie Schneider <amelies@google.com>
Cr-Commit-Position: refs/heads/main@{#1600663}
Chromium changes:
https://chromium.googlesource.com/chromium/src/+/ba1bc87f5b13d8446edbd4d30013806bd4ce2d41
commit ba1bc87f5b13d8446edbd4d30013806bd4ce2d41
Author: Norge Vizcay <vizcay@google.com>
Date: Wed Mar 11 00:42:18 2026 -0700
Remove kSyncAutofillLoyaltyCard feature flag
The kSyncAutofillLoyaltyCard feature has been launched. This CL removes
the feature flag and its associated conditional logic, making the
syncing of loyalty cards from Google Wallet enabled by default.
Bug: b:393119606
Test: components_unittests --gtest_filter=ValuablesDataManagerTest.*
Test: sync_integration_tests --gtest_filter=SingleClientValuablesSyncTest.*
Test: unit_tests --gtest_filter=SyncServiceFactoryTest.*
Change-Id: I63f09797a9cab0c28edb0f0439c7d1ef130e4fbb
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/7654135
Commit-Queue: Norge Vizcay <vizcay@google.com>
Reviewed-by: Marc Treib <treib@chromium.org>
Reviewed-by: Etienne Bergeron <etienneb@chromium.org>
Cr-Commit-Position: refs/heads/main@{#1597558}
The country code from the variations seed was only written to prefs on
the first seed fetch of a session. Subsequent 304 Not Modified responses
carrying a new X-Country header were silently ignored, so country-keyed
components such as the NTT and ads resource components would not update
when the user's location changed mid-session via VPN. The fix writes the
country code on every 304 response that carries a non-empty X-Country
header. This does not affect Chromium field trial membership, which is
evaluated once at startup from the stored seed.
This PR corrects `GetSeed` to be easier to use and less bug prone. This
is being done in preparation to the `os_crypt_sync` migration. An
interface change was the addition of `IsEncryptionAvailable()`, which
will be useful when this type is given an encryptor.
This PR also removes a lot of the os crypt setup and tearr down for
tests, to make it easier to have them removed once they are not needed
anymore.
* [History Embeddings] Hide UI entry points that imply a cloud round-trip
Strip the pieces that either ask the user for feedback we don't send
anywhere or link to a settings page we don't expose:
- cr-feedback-buttons (thumbs up/down) in the history embeddings
results card — no telemetry for an on-device feature.
- "Learn more" link in the chrome://history disclaimer and in the
history side panel — both pointed at historyEmbeddingsSettingsUrl.
- "Manage your history search setting" link in the IPH promo.
- "Learn more" link in the omnibox history embeddings disclaimer
IPH row — pass empty link_text/GURL() so the disclaimer still
renders without a link.
Part of https://github.com/brave/brave-browser/issues/54798
* [History Embeddings] Reword disclaimer and hide chrome://settings/ai
Brave's history semantic search runs entirely on-device (see
brave/browser/history_embeddings/README.md), so:
- IDS_HISTORY_EMBEDDINGS_DISCLAIMER{,_LOGGING_OFF} and
IDS_OMNIBOX_HISTORY_EMBEDDINGS_DISCLAIMER_IPH text about data being
sent to Brave and seen by human reviewers is inaccurate. Add
IDS_BRAVE_HISTORY_EMBEDDINGS_DISCLAIMER (in brave_generated_resources)
and IDS_BRAVE_OMNIBOX_HISTORY_EMBEDDINGS_DISCLAIMER_IPH (in
brave_components_strings) and swap the IDS in the chromium_src
overrides for history_embeddings_utils.cc and
featured_search_provider.cc. Owning the strings outright is resilient
to upstream wording tweaks. Neither override requires a new GN dep:
brave/grit/brave_generated_resources.h is reachable via the existing
//chrome/app:generated_resources transitive dep, and
components/grit/brave_components_strings.h via the existing
brave_components_omnibox_browser_deps injection.
- Force IsHistoryEmbeddingsSettingVisible() to false so the
chrome://settings/ai/historySearch entry — and, transitively, the
whole AI settings page and menu entry — drops out. Brave has no
user-facing toggle for this feature.
Part of https://github.com/brave/brave-browser/issues/54798
* Route upstream's ChromePassageEmbeddingsServiceController::Get() to Brave
Instead of each upstream factory that calls
ChromePassageEmbeddingsServiceController::Get() needing a chromium_src
swap to reach BravePassageEmbeddingsServiceController, make
BravePassageEmbeddingsServiceController publicly inherit from
ChromePassageEmbeddingsServiceController and override Get() in a
chromium_src shim to return the Brave singleton. Every upstream
caller — HistoryEmbeddingsServiceFactory, PageEmbeddingsServiceFactory,
PassageEmbedderModelObserver — resolves to the Brave instance
automatically, with no per-factory chromium_src override.
- Change BravePassageEmbeddingsServiceController base class to
ChromePassageEmbeddingsServiceController.
- Add chromium_src header shim that injects
`friend class BravePassageEmbeddingsServiceController` so the Brave
subclass can reach Chrome's private ctor/dtor.
- Add chromium_src .cc override that provides Chrome's ctor/dtor and
MaybeLaunchService/ResetServiceRemote as trivial stubs (Brave's
subclass overrides those) and defines Get() to return the Brave
singleton.
- Drop chromium_src/.../page_embeddings_service_factory.cc — upstream's
factory now picks up the Brave controller via Get(). The
PassageEmbedderModelObserver is created naturally; Brave's
MaybeUpdateModelInfo override is a no-op, and
IsUserPermittedToFetchFromRemoteOptimizationGuide already returns
false, so the observer does no work.
- Drop the ChromePassageEmbeddingsServiceController swap in
chromium_src/.../history_embeddings_service_factory.cc (now redundant).
* Convert BraveHistoryEmbeddingsService to a concrete subclass
Drop the BraveHistoryEmbeddingsService<BaseClass> template and place
a concrete BraveHistoryEmbeddingsService : ChromeHistoryEmbeddingsService
in brave/browser/history_embeddings/. The Brave target already
depends on //chrome/browser/history_embeddings, which re-exposes
chrome_history_embeddings_service.h with no circular dep, so the
template is no longer needed to sidestep dependency layering.
- Add brave_history_embeddings_service.{h,cc}; reuse Chrome's ctor via
`using ChromeHistoryEmbeddingsService::ChromeHistoryEmbeddingsService`
and keep the OnPassageVisibilityCalculated override (synthesize
passing scores to bypass upstream's empty-annotations clear).
- Simplify chromium_src/.../history_embeddings_service_factory.cc:
`#define ChromeHistoryEmbeddingsService BraveHistoryEmbeddingsService`
instead of the template-instantiation swap.
- Drop chromium_src/.../history_embeddings_service_unittest.cc —
upstream's test fixture delegates to the base HistoryEmbeddingsService
ctor, which doesn't match BraveHistoryEmbeddingsService's inherited
Chrome-style ctor, so the previous #define class swap no longer
compiles. The override is a small, low-risk transformation covered by
manual/integration testing.
- Delete brave/components/history_embeddings/ (template no longer exists).
Use chromium's existing kHistoryEmbeddings feature flag instead of
maintaining a separate kLocalAIModels flag. Replace all kLocalAIModels
references with history_embeddings::kHistoryEmbeddings and remove
kLocalAIModels.
- Re-expose the upstream history-embeddings flag entry in about:flags
(the upstream entry expired at M145)
- Override IsHistoryEmbeddingsEnabledForProfile() to bypass upstream's
per-profile OptimizationGuide pref check
(ShouldFeatureBeCurrentlyEnabledForUser(kHistorySearch)), which
Brave doesn't set up.
No need to override IsHistoryEmbeddingsFeatureEnabled(): upstream's
implementation only auto-enables the feature for us-en-US profiles
when kLaunchedHistoryEmbeddings is enabled, and we already force
kLaunchedHistoryEmbeddings to FEATURE_DISABLED_BY_DEFAULT (pre-existing
override). That kills upstream's auto-launch fallback, leaving
kHistoryEmbeddings as the sole gate for Brave.