Commit Graph
2917 Commits
Author SHA1 Message Date
Sangwoo Ko 0ca3511586 Show Shields toolbar button on PWA (#35928)
* Show Shields toolbar button on PWA

As PWAs could be broken with Shields on, we need to show a toolbar button
to control shield setting
2026-05-05 12:10:44 +09:00
Netzenbot 17bb98ec45 Disable flaky Chromium test PageStabilityMetricsTest.Paint on Linux (#36133)
This is an upstream Chromium test. Brave's cosmetic filters inject
MutationObserver and setInterval(500ms) polling on all pages, preventing
Blink's IdlenessDetector from reaching its 500ms quiet window needed for
NetworkBecameIdle. The Paint test triggers this by resolving the network
request after paint stability is reached, then waiting for the
network/main-thread idle histogram that never fires.

Same root cause as already-disabled PageStabilityMetricsTest.
NetworkAndMainThreadIdle (Linux, #54205) and PageStabilityMetricsTest.
Paint (Windows, #54186). Upstream flake rate is 2.5% over 30 days per
LUCI Analysis.

Resolves https://github.com/brave/brave-browser/issues/54503
2026-05-04 11:45:11 -04:00
Netzenbot 2d7c0ebd10 Disable SearchEngineChoiceDialogBrowserTest extension DSE test on Linux (#36120)
The Chromium test DialogDoesNotShowWithExtensionEnabledThatOverridesDSE
fails on Linux because ApplyDefaultSearchChangeForTesting(FROM_EXTENSION)
leaves default_search_provider_ null (extension DSEs are unsupported on
Linux) while default_search_provider_source_ stays FROM_EXTENSION.
Brave's DefaultSearchManager override causes MaybeShowDialog() to record
the Search.ChoiceScreenNavigationConditions histogram twice with
differing conditions (kControlledByPolicy and kExtensionControlled),
failing the ExpectUniqueSample assertion.

Already disabled on Windows in upstream source. Upstream TODO
crbug.com/429600559 acknowledges the broken extension DSE test setup.
Stable upstream (0.3% flake rate over 30 days per LUCI Analysis).

Resolves https://github.com/brave/brave-browser/issues/54542
2026-05-04 11:39:52 -04:00
Netzenbot a2a825efca Disable flaky CookieUseCounterBrowserTest.PartitionedCookiePresentV3_CountOnce (#36089)
Chromium test with 1.1% upstream flake rate (83k+ verdicts, LUCI
Analysis 30-day lookback). The PartitionedCookiePresentV3 UKM is
recorded per cookie access event without per-page deduplication, so
the test's delta occasionally gets 2 instead of 1 when a prior
navigation's UKM recording arrives after the baseline snapshot.

Fixed upstream (crrev.com/c/7746704) by adding a per-page tracking
flag to PageImpl, but that fix has not landed in Chromium 148.

No Brave chromium_src overrides for content/browser/renderer_host/
cookie_utils.cc. Chromium also disabled this test temporarily
upstream before the fix landed.

Resolves https://github.com/brave/brave-browser/issues/55020
2026-05-01 15:40:28 -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
Kamil Jozwiak 3313ba577e Upgrade from Chromium 148.0.7778.60 to Chromium 148.0.7778.96 (#36017)
<!-- Add brave-browser issue below that this PR will resolve -->
Resolves https://github.com/brave/brave-browser/issues/55095

<!-- CI-related labels that can be applied to this PR:
* CI/disable-pipeline-step-cache - instruct CI to not cache build steps
between runs for the same commit hash
* CI/enable-coverage - enable coverage reporting for your code changes
* CI/enable-test-only-affected - instruct CI to only run tests affected
by your change
* CI/run-audit-deps (1) - check for known npm/cargo vulnerabilities
(audit_deps)
* CI/run-network-audit (1) - run network-audit
* CI/run-perf-smoke-tests - run smoke performance tests
* CI/storybook-url (1) - deploy storybook and provide a unique URL for
each build
* CI/run-upstream-tests - run Chromium unit and browser tests on Linux
and Windows (otherwise only on Linux)
* CI/skip-upstream-tests - do not run Chromium unit, or browser tests
(otherwise only on Linux)
* CI/run-teamcity - run TeamCity
* CI/skip-teamcity - skip TeamCity
* CI/skip - do not run CI builds (except noplatform)
* CI/run-linux-arm64, CI/run-macos-x64, CI/run-windows-arm64,
CI/run-windows-x86 - run builds that would otherwise be skipped
* CI/skip-linux-x64, CI/skip-android, CI/skip-macos-arm64, CI/skip-ios,
CI/skip-windows-x64 - skip CI builds for specific platforms

(1) applied automatically when some files are changed (see:
https://github.com/brave/brave-core/blob/master/.github/labeler.yml)
-->

<!--
## Checklist:

- Review design docs
[Browser design
principles](https://chromium.googlesource.com/chromium/src/+/refs/heads/main/docs/chrome_browser_design_principles.md)
[Style
guide](https://chromium.googlesource.com/chromium/src/+/main/styleguide/c++/c++.md)
[Core principles](https://www.chromium.org/developers/core-principles/)
- Ensure there are
(tests)[https://www.chromium.org/developers/testing/]. Unit test as much
as possible (including edge cases), but also include browser tests
covering high level functionality.
- Ensure that there are comments explaining what classes/methods are/do.
The "why" is often more important than the "what" in comments. Also
update any relevant docs (moving docs from wiki to brave-core if
necessary).
- Request security or other review (third-party libraries, rust code,
etc...) if applicable [security/privacy review is
needed](https://github.com/brave/brave-browser/wiki/Security-reviews)
[other review](https://github.com/brave/reviews/issues/new/choose)
Also see [adding third-party
libraries](https://chromium.googlesource.com/chromium/src/+/refs/heads/main/docs/adding_to_third_party.md)
for general guidelines on using third party code
- Make sure there is a
[ticket](https://github.com/brave/brave-browser/issues) for your issue
- Use Github [auto-closing
keywords](https://docs.github.com/en/github/managing-your-work-on-github/linking-a-pull-request-to-an-issue)
in the PR description above
- Write a good [PR/commit
description](https://google.github.io/eng-practices/review/developer/cl-descriptions.html)
- Squash any review feedback or "fixup" commits before merge, so that
history is a record of what happened in the repo, not your PR
- Add appropriate labels (`QA/Yes` or `QA/No`; `release-notes/include`
or `release-notes/exclude`; `OS/...`) to the associated issue
- Checked the PR locally:
* `npm run test -- brave_browser_tests`, `npm run test --
brave_unit_tests`
[wiki](https://github.com/brave/brave-browser/wiki/Tests)
* `npm run presubmit`
[wiki](https://github.com/brave/brave-browser/wiki/Presubmit-checks),
`npm run gn_check`, `npm run tslint`
- Run `git rebase master` (if needed)
-->
2026-04-30 07:26:31 -04: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
Emerick Rogul 979329a565 Filter unsupported upstream tests 2026-04-29 18:00:46 -04:00
Kevin Smith 6fc74a3dc3 [FocusMode] Add feature flag, command, and stub controller (#35904) 2026-04-29 10:59:45 -04:00
Simon Hong 6f61e201fb [CR148] Fix NTP favicon override not being applied (#35989)
* [NTP] Fix NTP favicon override not being applied

The previous chromium_src override of TabData::FromTabInterface was
broken: the #define FromTabInterface FromTabInterface_ChromiumImpl
pattern also renamed the internal call inside
TabDataObserver::OnTabUIChange, so that function always called
FromTabInterface_ChromiumImpl directly, bypassing the Brave override
entirely.

Fix by injecting two macro hooks into the upstream FromTabInterface
body instead of overriding the whole function:
 * BRAVE_TAB_DATA_FROM_TAB_INTERFACE_SHARED_PINNED_EARLY_RETURN
   - early return for shared pinned tab dummy contents
 * BRAVE_TAB_DATA_FROM_TAB_INTERFACE_APPLY_OVERRIDES
   - favicon theming override for NTP/Welcome/Rewards pages and
     unloaded-tab discard status

This change also includes reverting https://github.com/brave/brave-core/pull/22852.
After applying FromTabInterface overriding, we found that
WebUIEmbeddingContextTest.InitEmbeddingContext_MovingTabsAcrossWindowsUpdatesContext
is failed. It was failed due to our should_show_discard_status flag overriding.
In this test, "browser" pointer is null at TabIcon::SetDisarded()
when this flag is on by our overriding.
That overriding is for showing unload ring when tab is gone by urgent discard.
But it doesn't work now. So just reverted.
See https://github.com/brave/brave-core/pull/22852 for more details.
2026-04-29 23:35:54 +09: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
Brian R. Bondy 39fc9c7d94 Gate Playlist UI on BravePlaylistEnabled policy (#35823)
* Gate Playlist UI on BravePlaylistEnabled policy

Complements #35732, which hides Playlist via the enable_playlist buildflag
in is_brave_origin_branded=true builds, by also hiding the Playlist UI in
is_brave_origin_branded=false builds when an administrator disables it
via the BravePlaylistEnabled policy (kPlaylistEnabledPref managed=false).

Adds playlist::IsPlaylistEnabled(prefs) / IsDisabledByPolicy(prefs)
helpers alongside existing features.h / pref_names.h, mirroring the iOS
PrefService.isPlaylistAvailable check and the ai_chat::IsAIChatEnabled
pattern. The helper is used to gate the sidebar item, side panel
coordinator and entry, browser action, playlist command, tab helper,
page action icon, and the chrome-untrusted://playlist WebUI.

The SidebarService now observes kPlaylistEnabledPref so the item appears
and disappears when policy changes at runtime.

User-driven pref toggles from settings keep their existing behaviour
(UI stays reachable so the user can flip the pref back); only a managed
pref forced off hides the UI.

Fixes brave/brave-browser#50156

* Address review: move IsPlaylistAllowed out of common, simplify settings bools

- Relocate playlist::IsPlaylistEnabled from components/playlist/core/common
  (which is reachable from any process) to a new components/playlist/core/browser
  target, since the helper depends on PrefService (browser-only). Rename the
  function to IsPlaylistAllowed to match its semantics (feature flag is enabled
  and the pref is not policy-disabled), matching bridiver's suggestion that
  "allowed" = managed+feature, "enabled" = user toggle.
- Update all callers and BUILD/DEPS wiring for the new location.
- In brave_settings_ui.cc, stop combining the feature flag and the user pref
  into a single isPlaylistAllowed loadTimeData bool. Instead expose
  isPlaylistFeatureEnabled and isPlaylistDisabledByPolicy (the Tor pattern),
  and let settings page code consult the pref directly via the prefs mixin
  when it needs the managed state. page_visibility.ts now computes playlist
  visibility from the two building blocks.
2026-04-28 12:27:56 -04:00
vadims 3482487138 [PSST] Add consent dialog back-end (#35931)
* consent dialog backend

Signed-off-by: Vadym Struts <vstruts@brave.com>

* fix browser test

Signed-off-by: Vadym Struts <vstruts@brave.com>

* fix browser test

Signed-off-by: Vadym Struts <vstruts@brave.com>

* fix unit test

Signed-off-by: Vadym Struts <vstruts@brave.com>

* fix dependency

Signed-off-by: Vadym Struts <vstruts@brave.com>

* review

Signed-off-by: Vadym Struts <vstruts@brave.com>

* review

Signed-off-by: Vadym Struts <vstruts@brave.com>

* review

Signed-off-by: Vadym Struts <vstruts@brave.com>

* fix build

Signed-off-by: Vadym Struts <vstruts@brave.com>

* review

Signed-off-by: Vadym Struts <vstruts@brave.com>

* review

Signed-off-by: Vadym Struts <vstruts@brave.com>

* review

Signed-off-by: Vadym Struts <vstruts@brave.com>

---------

Signed-off-by: Vadym Struts <vstruts@brave.com>
2026-04-28 12:26:54 -04:00
AlexeyBarabash a0966c6410 [cr148][Android] Fixed build of test targets
Error message:

ERROR at //brave/test/BUILD.gn:518:7: Undefined identifier
  if (enable_commander) {
      ^---------------
See //brave/BUILD.gn:79:34: which caused the file to be included.
  brave_all_unit_tests_deps += [ "//brave/test:brave_unit_tests" ]
                                 ^------------------------------
2026-04-27 12:01:03 +01:00
AlexeyBarabash 70075a7449 [cr148][Android] Moved profile_resetter_test_base under (not is_android) 2026-04-27 12:01:00 +01:00
AlexeyBarabash 7a2e7fb904 [cr148][Android] Adjusted tabSupplier at HubManagerImpl.ctor
Now it is NullableObservableSupplier, missed old change

Chromium change:
https://source.chromium.org/chromium/chromium/src/+/416a61c418c152a7a7ae568d89302e5ecb6e4a3d

commit 416a61c418c152a7a7ae568d89302e5ecb6e4a3d
Author: Andrew Grieve <agrieve@chromium.org>
Date:   Tue Dec 2 14:13:59 2025 -0800

    Android: Split ObservableSupplier into Nullable / Monotonic / NonNull variants

    The goal is to use proper @Nullable annotations with
    ObservableSuppliers.

    To achieve this, we use interfaces that define nullness:
     * (Settable)NullableObservableSupplier
     * (Settable)ObservableSupplier <-- monotonic
     * (Settable)NonNullObservableSupplier

    And we have ObservableSupplierImpl implement all of them.

    In order to make this migration manageable, I've marked the interfaces
    as @NullUnmarked, and will fix annotations in batches until they
    can be marked @NullMarked.

    This CL includes a batch in order to test out the new interfaces (and
    because many were necessary to make the change).

    Monotonic suppliers are by far the most common afaict, so that's why
    the non-prefixed ObservableSupplier is the monotonic one (that, and
    because "Monotonic" is a mouthful).

    One implication of this approach is that we'll never have:
       ObservableSupplier<@Nullable Foo>
    We'd have instead:
       NullableObservableSupplier<Foo>

    Having the nullness in the interface rather than in the generic
    allows for defining toNonNull() only on monotonic suppliers, and
    simplifies the implementation.

    Bug: 455874046
    Change-Id: Id48e235b9ff16a5b21a9c1199863150d17c22736
    Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/7206746
    Commit-Queue: Andrew Grieve <agrieve@chromium.org>
    Reviewed-by: Calder Kitagawa <ckitagawa@chromium.org>
    Owners-Override: Andrew Grieve <agrieve@chromium.org>
    Cr-Commit-Position: refs/heads/main@{#1553094}
2026-04-27 12:00:59 +01:00
Claudio DeSouza 9cfaf652ae [cr148] PasswordManagerSettingsServiceFactory under factories
This affects how targets are added now, and a shadow file had to be
corrected.

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

commit bd7255bd8bf88581d34c38be1b16b05f7d5703b6
Author: Vasilii Sukhanov <vasilii@chromium.org>
Date:   Tue Mar 31 05:13:51 2026 -0700

    Refactor: Move PasswordManagerSettingsServiceFactory to factories/

    Moves password_manager_settings_service_factory.{h,cc} from
    //chrome/browser/password_manager/ to
    //chrome/browser/password_manager/factories/.

    Eliminates the `password_factory_headers` source_set in
    factories/BUILD.gn and wires everything cleanly to the unified
    //chrome/browser/password_manager/factories target. All internal include
    directives and BUILD.gn usages across webauthn, webid, autofill,
    ui/passwords, and actor_login were adjusted properly.

    Bug: 353332589
    Change-Id: I318230d1df39b0b849a026977f00f2d3d0047831
    Bypass-Check-License: moving the files
    Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/7710837
    Reviewed-by: Friedrich Hauser <friedrichh@chromium.org>
    Commit-Queue: Vasilii Sukhanov <vasilii@chromium.org>
    Cr-Commit-Position: refs/heads/main@{#1607791}
2026-04-27 12:00:58 +01:00
Claudio DeSouza 72dd4cd8b8 [cr148] ProfileResetterMockObject modularised
This function is only used by our browser tests, and this change adds
the new target as one of the deps.

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

commit b319111eaa8bee49a347e981c6a83afe9b663dc7
Author: Orko Garai <orko@igalia.com>
Date:   Mon Mar 30 12:36:51 2026 -0700

    Finish modularizing c/b/profile_resetter

    Move the remaining profile_resetter sources from c/b to
    c/b/profile_resetter target.

    Bug: 353332589
    Change-Id: I419b9d63e331df48415e18ee2479563dea09069d
    Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/7703695
    Commit-Queue: Orko Garai <orko@igalia.com>
    Reviewed-by: Darryl James <dljames@chromium.org>
    Cr-Commit-Position: refs/heads/main@{#1607306}
2026-04-27 12:00:57 +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
AlexeyBarabash 055edd76d8 [cr148][Android] Changes around BottomBarHostManager
New arg bottomBarHostManager at:
- HubManagerImpl.ctor
- TabbedRootUiCoordinator.ctor
- ToolbarManager.ctor

Chromium change:
https://source.chromium.org/chromium/chromium/src/+/9be4e7a3e1f68c9a7405c62e06cbe8b4ed8832d5

commit 9be4e7a3e1f68c9a7405c62e06cbe8b4ed8832d5
Author: Calder Kitagawa <ckitagawa@chromium.org>
Date:   Tue Mar 17 16:49:31 2026 -0700

    [BottomBar] handle view ownership transfer

    Bug: 491509787
    Change-Id: Ia8baf8095c55fe9580d718bb8806deab9fd0f5e1
    Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/7667562
    Reviewed-by: Madhav Pruthi <madhavpruthi@google.com>
    Reviewed-by: Dan Polanco <polardz@google.com>
    Commit-Queue: Calder Kitagawa <ckitagawa@chromium.org>
    Cr-Commit-Position: refs/heads/main@{#1600877}
2026-04-27 12:00:49 +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
AlexeyBarabash 468dad7ca5 [cr148][Android] ResourceButtonData moved to ui/actions package
Update import for ResourceButtonData which was moved from
org.chromium.chrome.browser.hub to org.chromium.chrome.browser.ui.actions.

Chromium change:
https://source.chromium.org/chromium/chromium/src/+/d364b657773ea7874b8ba6781d44cb9c2e54f55f

commit d364b657773ea7874b8ba6781d44cb9c2e54f55f
Author: Dan Polanco <polardz@google.com>
Date:   Wed Mar 11 15:05:22 2026 -0700

    Create ui/actions and move generic ButtonData

    Moves DisplayButtonData, FullButtonData, and their generic
    implementations out of the hub package into
    chrome/browser/ui/android/actions.

    Bug: 483096892
    Bypass-Check-License: Rename/move files.
    Change-Id: I9701129bf1d86ea20ac2786c9c66aa9778f1c64a
    Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/7654411
    Reviewed-by: Calder Kitagawa <ckitagawa@chromium.org>
    Commit-Queue: Calder Kitagawa <ckitagawa@chromium.org>
    Auto-Submit: Dan Polanco <polardz@google.com>
    Commit-Queue: Dan Polanco <polardz@google.com>
    Cr-Commit-Position: refs/heads/main@{#1598021}
2026-04-27 12:00:47 +01:00
AlexeyBarabash 6770144ba6 [cr148][Android] TopToolbarCoordinator.ctor gained 7 new parameters
Seven new parameters added to TopToolbarCoordinator constructor after
MonotonicObservableSupplier<Profile>:
- SigninAndHistorySyncActivityLauncher
- WindowAndroid
- ActivityResultTracker
- DeviceLockActivityLauncher
- BottomSheetController
- ModalDialogManager
- SnackbarManager

Chromium change:
https://source.chromium.org/chromium/chromium/src/+/c0e37322747db4f16956a53ff936c85905593c3b

commit c0e37322747db4f16956a53ff936c85905593c3b
Author: Sophie Crowley <crowleso@google.com>
Date:   Wed Mar 11 10:30:11 2026 -0700

    [Signin][Android] Add piping for Signin button onclick functionality

    This will be immediately followed by its child CL
    https://crrev.com/c/7604273 which uses all of these dependencies in
    adding Seamless Signin + settings onclick functionality for this Signin
    button. Split CL for ease of review. Adapted from
    IdentityDiscController.java

    Bug: 478828569
    Change-Id: I600617b391ac061000998b1820ba573a57079e86
    Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/7600378
    Commit-Queue: Sophie Crowley <crowleso@google.com>
    Reviewed-by: Liza Bipin <mlbipin@google.com>
    Cr-Commit-Position: refs/heads/main@{#1597857}
2026-04-27 12:00:47 +01:00
Emerick Rogul b513031b00 [cr148] Filter upstream tests as needed 2026-04-27 12:00:46 +01:00
Emerick Rogul da482eeb49 [cr148] Deps fixes 2026-04-27 12:00:45 +01:00
Emerick Rogul 00291d351f [cr148] Reanchor BraveTabSearchButton override
Upstream removed `TabSearchContainer`, so we need to move our override of
`BraveTabSearchButton` to the class where `TabSearchButton` is constructed
now (`HorizontalTabvStripRegionView`)

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

commit d43a49df6f998a2e3828a410402cc46d41fae43a
Author: Emily Shack <emshack@chromium.org>
Date:   Wed Mar 11 16:17:46 2026 -0700

    [TabOrganization] Remove TabSearchContainer

    Removes the auto tab groups nudge button, which in turn makes
    TabSearchContainer obsolete. Replaces TabSearchContainer with a direct
    reference to the tab search button itself.

    Bug: 488463961
    Change-Id: Ib1941ceabe6bccf6835c47561f9bff2a9d810bac
    Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/7651705
    Reviewed-by: Darryl James <dljames@chromium.org>
    Commit-Queue: Emily Shack <emshack@chromium.org>
    Cr-Commit-Position: refs/heads/main@{#1598058}
2026-04-27 12:00:45 +01:00
Netzenbot 7943957b04 Disable Chromium test GetDisplayMediaHiDpiBrowserTest.Capture (#35890)
Brave's canvas farbling (PerturbPixels) modifies getImageData() results,
breaking this test's canvas-based video playback detection. The test uses
canvas fingerprinting to detect video playback, which is incompatible
with Brave's privacy protections. The test only compiles on Linux
non-sanitizer builds per #if BUILDFLAG(IS_LINUX).

These filter entries were previously added (PRs #34531, #35267) but were
inadvertently removed by the automated filter pruning script in #35339.

Upstream stable: 640x480 0.6%, 3840x2160 0.3% flake rate (30-day LUCI).

Resolves https://github.com/brave/brave-browser/issues/54521
2026-04-24 14:21:49 -04:00
Netzenbot 1d8fef4c06 Disable flaky Chromium test BrowserContextDestructionVsCookieRemoval (#35716)
The test All/BrowsingDataRemoverBrowserTestP.
BrowserContextDestructionVsCookieRemoval/* has a known upstream race
condition (crbug.com/413259587) between document.cookie and the
backend SiteDataCountingHelper query via GetAllCookies(). The test
expects GetSiteDataCount() == 1 immediately after SetDataForType, but
the mojo IPC from the renderer to the network service cookie store
may not have completed. Already disabled on Windows upstream. Upstream
LUCI Analysis shows 0.5% flake rate over 30 days; amplified in
Brave's MSAN builds. Brave has no modifications to the affected code
path (first-party cookie set and count).

Resolves https://github.com/brave/brave-browser/issues/54638
2026-04-23 16:02:28 -04:00
Netzenbot 94fae4024d Disable flaky Chromium test SaveToDriveEventDispatcherBrowserTest.Notify/0 (#35842)
This is an upstream Chromium test with a 3.7% flake rate (114k+ verdicts
over 30 days per Chromium LUCI Analysis). The /0 parameter variant
(OOPIF disabled) times out during QuitBrowsers in PostRunTestOnMainThread
teardown. The /1 variant (OOPIF enabled) is stable at 0.3%.

No Brave modifications exist in chrome/browser/save_to_drive/ — no
chromium_src overrides for this code area.

Resolves https://github.com/brave/brave-browser/issues/54240
2026-04-23 15:56:50 -04:00
Brian R. Bondy fe1a9add88 Add enable_playlist buildflag gated on is_brave_origin_branded (#35732)
Introduces enable_playlist (defaults to !is_brave_origin_branded),
following the same pattern as enable_brave_wallet and enable_ai_chat,
to gate all Playlist code from compilation on origin-branded desktop
builds. enable_playlist_webui now chains through enable_playlist.

Changes are scoped to desktop: iOS and Android don't support
is_brave_origin_branded=true (enforced by asserts in
//brave/components/brave_origin/buildflags/buildflags.gni), so they
have no guards.
2026-04-23 08:23:26 -04:00
Brian Johnson 75ddc80404 Cache most recently created filter list DAT file to load on startup (#35069) 2026-04-23 06:59:06 +01:00
Emerick Rogul ace3cd7463 Upgrade from Chromium 147.0.7727.102 to Chromium 147.0.7727.117 (#35799)
* Update from Chromium 147.0.7727.102 to Chromium 147.0.7727.117.

* Update patches from Chromium 147.0.7727.102 to Chromium 147.0.7727.117.

* Updated strings for Chromium 147.0.7727.117.

* Disable failing upstream tests
2026-04-22 16:41:36 -07:00
Simon Hong 1c59e73d37 Make PageActionView's background transparent by default (#35714)
Resolves brave/brave-browser#54736

Chromium renders a solid rounded-rect background when a page action chip expands
to show its label. Brave doesn't use this background, so override
GetBackgroundColor() in the chromium_src layer to return SK_ColorTRANSPARENT
instead of falling through to the Chromium color token.

Per-action overrides via PageActionController::OverrideChipColors() are still
respected — the override path is checked first and takes precedence over the
transparent default.

Also, don't use tonal color for PageActionView's bg/fg colors when expanded.
2026-04-21 22:56:33 +09:00
Anthony Tseng 639a488d7e Enable chromium semantic history search with local embedder (#32689)
* Enable chromium semantic history search with our own embedder

* Replace history_embeddings patch with template override

Replace the trivial patch that commented out scored_url_rows.clear()
with a BraveHistoryEmbeddingsService template subclass (per
docs/gni_sources.md) that overrides OnPassageVisibilityCalculated to
always synthesize passing visibility scores (1.0), bypassing upstream's
PageContentAnnotationsService-based filtering which Brave doesn't use.

The template pattern avoids circular deps between
//brave/browser/history_embeddings and //chrome/browser:browser —
the template is instantiated at the factory site which already has
the required dep.

* Add unit tests for BraveHistoryEmbeddingsService

Run all upstream HistoryEmbeddingsService unit tests with the Brave
template subclass via chromium_src override, ensuring our visibility
bypass doesn't break any existing behavior. Add a Brave-specific test
verifying search results are preserved when the visibility model is
unavailable (upstream clears them).

* Add BraveEmbedder::Observer to notify when idle

Replace the JS-side connection tracking (boundCount /
notifyPassageEmbedderIdle) with a C++ observer pattern.
BravePassageEmbeddingsServiceController observes the embedder
and calls NotifyPassageEmbedderIdle via mojom when all jobs
complete, avoiding the renderer round-trip.

* Run LocalAIService BackgroundWebContents on guest OTR profile

The WASM embedding model doesn't need user profile data, so run
BackgroundWebContents on the guest OTR profile to isolate it from
user data.

- Make BackgroundWebContentsFactory async so it can call
  CreateProfileAsync to obtain the guest OTR profile, then
  construct BackgroundWebContentsImpl in the callback
- Inject the factory via SetBackgroundWebContentsFactory from
  browser_context_keyed_service_factories.cc (which has
  ProfileManager access) to avoid adding sources to sources.gni
- Add a static WebContents bind callback registry on
  LocalAIServiceFactory so UntrustedLocalAIUI::BindInterface can
  route mojo requests from the guest OTR WebContents back to the
  owning LocalAIService without profile-based lookup
- Simplify BravePassageEmbeddingsServiceController to use a single
  shared BraveEmbedder instead of per-profile map

* Add BravePassageEmbeddingsService in-process mojo impl

New BravePassageEmbeddingsService implements upstream
passage_embeddings::mojom::PassageEmbeddingsService in the browser
process. It hosts the guest-OTR BackgroundWebContents that runs the
WASM EmbeddingGemma renderer and owns the PassageEmbedderFactory
registration path (via local_ai::mojom::LocalAIService, which it also
implements so UntrustedLocalAIUI can route the renderer binding).

An internal BraveBatchPassageEmbedder translates upstream's batch
mojom (array<string> + priority) to the renderer's one-passage-at-a-
time interface, processing passages sequentially so callbacks resolve
with results in order.

Not yet wired to any caller — the follow-up commit switches
BravePassageEmbeddingsServiceController over to using this service
instead of the per-profile LocalAIService keyed service.

* Wire controller to launch in-process BravePassageEmbeddingsService

BravePassageEmbeddingsServiceController now mirrors
ChromePassageEmbeddingsServiceController: MaybeLaunchService()
constructs a BravePassageEmbeddingsService and binds the base class's
service_remote_ to it via an in-process mojo pipe; ResetServiceRemote()
tears it down. The constructor fires EmbedderMetadataUpdated once,
since our metadata is static (EmbeddingGemma version 1, 768-dim, 0.45)
and doesn't arrive through optimization_guide.

GetEmbeddings() override replaces the base class's file-loading flow —
we have no tflite/sentencepiece files to open — and calls
service_remote_->LoadModels() with default-constructed params
(BravePassageEmbeddingsService ignores them) before routing
GenerateEmbeddings to the bound embedder_remote_. Upstream's
SchedulingEmbedder drives the job queue end-to-end: priority re-sort
between passages, partial-progress resumption, and performance-scenario
awareness all come along for free.

The chromium_src include shim virtualizes EmbedderReady,
GetEmbedderMetadata, and GetEmbeddings via `#define X virtual X` so
the subclass can override them, and injects
`friend class BravePassageEmbeddingsServiceController` via an
EmbedderRunning macro anchor so the override can reach private
members (observer_list_ to fire the initial metadata notification,
embedder_remote_ to drive LoadModels without the upstream
model-info path).

PageEmbeddingsServiceFactory and HistoryEmbeddingsServiceFactory
overrides drop the GetBraveEmbedder(profile) hook; both now use the
base class's GetEmbedder() which returns the SchedulingEmbedder.

* Delete BraveEmbedder, LocalAIService keyed service, and orphan code

BravePassageEmbeddingsService now owns everything the old setup needed:
the background WebContents, the PassageEmbedderFactory registration,
and the static WebContents→bind-callback registry used by
UntrustedLocalAIUI::BindInterface. That removes the last reason to
keep the LocalAIService keyed service and its factory around.

Removed:
- brave_embedder.{h,cc,_unittest.cc} — replaced by upstream's
  SchedulingEmbedder + BravePassageEmbeddingsService.
- local_ai_service.{h,cc,_unittest.cc} — merged into the new service.
- brave/browser/local_ai/ entirely — factory and bind registry
  relocated to BravePassageEmbeddingsService static methods.
- LocalAIService keyed service registration from
  browser_context_keyed_service_factories.cc.
- GetPassageEmbedder / NotifyPassageEmbedderIdle from local_ai.mojom;
  those flows are now handled via the upstream PassageEmbeddingsService
  mojom and the controller's service_remote_ idle handler.

UntrustedLocalAIUI now routes binds through
BravePassageEmbeddingsService::BindForWebContents. BUILD.gn and
sources.gni are adjusted accordingly.

* Use direct BindPassageEmbedder instead of mojo LoadModels

Upstream's mojom::PassageEmbeddingsService::LoadModels requires
non-null ReadOnlyFile fields for the tflite model and sentencepiece
tokenizer; mojo's serializer DCHECKs that they are physical files
(IsPhysicalFile), which rules out /dev/null or NUL as placeholders.
Since we don't have upstream's model files at all — our renderer
loads its own EmbeddingGemma — there's no way to satisfy that
contract on the caller side.

Keep BravePassageEmbeddingsService's mojom interface for completeness
but expose a direct C++ BindPassageEmbedder(receiver, callback) entry
point and have the controller call it directly. The service_remote_
inherited from the base class is left unbound, and the embedder_remote_
idle handler now fires ResetServiceRemote so the WASM renderer is torn
down on idle.

* Add unit tests for BravePassageEmbeddingsService

Covers the core flows: BindPassageEmbedder creating the background
contents, the barrier-closure that waits for both component-installed
model files and the renderer factory registration, the batch embedder
fanning out passages to the renderer one at a time, Init failure
tearing things down, renderer crash triggering close, and the static
WebContents→bind-callback registry used by UntrustedLocalAIUI.
2026-04-21 03:48:17 +01:00
Pavel Beloborodov ebbb41978f Added ENABLE_EMAIL_ALIASES buildflag. (#35528)
* Added ENABLE_EMAIL_ALIASES buildflag.
2026-04-20 20:33:07 +07:00
Aleksei Khoroshilov a3bb6a13a0 Add containers support to bookmarks context menu. (#35535)
* Add containers support to bookmarks context menu.

* Few review fixes.

* Adjust browser_ check.
2026-04-20 12:42:25 +01:00
Simon Hong e00ca7c9da Fixed brave_browser_tests runtime crash due to missing deps (#35652)
If this target is built before other targets, it crashed due to missing resources.
2026-04-20 18:36:15 +09:00
Simon Hong 310864348e Add brave_interactive_ui_tests target and convert Commander MANUAL tests (#35617)
Resolves https://github.com/brave/brave-browser/issues/54558

- Adds a brave_interactive_ui_tests test executable to brave/test/BUILD.gn mirroring Chromium's
   interactive_ui_tests target. It reuses chrome/test/base/interactive_ui_tests_main.cc directly
   to avoid divergence with upstream
- Converts MANUAL_HideClearsText and MANUAL_CanHideCommanderViaText from
   commander_service_browsertest.cc into proper interactive UI tests in a new 
   brave/browser/ui/commander:interactive_ui_tests source set as a real example                    
   
Tests rewritten with InteractiveBrowserTest.                                                                     
The new tests use RunTestSequence with PollState/WaitForState instead of timer-based polling,
which is the upstream-recommended pattern for async conditions in interactive UI tests

TEST=`npm run test brave_interactive_ui_tests -- --filter=CommanderServiceInteractiveUITest.*`
2026-04-18 06:30:18 +09:00
Anthony Tseng 9df0bef8ab Reland "[AI Chat] Support text file uploads with renderer-based extraction"" (#35613)
Revert "Revert "[AI Chat] Support text file uploads with renderer-based extra…"

This reverts commit c0e4f7effd.
2026-04-17 12:06:01 -07:00
Darnell Andries 0a7437712c Ignore unknown attribute names in P3A manifest (#35421)
* Ignore unknown attribute names in P3A manifest

* Address PR feedback
2026-04-17 11:37:33 -07:00
Serg 90fadf6259 [Android] Register Brave as Android AutofillService for address autofill (#35567)
* [Android] Register Brave as Android AutofillService for address autofill

Re-enables the Android AutofillService that was removed in
https://github.com/brave/brave-core/pull/25759 due to crashes on
split-APK installs. Uses the SplitCompat pattern
(SplitCompatAutofillService base class) so the service works correctly
when installed from the Play Store.

When the user selects Brave as their autofill provider in Android Settings,
Brave can fill saved address profiles into third-party apps and save new
addresses from manually filled forms.

Resolves: https://github.com/brave/brave-browser/issues/41334
2026-04-16 14:23:41 -04:00
Anthony Tseng c0e4f7effd Revert "[AI Chat] Support text file uploads with renderer-based extraction" (#35582)
Revert "[AI Chat] Support text file uploads with renderer-based extraction (#…"

This reverts commit 0a0068baf7.
2026-04-16 17:53:48 +01:00
Brian R. Bondy 7fb7c7af69 Disable Chromium's default PDF viewer infobar (#35556)
The kPdfInfoBar feature (enabled by default in Chromium) prompts users
to set Chrome as the default PDF viewer. Brave should not show this
Chrome-specific upsell.
2026-04-15 22:24:29 -04:00
Anthony Tseng 0a0068baf7 [AI Chat] Support text file uploads with renderer-based extraction (#35305)
* [AI Chat] Add kText file type and ProcessTextFile mojom interface

Add kText to UploadedFileType enum and ProcessTextFile method to
AIChatUIHandler for upcoming text file upload support. Include iOS
no-op implementation.

* [AI Chat] Add TextFileExtractor for text file upload

Add TextFileExtractor subclass of FileTextExtractorBase that extracts
text via document.body.innerText after loading the file in a hidden
WebContents. The renderer handles MIME sniffing and encoding detection.

* [AI Chat] Add text file type detection and unfiltered file picker

Treat all non-image/non-PDF files as text (kText), letting the
renderer handle MIME sniffing — matching how Chromium's
Browser::OpenFile works. Remove extension-based file picker filtering.

* [AI Chat] Integrate TextFileExtractor into page handler

Add ProcessTextFile mojo endpoint implementation and text extraction
in the file picker upload flow. Text files from the file picker are
extracted via TextFileExtractor after PDF extraction completes.

* [AI Chat] Add text file content blocks for LLM engine

Handle kText uploaded files in BuildOAIMessages by sending extracted
text as TextContentBlock with "[File: filename]" prefix, following
the same pattern as PDF text extraction.

* [AI Chat] Add frontend support for text file uploads

Accept all files in drag-and-drop and paste. Handle non-image/non-PDF
files as text via processTextFile mojo call. Treat kText as document
type for upload limits. Display text files with file icon.

* [AI Chat] Add unit tests for text file type detection

Update AcceptedFileExtensions test for unfiltered file picker.
Add tests for text file handling: known extension (.txt),
extensionless files, and unknown extensions (.diff).

* [AI Chat] Show alert when files cannot be read as text

Show an error alert via Leo AlertCenter when uploaded files are
dropped because the renderer could not extract text from them
(e.g. binary files, unsupported formats).

* [AI Chat] Move ExtractText overloads to FileTextExtractorBase

Both PdfTextExtractor and TextFileExtractor had identical
ExtractText implementations. Move both the file-path and
file-bytes overloads to the base class. PdfTextExtractor
keeps a convenience overload that passes "pdf" as extension.

* [AI Chat] Unify PDF and text file extraction into a single flow

Use one barrier callback and one extractors_ vector instead of
separate pdf_extractors_/text_extractors_ and chained extraction
passes. This removes duplicated scanning, barrier setup, and
per-file callback logic.
2026-04-15 21:11:01 +01:00
Emerick Rogul 97df25e99b Script for pruning obsolete upstream test filters (#35339)
* Add script to prune obsolete tests from our filters

* Disable obsolete tests
2026-04-14 18:55:33 -04:00
Aleksei Khoroshilov d00725b79c Remove container storage on container removal. (#35106)
* Remove container storage on container removal.

* Review fixes.

* Add comments to the delegate.

* Add delegate unit tests.
2026-04-13 19:07:12 +07:00
Brian CliftonandShivan d7cee10cab Allow users to disable extension updates via brave://flags (#35301)
* Create a new feature for toggling extension updates

Also creates an entry on brave://flags

Fixes https://github.com/brave/brave-browser/issues/7200

* Wire up the extension update check to the feature

* Update browser/about_flags.cc

Co-authored-by: Shivan <shivankaulsahib@gmail.com>

---------

Co-authored-by: Shivan <shivankaulsahib@gmail.com>
2026-04-10 13:40:20 -07:00
Netzenbot 83c86129c1 Disable UpdateMetricsProviderBrowserTest.RunInBackground on all platforms (#35399)
Disable UpdateMetricsProviderBrowserTest.RunInBackground in cross-platform filter

Move the test from browser_tests-windows.filter to browser_tests.filter so it
is disabled on all platforms (Linux, macOS, Windows). The upstream flake affects
any platform where a previous test subprocess exits uncleanly.

Resolves brave/brave-browser#54247
2026-04-09 13:29:50 -04:00
Netzenbot d0eee2fc91 Disable flaky Chromium test PageStabilityMetricsTest.NetworkAndMainThreadIdle (#35281)
This upstream Chromium browser test intermittently fails in Brave
builds due to the same root cause as the already-disabled
PageStabilityMetricsMinWaitTest.NetworkAndMainThreadIdleDelayed:
Brave's cosmetic filters inject a MutationObserver and setInterval
(500ms) polling on all pages, generating continuous renderer tasks
that prevent the IdlenessDetector's 500ms quiet window from completing
before the 4-second page stability timeout fires.

The test expects kNetworkAndMainThread outcome (bucket 1) but gets
kTimeout (bucket 5) because NetworkBecameIdle is never signaled.

Upstream flake rate is 1% over 30 days per LUCI Analysis. Not
disabled upstream. Brave modifications exist in the actor directory
via chromium_src but do not affect page stability monitoring.

Resolves https://github.com/brave/brave-browser/issues/54205
2026-04-06 16:58:50 -04:00