* fix: remove secret key material from log messages
CRITICAL: Several VLOG(1) statements were logging plaintext secret
key material that could be captured via adb logcat (Android) or
Console.app (iOS):
- browser/android/brave_sync_worker.cc: Sync recovery phrase (seed
words) and hex-encoded sync seed logged on parse failure
- ios/browser/api/sync/brave_sync_worker.cc: Same issue on iOS
- components/brave_wallet/browser/filecoin_keyring.cc: Import payload
containing Filecoin private key logged on JSON parse failure
These log statements would expose the user's master sync secret or
private key material to any process with log access. The fix removes
the secret material from all log messages while preserving the
diagnostic error information.
* fix: also redact plaintext sync code from LOG(ERROR) in SetSyncCode (iOS) and SaveCodeWords (Android)
* fix: apply clang-format to sync worker files
* Add enable_brave_wallet GN variable and build flag
This adds a new GN build flag 'enable_brave_wallet' that can be set to
false to exclude Brave Wallet from the build. The flag is true by default
to maintain current behavior.
Changes include:
- Add enable_brave_wallet declare_args in build/config/BUILDCONFIG.gn
- Create brave_wallet/common/buildflags with ENABLE_BRAVE_WALLET flag
- Update all BUILD.gn and sources.gni files to use the new flag
- Add wallet buildflags dependencies via minimal one-line imports
* Add patches for wallet buildflags in Chromium BUILD files
Adds minimal one-line patches to import wallet buildflags dependencies
in Chromium source files. This allows Chromium code to conditionally
depend on wallet headers.
Patches:
- chrome/browser/ui/hid/BUILD.gn
- net/BUILD.gn
- third_party/blink/common/BUILD.gn
- third_party/blink/public/common/BUILD.gn
- third_party/blink/renderer/modules/permissions/BUILD.gn
* Guard wallet code in Chromium source overrides
Updates chromium_src overrides to conditionally compile wallet-related
code based on enable_brave_wallet flag. This includes:
- Adding DEPS files to allow buildflags dependencies
- Guarding wallet permission handling with #if BUILDFLAG(ENABLE_BRAVE_WALLET)
- Keeping wallet permission enum values unconditionally to maintain profile
interchangeability between wallet-enabled and wallet-disabled builds
- Updating component registration and preference handling
Key changes:
- Permission enums remain stable across build configs for UMA and persistence
- Wallet permission handling code only compiled when wallet enabled
- DEPS files updated to allow buildflags includes
* Guard wallet UI code in front-end TypeScript and Mojom
Conditionally compiles wallet-related UI code in TypeScript and Mojom
interfaces based on enable_brave_wallet preprocessor flag.
Changes:
- Settings menu: Use lastInserted pattern for menu item ordering
- Page visibility: Guard wallet page visibility checks
- Browser commands: Guard wallet command handling
- Routes: Conditionally include wallet routes
- Add non-null assertions for DOM insertions in TypeScript
- Update Mojom interfaces to conditionally include wallet enums
Front-end code uses <if expr="enable_brave_wallet"> preprocessor
directives to exclude wallet UI when the feature is disabled.
* Guard wallet usage in non-wallet Brave code
Conditionally compiles wallet-related code in non-wallet Brave files
based on enable_brave_wallet build flag.
Changes include:
- browser/: Guard wallet service factories, preferences, and helpers
- components/: Guard wallet dependencies in rewards, sidebar, and DNS
- renderer/: Conditionally register wallet content settings
- utility/: Guard wallet component registration
- ios/: Add optional chaining for wallet feature flags
- test/: Guard wallet-related test code
Key files:
- brave_stats_updater.cc: Guard wallet pref registration with #if
- brave_profile_prefs.cc: Conditionally register wallet preferences
- sidebar_service.cc: Guard wallet panel items
- iOS WalletConstants.swift: Use optional chaining for feature checks
This allows building Brave without wallet while maintaining profile
compatibility between wallet-enabled and wallet-disabled builds.
* Add static_assert for ENABLE_BRAVE_WALLET in wallet headers
Adds compile-time assertions to wallet headers to ensure they are only
included when wallet is enabled. This prevents accidental usage of wallet
APIs when enable_brave_wallet=false.
Added static_assert(BUILDFLAG(ENABLE_BRAVE_WALLET)) to:
browser/brave_wallet/ (11 files):
- asset_ratio_service_factory.h
- brave_wallet_context_utils.h
- brave_wallet_ipfs_service_factory.h
- brave_wallet_provider_delegate_impl.h
- brave_wallet_service_factory.h
- brave_wallet_tab_helper.h
- meld_integration_service_factory.h
- wallet_notification_service_factory.h
- simulation_service_factory.h
- swap_service_factory.h
- wallet_data_files_installer_delegate_impl.h
components/brave_wallet/browser/ (15 files):
- brave_wallet_p3a_private.h
- brave_wallet_prefs.h
- brave_wallet_service.h
- brave_wallet_utils.h
- ens_resolver_task.h
- json_rpc_service_test_utils.h
- json_rpc_service.h
- keyring_service_observer_base.h
- keyring_service.h
- network_manager.h
- permission_utils.h
- pref_names.h
- test_utils.h
- tx_service.h
- wallet_data_files_installer.h
components/brave_wallet/common/ (6 files):
- brave_wallet_types.h
- common_utils.h
- eth_abi_utils.h
- features.h
- hex_utils.h
- pref_names.h
Also includes minor wallet code updates to use buildflags and
guard zcash-specific test code.
* Follow up fixes after Parts 1-7
This migration has been effected in upstream, but several places in our
codebase got broken by this transition. This change makes several parts
of our codebase more friendly to passing `string_view`.
Chromium changes:
https://chromium.googlesource.com/chromium/src/+/0e1784e3cf990560b173f40338e582f50aba0e85
commit 0e1784e3cf990560b173f40338e582f50aba0e85
Author: Charlie Harrison <csharrison@chromium.org>
Date: Fri Oct 3 11:04:26 2025 -0700
RELAND: Migrate GURL::path() and friends to return string_view
This relands crrev.com/c/7003625. Missing cases were found by staring
at the output of `git grep` for the whole codebase.
Origin description:
Also migrates some last remaining callers of the std::string APIs.
This completes phase 1 of crbug.com/448174617.
Bug: 448174617
Change-Id: I7f24f81d1fbf129d8b0dd94f4cf948626deab933
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/7007010
Reviewed-by: Daniel Cheng <dcheng@chromium.org>
Commit-Queue: Charlie Harrison <csharrison@chromium.org>
Cr-Commit-Position: refs/heads/main@{#1524878}
Error fixed:
../../chrome/browser/android/preloading/android_prerender_manager.cc:56:39: error: no member named 'new_tab_page_preload_pipeline_manager' in 'tabs::TabFeatures'
56 | return tab ? tab->GetTabFeatures()->new_tab_page_preload_pipeline_manager()
Chromium changes:
https://chromium.googlesource.com/chromium/src/+/8965a614fb0e5c650f888a8644bbbfa9ae433635
commit 8965a614fb0e5c650f888a8644bbbfa9ae433635
Author: Robert Lin <robertlin@chromium.org>
Date: Wed Oct 1 20:18:36 2025 -0700
Migrate NewTabPagePreloadPipelineManager to TabFeatures
According to `docs/chrome_browser_design_principles.md`, TabFeatures
is preferred for all tab-centric features. This CL migrates
NewTabPagePreloadPipelineManager to TabFeatures
Bug: 421941586
Change-Id: Id48373979e7b6750e24c3bc60365a0760bf252ea
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/6980603
Reviewed-by: Tom Lukaszewicz <tluk@chromium.org>
Commit-Queue: Huanpo Lin <robertlin@chromium.org>
Reviewed-by: Sky Malice <skym@chromium.org>
Cr-Commit-Position: refs/heads/main@{#1523984}
This PR corrects several places where `BASE_FEATURE` is being used to
rely on the two-arg variant of this macro. This particular PR has no
functional changes, and the only feature declarations affected are the
ones for which the feature-name constant, and the actual value are
identical.
The particular issue for this will be left open so subsequent work for
the other features can be followed up on.
Bug: https://github.com/brave/brave-browser/issues/50492
* Connects GPS Brave Origin purchase with SKUs SDK
We need to pass order token to the SKUs SDK to be able to register
Brave Origin purchase from Google Play Store on Android. The commit
exposes Brave domains util functions and SkusService via mojom to
Java.
Resolves: https://github.com/brave/brave-browser/issues/49619
* Move BraveYouTubeScriptInjectorNativeHelper to main app layer so it can reference BraveActivity
* Save boolean flag in activity bundle
* Add small delay to let the layout pass to complete
This fix ensures that YouTube videos on Android can properly handle the transition from fullscreen playback to Picture-in-Picture mode without interference from automatic screen orientation changes.
Refactors and improves the Picture-in-Picture (PiP) functionality for YouTube videos in Brave Android browser.
The changes focus on better integration, cleaner architecture, improved reliability, and proper handling of Android system settings.
Chromium change:
https://chromium.googlesource.com/chromium/src/+/62d53e38d8025e6de29b6b74ee866c6dd6887a4b
commit 62d53e38d8025e6de29b6b74ee866c6dd6887a4b
Author: Antonio Gomes <tonikitoo@igalia.com>
Date: Fri Jun 20 16:06:53 2025 -0700
Introduce //chrome/browser:flags
.. that today compiles about_flags.h and flag_description.h
What is more, this new target is added temporarly as part of the
`public_deps` of //c/b:b, not to change the status quo - ie all targets
that today depend on //c/b:b to include these headers will continue to.
However, in a follow up:
1/ //c/b:flags will be removed from the `public_deps` of //c/b:b, and all
targets that depend on it will list it explicitly.
In practice, the newly added GN target //c/b:flags also allows the componentization
of .cc files of chrome/browser/ui/toolbar/chrome_labs/, without circular dependencies
against //c/b:b.
Bug: 369436587
* Move Brave Shields utility functions
- Move utility functions that are not using `//content/` from `/components/brave_shields/content/` to `/components/brave_shields/core/` so it can be also be accessed by iOS.
* Update tests
- Update tests after moving functions from `/components/brave_shields/content/` to `/components/brave_shields/core/`.
* Fix UNSAFE_TODO
- Update brave_shields_p3a.cc to address unsafe buffer warnings.
This PR does IWYU for the following files:
- base/strings/utf_string_conversions.h
- base/i18n/number_formatting.h
This is a mechanical change, and for more details, check the issue
description.
Resolves https://github.com/brave/brave-browser/issues/47060
This function was already gutted functionally, and now this
functionality is exclusive to ChromeOS.
Chromium changes:
https://chromium.googlesource.com/chromium/src/+/4c52eb14ee5ad97ee65048fc7649ded426f7fa63
commit 4c52eb14ee5ad97ee65048fc7649ded426f7fa63
Author: Mikel Astiz <mastiz@chromium.org>
Date: Wed May 14 02:50:23 2025 -0700
[sync] Remove SetSyncFeatureRequested API
Gradually and definitely starting with the recent
https://crrev.com/c/6533710, SyncService::SetSyncFeatureRequested() did
nothing outside ChromeOS.
On ChromeOS, starting with https://crrev.com/c/6540467, there is a
better API to use in SyncUserSettings.
In this patch, ChromeOS callers are migrated to the better API and
everything else is cleaned up as they are no-op calls. As a result, the
SetSyncFeatureRequested API itself, as well as the Java counterpart, can
be safely deleted.
Bug: 40772592,40911173
Change-Id: I716ac1e59cc99afccf313697c0121858d19898c8
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/6540075
Commit-Queue: Mikel Astiz <mastiz@chromium.org>
Reviewed-by: Marc Treib <treib@chromium.org>
Cr-Commit-Position: refs/heads/main@{#1459963}
* Make `IsBackgroundVideoPlaybackEnabled` method more readable
* Rename background_video_player_tab_helper into youtube_script_injector_tab_helper
* Apply code formatting
* Tweak background video playback description in flag page
* Remove redundant call to allow Javascript injection
The method `content::RenderFrameHost::AllowInjectingJavaScript()` is already called in
`background_video_playback_tab_helper` for those domains that correctly have a match so
it's not needed in `brave_browser_main_parts`.
* Fix boolean logic
* Make `IsBackgroundVideoPlaybackEnabled` method more readable
* Remove unneeded predefined default value from XML
* Refactor logic and remove old code
* Enable background video playback preference by default
* Remove unused constant
* Remove usage of `BravePrefServiceBridge` for boolean background video playback
* Use mTabModelProfileSupplier as settings UI always use original profile
Chromium change:
https://chromium.googlesource.com/chromium/src/+/715ac48128b5de0e854c4233dbb922249b950e54
[Tabs] TabAndroid implements TabInterface
In order to use tab_collection for Chrome Android a TabInterface
implementation is required. The logical candidate for this is
TabAndroid. This CL has TabAndroid implement TabInterface with most
methods currently being stubbed out with NOTIMPLEMENTED until future
CLs.
Notable changes:
- Some existing TabAndroid users wanted WeakPtr<TabAndroid> this
collided with TabInterface::GetWeakPtr so a renamed
GetTabAndroidWeakPtr is added and existing callers are migrated.
- TabFeaturesAndroid is renamed to tabs::TabFeatures to fulfill
the definition of the forward declaration of TabFeatures in
TabInterface. While we could put in more effort to share a
TabFeatures interface in components/tabs/ this would likely
introduce lots of buildflags and has some blockers due to a
dependency on chrome/... This is a possible follow-up.
- SplitTabId is redefined in tab_android.h temporarily until it
can be migrated to components/tabs/ in order to be shared.
Bug: 409366905
Implements a strategy to bring back picture in picture support for YouTube videos.
Picture in picture implementation is behind feature flag `kBravePictureInPictureForYouTubeVideos` enabled by default.
Test coverage has been extensively discussed and introduced to make sure:
- We don't have race conditions when injecting the JS script
- We don't inject the script multiple times on same page navigation
- We don't create side effects in case of unexpected changes, and/or serialzed flags don't match
- We inject/modify the serialized flags in case of partial match
---------
Co-authored-by: bridiver <34129+bridiver@users.noreply.github.com>