1797 Commits
Author SHA1 Message Date
r0hit0303 2bc2676507 Add a new WebGPU webcompat content settings type (#36923)
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
2026-06-03 13:01:13 +02:00
MaxMandInjectorExe 225eefcea2 Add configurable history retention setting (#34737)
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>
2026-05-30 22:18:56 -07:00
Max Karolinskiy 2e67a9ba12 [cr149] Adjusts HistoryEmbeddingsServiceTest test normalization.
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
2026-05-22 16:57:36 -04:00
Claudio DeSouza bd450fd91c [cr149] Fixing BraveSpecificsToModel due to last field change
This field used to be a bool, but it is now an enum. This change
corrects the implementation of `BraveSpecificsToModel`, which is
supposed to stay in sycn with `DeviceInfo`.

Chromium changes:
https://chromium.googlesource.com/chromium/src/+/2beaaac13944769bdb69f50226ddb84e8e840456

commit 2beaaac13944769bdb69f50226ddb84e8e840456
Author: Theodore Olsauskas-Warren <sauski@google.com>
Date:   Thu Apr 30 10:56:48 2026 -0700

    [Glic] Move experimental triggering in DeviceInfo to use Enum

    Update the recently added bool glic_experimental_triggering_opted_in
    to use an enum, updating its name to match.

    The previously added proto entry is removed and the value reused,
    there is no practical risk of version mismatch (and bool values map to
    enum versions that are reasonably safe).

    Change-Id: I231dca339fa09a72d6b79d7a4aeb12d3e9b3b761
    Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/7796299
    Reviewed-by: Mikel Astiz <mastiz@chromium.org>
    Reviewed-by: David Trainor <dtrainor@chromium.org>
    Reviewed-by: Maria Petrisor <mpetrisor@chromium.org>
    Reviewed-by: Shakti Sahu <shaktisahu@chromium.org>
    Reviewed-by: Roman Arora <romanarora@chromium.org>
    Commit-Queue: Theodore Olsauskas-Warren <sauski@google.com>
    Reviewed-by: Min Qin <qinmin@chromium.org>
    Reviewed-by: Rohit Rao <rohitrao@chromium.org>
    Reviewed-by: Tommy Nyquist <nyquist@chromium.org>
    Cr-Commit-Position: refs/heads/main@{#1623334}
2026-05-22 16:57:32 -04:00
Max Karolinskiy 033d07fdfc [cr149] Adjusts HistoryEmbeddingsServiceTest test.
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
2026-05-22 16:57:30 -04:00
Max Karolinskiy d150d7a974 [cr149] Adjusts DataTypeTest.DataTypeCounts test for a new type.
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
2026-05-22 16:57:29 -04:00
Max Karolinskiy 7ac7f81396 [cr149] Adds forward declaration for PermissionContextBase.
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.
2026-05-22 16:57:26 -04:00
Claudio DeSouza 75ce6e9af1 [cr149] AffiliationServiceImpl::PrefetchChangePasswordURL renamed
Chromium changes:
https://chromium.googlesource.com/chromium/src/+/a2bcd9cb8e7179613fbcf0d27595e3bc25eced78

commit a2bcd9cb8e7179613fbcf0d27595e3bc25eced78
Author: Viktor Semeniuk <vsemeniuk@google.com>
Date:   Mon Apr 27 11:21:27 2026 -0700

    Use change-pwd url received from afiliation service

    This CL updates change-pwd url fetching to avoid using stale change
    password urls from cache during automated password change.

    Fixed: 506122721
    Change-Id: I89c6e823dddcc25dcf1a489debf32f471b23a552
    Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/7792821
    Reviewed-by: Ioana Treib <ioanap@chromium.org>
    Commit-Queue: Viktor Semeniuk <vsemeniuk@google.com>
    Cr-Commit-Position: refs/heads/main@{#1621208}
2026-05-22 16:57:26 -04:00
Artem Samoilenko cff097d5d3 [cr149][Android] Changes for removed isInitialSyncFeatureSetupComplete()
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}
2026-05-22 16:57:25 -04:00
Claudio DeSouza ec3fc55ca2 [cr149] glic_experimental_triggering_opted_in in DeviceInfo
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}
2026-05-22 16:57:24 -04:00
Artem Samoilenko ded7386ce6 [cr149][Android] Build fix for password store factory
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}
2026-05-22 16:25:14 -04:00
Claudio DeSouza b8aa9d78ba [cr149] components/os_crypt/sync deleted
Remove any remnants of os_crypt/sync from Brave - all Brave code has
already been transitioned to async OSCrypt.

Chromium changes:
https://chromium.googlesource.com/chromium/src/+/a4cab4afb48c24f4557ec6dc7cbd1bd192fb65b4

commit a4cab4afb48c24f4557ec6dc7cbd1bd192fb65b4
Author: Tom Anderson <thomasanderson@chromium.org>
Date:   Fri Apr 17 15:10:45 2026 -0700

    [OSCrypt] Remove sync backend

    R=thestig

    Fixed: 447372315
    Change-Id: I56d58c4326aa74f540370cd1daf6cf974b15d4d6
    Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/7765593
    Reviewed-by: Lei Zhang <thestig@chromium.org>
    Commit-Queue: Thomas Anderson <thomasanderson@chromium.org>
    Cr-Commit-Position: refs/heads/main@{#1616892}
2026-05-22 16:25:02 -04:00
Claudio DeSouza f783ea1495 [cr149] SettingSource::kTpcdGrant deleted
This was being passed along in a place, which can be easily deleted, and
in another place it was being used as a macro anchor, which has been
corrected.

Chromium changes:
https://chromium.googlesource.com/chromium/src/+/4f6f66374bd8fb36de59c75b329361eb1f4a0396

commit 4f6f66374bd8fb36de59c75b329361eb1f4a0396
Author: Fiona Macintosh <fmacintosh@google.com>
Date:   Wed Apr 15 01:49:38 2026 -0700

    Delete remaining obsolete 3PCD-related enum values

    Removes k3PCDMetadata, kTpcdGrant, kEnforcedByTpcdGrant

    Change-Id: Id9f3ac6fc20334ade63e62bb01d823396ea30a01
    Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/7749186
    Reviewed-by: Arthur Sonzogni <arthursonzogni@chromium.org>
    Commit-Queue: Judith Hemp <hempjudith@google.com>
    Reviewed-by: Judith Hemp <hempjudith@google.com>
    Auto-Submit: Fiona Macintosh <fmacintosh@google.com>
    Reviewed-by: Maks Orlovich <morlovich@chromium.org>
    Reviewed-by: Christian Dullweber <dullweber@chromium.org>
    Cr-Commit-Position: refs/heads/main@{#1615003}
2026-05-22 16:24:56 -04:00
Claudio DeSouza cac9a404dd [cr149] kTrackingProtection3pcd deleted
This feature has been deleted with the flag, which we were disabling.

Chromium changes:
https://chromium.googlesource.com/chromium/src/+/6cecf5c9cf156340d248173d59672e41981467af

commit 6cecf5c9cf156340d248173d59672e41981467af
Author: Fiona Macintosh <fmacintosh@google.com>
Date:   Thu Apr 9 01:59:36 2026 -0700

    Delete kTrackingProtection3pcd feature

    Fixed: b:482352097
    Change-Id: I856bdd18a750581b6bc717652e4a531ee5cda00f
    Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/7741961
    Auto-Submit: Fiona Macintosh <fmacintosh@google.com>
    Reviewed-by: Christian Dullweber <dullweber@chromium.org>
    Commit-Queue: Christian Dullweber <dullweber@chromium.org>
    Cr-Commit-Position: refs/heads/main@{#1612047}
2026-05-22 16:18:03 -04:00
Claudio DeSouza 8070a2b7f7 [cr149] TranslateLanguageList with TranslateUrlFetcher arg
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}
2026-05-22 16:18:02 -04:00
Claudio DeSouza 8f31759480 [cr149] kTpcdMetadataGrants deleted
The feature was being disabled in Brave, and now it is gone.

Chromium changes:
https://chromium.googlesource.com/chromium/src/+/b7f05fafa03fe5ae3a7039fbad7dcf16198beda4

commit b7f05fafa03fe5ae3a7039fbad7dcf16198beda4
Author: Fiona Macintosh <fmacintosh@google.com>
Date:   Tue Apr 7 12:00:10 2026 -0700

    Delete TPCD metadata manager and associated 3pcd cookies logic

    Change-Id: I258499866c8714129644e219a76e4816e24f4783
    Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/7726996
    Reviewed-by: Josh Karlin <jkarlin@chromium.org>
    Reviewed-by: Christian Dullweber <dullweber@chromium.org>
    Reviewed-by: Alex Ilin <alexilin@chromium.org>
    Reviewed-by: Hidehiko Abe <hidehiko@chromium.org>
    Reviewed-by: Maks Orlovich <morlovich@chromium.org>
    Commit-Queue: Fiona Macintosh <fmacintosh@google.com>
    Reviewed-by: Joshua Hood <jdh@chromium.org>
    Cr-Commit-Position: refs/heads/main@{#1610923}
2026-05-22 16:18:01 -04:00
Brian R. Bondy 906df701d0 Use Brave Origin icons in infobar and webui logo for macOS (#36482)
Resolves https://github.com/brave/brave-browser/issues/55525
2026-05-19 12:55:57 -04:00
cdesouza-chromium 7128c2ea48 [CodeHealth][plaster] Keep in chromium_src non-macro code (#36502)
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.
2026-05-18 23:51:45 +01:00
cdesouza-chromium 6148d17fe6 [brockit][sync] Avoiding bool in DeviceInfo (#36409)
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
2026-05-14 13:26:01 +01:00
Simon Hong fc1f49123e [infobar] Refactor BraveConfirmInfoBar (2/N): cleanups (#36344)
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
2026-05-14 09:12:03 +09:00
Simon Hong aa2ad1dfbd [infobar] Refactor BraveConfirmInfoBar (1/N): drop dev channel infobar (#36342)
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
2026-05-13 07:24:46 +09:00
cdesouza-chromium 35f807c9ab [plaster][cr149] ECDSA_SHA384 🩹🩹🩹🩹 (#36118)
This change migrates all `ECDSA_SHA384` code additions to plaster. These
additions started causing build breakages in M149 due to unwanted
replacements in a proto generated header, which broke nearly all of
them.

These plasters are smart enough to match with the contents of the block
they are aimed at.

Chromium changes:
https://chromium.googlesource.com/chromium/src/+/70cb8d8433679502ede773d828bf31cb0a1bce16

commit 70cb8d8433679502ede773d828bf31cb0a1bce16
Author: hamda mare <hmare@google.com>
Date:   Tue Apr 28 12:53:24 2026 -0700

    Add proto and type definitions for certificate collection

    This CL adds the necessary proto messages and C++ types to support certificate collection in signal reports.

    Bug: 502634772
    Change-Id: I2136d39ac83c293856690a8acef12d6d2babdeec
    Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/7795711
    Reviewed-by: Igor Ruvinov <igorruvinov@chromium.org>
    Reviewed-by: Zonghan Xu <xzonghan@chromium.org>
    Commit-Queue: Hamda Mare <hmare@google.com>
    Cr-Commit-Position: refs/heads/main@{#1621979}

Resolves https://github.com/brave/brave-browser/issues/55193
2026-05-08 23:25:10 +01:00
AlexeyBarabash 137fd17f68 [Android][Sync] Fix for regression after OSCrypt migration (#36264)
* [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
2026-05-08 13:22:18 +03:00
Netzenbot 9971db0e0e Fix cookie IPC race in browsing data test utility (#36125)
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.

Resolves brave/brave-browser#54537
2026-05-07 11:57:37 -04:00
AlexeyBarabash 68ac872402 [OSCrypt][Sync] Migrate to async OSCrypt (#36121)
* [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
2026-05-07 13:57:19 +03:00
Max Karolinskiy 0db88f1aa7 Disables kIPHAutofillAccountNameEmailSuggestionFeature. (#36172) 2026-05-05 13:12:53 -04:00
cdesouza-chromium 4df5363858 [plaster] Migrate DeviceInfo override (#35958)
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
2026-05-02 00:52:35 +01:00
Emerick Rogul d9a2b62f59 Hide the card benefits toggle button in brave://settings/payments (#36057)
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.
2026-05-01 12:40:08 -04:00
Emerick Rogul 947ef290d3 Disable upstream source injection for all search engines (#36062)
`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}
2026-05-01 10:01:16 -04:00
Simon Hong 17852f8644 [Cleanup] Remove unnecessay IPH suppress in runtime (#36083)
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
2026-05-01 23:00:36 +09:00
Pavel Beloborodov e3527b9759 Added New Email Alias suggestion into autofill popup. (#34516)
* Added New Email Alias suggestion into autofill popup.
2026-04-30 10:31:18 +07:00
cdesouza-chromium 3bb82b9e52 [plaster] PermissionContextBase migration (#35907)
[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
2026-04-28 23:43:52 +01:00
cdesouza-chromium 6d4290917d [plaster] Migration and fixes for request type customisations (#35903)
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
2026-04-28 03:29:56 +01:00
Emerick Rogul 87000d737f [cr148] Disable features flagged by security/privacy team 2026-04-27 12:01:02 +01:00
Claudio DeSouza 87540a26fe [cr148] Fix for SyncSessionDurationsMetricsRecorder stubs
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}
2026-04-27 12:01:01 +01:00
Emerick Rogul f21f081b4d [cr148] Fix dangling pointer in CrxUpdateService callbacks
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}
2026-04-27 12:01:00 +01:00
Claudio DeSouza 0b91d58de8 [cr148] Adjusting LowPriorityUserTypes() override to new location
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}
2026-04-27 12:00:58 +01:00
Claudio DeSouza 93cc023180 [cr148] kDocumentProviderNoSyncRequirement deleted
This deletion was approved by Brave's security team, as it is gated on Google
Account sign-in at the browser level.

Chromium changes:
https://chromium.googlesource.com/chromium/src/+/f8a90a556ba3648b75ac49c14715540692a03c49

commit f8a90a556ba3648b75ac49c14715540692a03c49
Author: Jonathan Lee <jonathanjlee@google.com>
Date:   Thu Mar 26 14:49:19 2026 -0700

    [code-health] Clean up `omnibox-drive-suggestions-no-sync-requirement`

    * This flag expired in M132.
    * The `base::Feature` isn't listed in
      go/stale-base-features-exceptions.
    * The Finch configs associated with the `base::Feature` appear fully
      launched.

    Fixed: 335232635
    Change-Id: I86a027a6869a66ec5906e5cfee9c24ea4575d582
    Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/7701378
    Reviewed-by: Justin Donnelly <jdonnelly@chromium.org>
    Reviewed-by: Robbie Gibson <rkgibson@google.com>
    Auto-Submit: Jonathan Lee <jonathanjlee@google.com>
    Commit-Queue: Robbie Gibson <rkgibson@google.com>
    Cr-Commit-Position: refs/heads/main@{#1605795}
2026-04-27 12:00:53 +01:00
Claudio DeSouza 6899b1b00a [cr148] Fix WalletHttpClient stubs to include consent auditor
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}
2026-04-27 12:00:52 +01:00
Claudio DeSouza ae78891a95 [cr148] DeviceInfo now using its own enum types
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}
2026-04-27 12:00:52 +01:00
Claudio DeSouza f32a04eaad [cr148] IsValidWebAppUrl moved under //components
This function is now called `IsUrlEligibleForWebApp`.

Chromium changes:
https://chromium.googlesource.com/chromium/src/+/f79eb8c0c496682cea5e54a3c038b7f770a97804

commit f79eb8c0c496682cea5e54a3c038b7f770a97804
Author: Lichen Liu <lichenliu@microsoft.com>
Date:   Wed Mar 18 22:54:15 2026 -0700

    [PWA] Centralize URL eligibility check for web app features

    Add IsUrlEligibleForWebApp() and AddValidChromeUrlHostForTesting() in
    components/webapps/browser/web_app_url_config.h to centralize the logic
    that determines whether a URL is eligible for web app features (banners,
    installation, etc.).

    Bug: 481017409
    Change-Id: Iaa3d36fcbcc18677eb57073eb2d51063a30240f9
    Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/7665546
    Reviewed-by: Yoshiki Iguchi <yoshiki@chromium.org>
    Reviewed-by: Daniel Murphy <dmurph@chromium.org>
    Commit-Queue: Lichen Liu <lichenliu@microsoft.com>
    Cr-Commit-Position: refs/heads/main@{#1601772}
2026-04-27 12:00:50 +01:00
AlexeyBarabash ca04e711f9 [cr148][Android] - kAutofillEnableLoyaltyCardsFilling removed
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}
2026-04-27 12:00:49 +01:00
Claudio DeSouza bf8ee61732 [cr148] Fix unwated kMaxStarterPackId replacement
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}
2026-04-27 12:00:48 +01:00
AlexeyBarabash b62347bad5 [cr148][Android] SyncServiceAndroidBridge methods signature changed
Chromium change:
https://source.chromium.org/chromium/chromium/src/+/7555add0775582ef4c8b7458f4e95f7493c80d9e

commit 7555add0775582ef4c8b7458f4e95f7493c80d9e
Author: Andrew Grieve <agrieve@chromium.org>
Date:   Wed Mar 11 17:24:07 2026 -0700

    Add @JniType to a batch of files in //components (#4)

    Bug: 491444984
    Change-Id: I14feaa20d1cde9479f5742c171e955d504fd3f05
    Cq-Include-Trybots: luci.chrome.try:android-internal-dbg,android-internal-binary-size
    Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/7654452
    Reviewed-by: Peter Wen <wnwen@chromium.org>
    Owners-Override: Andrew Grieve <agrieve@chromium.org>
    Commit-Queue: Andrew Grieve <agrieve@chromium.org>
    Cr-Commit-Position: refs/heads/main@{#1598092}
2026-04-27 12:00:46 +01:00
AlexeyBarabash db772bc88c [cr148] kSyncAutofillLoyaltyCard deleted and made default
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}
2026-04-27 12:00:44 +01:00
Terry Mancey 25059f6aaf [ads] Fixes NTT component is not updated after variation seed country change (#35841)
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.
2026-04-24 10:14:33 -04:00
cdesouza-chromium e310ed002a [CodeHealth] Fix Prefs::GetSeed interface (#35815)
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.
2026-04-24 12:12:53 +01:00
Anthony Tseng bb1a0b8fab [History Embeddings] Clarify zero data collection for history semantic search (#35813)
* [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
2026-04-24 04:04:28 +01:00
Anthony Tseng 1fa64a841d Improve chromium_src overrides for history embeddings (#35801)
* 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).
2026-04-23 23:34:56 +01:00
Anthony Tseng 1666370521 Reland #35004 "Replace kLocalAIModels with upstream kHistoryEmbeddings" (#35250)
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.
2026-04-22 05:59:36 +01:00