156 Commits
Author SHA1 Message Date
samartnik 9c94331634 [Android] Respect Show search suggestions in search widget (#36781)
* [Android] Respect `Show search suggestions` in search widget

* [Review] Use BravePref for the preference

* [Review] Change default value when profile is not ready
2026-05-28 17:49:13 +01:00
AlexeyBarabash 56fcfc94c6 [cr148] Moved profile_manager.h to the new target
Chromium change:
https://source.chromium.org/chromium/chromium/src/+/fa00b2f67d04301745eb9556038bc7290ce50079

commit fa00b2f67d04301745eb9556038bc7290ce50079
Author: Vasilii Sukhanov <vasilii@chromium.org>
Date:   Fri Mar 27 08:21:30 2026 -0700

    Move profile_manager.h to the new target.

    Many targets depend on this include. The CL moves it from chrome/browser/BUILD.gn to a smaller target. As a side effect the following files can also be moved:
    - "profile_metrics.*"
    - "profile_shortcut_manager.*"
    - "profile_destroyer.*"
    - "profile_manager.cc"

    AX-Relnotes: n/a.

    Bug: 353332589
    Change-Id: Iecaeebf68b32d6af39306ff6a755a97881cfe3fa
    Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/7055004
    Commit-Queue: Vasilii Sukhanov <vasilii@chromium.org>
    Reviewed-by: Alex Ilin <alexilin@chromium.org>
    Cr-Commit-Position: refs/heads/main@{#1606230}
2026-04-27 12:00:55 +01:00
Serg 461d66e02c [Android] Shows Brave Wallet UI based on policy. (#33630)
* [Android] Shows Brave Wallet UI based on policy.

Resolves: https://github.com/brave/brave-browser/issues/52496
2026-02-04 10:08:30 -05:00
Artem Samoilenko 79cb1bbb57 [cr145][Android] Replace JavaParamRef -> JavaRef
Chromium changes:
https://chromium.googlesource.com/chromium/src/+/0d6ec7e0f328e9ddd6f5174f61676ff85c777af6

commit 0d6ec7e0f328e9ddd6f5174f61676ff85c777af6
Author: Andrew Grieve <agrieve@chromium.org>
Date:   Tue Dec 2 12:37:02 2025 -0800

    Android: Replace JavaParamRef -> JavaRef (part 5)

    JavaParamRef used to be different, but now is an alias for JavaRef.

    Bug: 40173007
    Change-Id: I9bfa2fcdd012fc90859886ee2e747cb360733421
    Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/7217772
    Commit-Queue: Andrew Grieve <agrieve@chromium.org>
    Owners-Override: Andrew Grieve <agrieve@chromium.org>
    Reviewed-by: Martin Kong <martinkong@google.com>
    Cr-Commit-Position: refs/heads/main@{#1553033}
2026-01-29 13:40:24 -05:00
Artem Samoilenko a79268cd0e [cr145][Android] Add DEFINE_JNI macro to the end of every file (part 1)
Chromium changes:
https://chromium.googlesource.com/chromium/src/+/37865ec47270489182e954bb9a6dc32c04fd51d7

commit 37865ec47270489182e954bb9a6dc32c04fd51d7
Author: Martin Kong <martinkong@google.com>
Date:   Mon Dec 1 08:47:18 2025 -0800

    Add DEFINE_JNI macro to the end of every file (part 1)

    This CL adds DEFINE_JNI(ClassName) macro to the end of every file
    that includes ClassName_jni.h. Currently the macro expands to nothing.

    Bug: 346596940
    Change-Id: I61da4d1cc46f71d8ede30f74b267237a5f8cf14f
    Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/7206009
    Commit-Queue: Andrew Grieve <agrieve@chromium.org>
    Auto-Submit: Martin Kong <martinkong@google.com>
    Reviewed-by: Andrew Grieve <agrieve@chromium.org>
    Owners-Override: Andrew Grieve <agrieve@chromium.org>
    Cr-Commit-Position: refs/heads/main@{#1552186}
2026-01-29 13:40:19 -05:00
Serg ec99d6c72e [Android] Shows Brave News UI based on policy. (#33342)
Resolves: https://github.com/brave/brave-browser/issues/52170
2026-01-21 21:48:09 +00:00
Brian Clifton c1def2b65a Remove obsolete setting from search settings (#32950)
* Remove obsolete setting from search settings

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

* lint fixup
2025-12-29 14:51:19 -07:00
Brian R. Bondy a4d9248fcb Add enable_brave_wallet gn var and build flag (#32484)
* 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
2025-11-28 15:54:27 -05:00
Szilard Szaloki 8698c26abb [Android] Sync Account section with registration flow. (#32319) 2025-11-14 22:31:31 +01:00
Brian Johnson 1f27a328c6 [Speedreader] Remove speedreader on android (#31418)
Remove buggy speedreader implementation on android
2025-09-29 11:52:46 +09:00
Serg 89ce54707b Android origin skus (#31431)
* 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
2025-09-27 09:06:27 +09:00
StephenHeaps 5e101d4731 fix(privacy): Move Brave Shields utility functions to shared location (#29736)
* 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.
2025-07-14 09:33:26 -04:00
Simone Arpe e2a5b49706 Remove usage of BravePrefServiceBridge for boolean background video playback (#29197)
* Remove usage of `BravePrefServiceBridge` for boolean background video playback

* Use mTabModelProfileSupplier as settings UI always use original profile
2025-05-28 16:05:26 -07:00
Deep Pandya 8cec452b21 Remove SafetyNet android (#26719)
* Remove safetynet changes android

Resolve presubmit issue

Remove safetynet directory

* Clear kSafetynetStatus pref

* Remove and clear kSafetynetCheckFailed pref

Register kSafetynetStatus in brave_prodfile_prefs

* Remove BraveUpgradeJobIntentService

* Remove safetynet key
2025-02-10 09:56:43 -05:00
Kevin Smith 4cc241a866 Reconfigure Rewards component folder structure (#27270)
Fix directory structure per https://www.chromium.org/developers/design-documents/cookbook/
2025-01-31 13:47:34 -07:00
Brian Johnson afd4e0239d fix overly permissive DEPS (#27193)
Fix overly permissive deps
2025-01-12 21:43:04 -07:00
Jocelyn Liu efcb1df7c6 Remove enable_ai_chat buildflag 2024-10-31 20:15:18 -07:00
mkarolin 368705e25a //chrome/browser/content_settings was modularized.
Chromium change:

https://chromium.googlesource.com/chromium/src/+/7b0f4a87890ea

commit 7b0f4a87890eada6c8e66ade31a1524ddd6ba6d3
Author: Erik Chen <erikchen@chromium.org>
Date:   Thu Sep 26 21:34:14 2024 +0000

    Reland "Modularize //chrome/browser/content_settings"

    This reverts commit 33aad0933b53aa545d0d2f5f04e158f205ff9740.

    Reason for revert:
    Original CL should not have been reverted.

    Original change's description:
    > Revert "Modularize //chrome/browser/content_settings"
    >
    > This reverts commit b9c3338d51a8b30884cb17b9f7b227fd83bd89e9.
    >
    > Reason for revert: Breaks android-desktop-x64-archive-rel and android-desktop-arm64-archive-rel:
    > https://ci.chromium.org/ui/p/chromium/builders/ci/android-desktop-x64-archive-rel/1999/overview
    >
    > Original change's description:
    > > Modularize //chrome/browser/content_settings
    > >
    > > Bug: 369423337
2024-10-24 12:14:30 +01:00
Brian Johnson 6775aa1855 remove check_includes = false from browser/android/preferences (#25686)
Remove check_includes = false from browser/android/preferences
2024-10-08 10:53:58 -07:00
cdesouza-chromium e1f8a28431 [CodeHealth] Use constexpr strings (#25810)
Use `constexpr` strings

This PR changes moves away from uses of `const char` with two
approaches. For `.cc` files, these types are turned into constexpr ones,
which gives the compiler more leeway for optimisations.

For the constants on header files, we are converting these instances to
`inline constexpr`, in order to also reduce string duplication across
the binary.

This change was generated with a tool.
2024-10-04 10:01:05 -07:00
Artem Samoilenko 5cdf81ea05 [Android] Added dep to explicitly generate jni headers for preferences
This fixes the following build issue:
../../brave/browser/android/preferences/brave_pref_service_bridge.cc:6:10: fatal error: 'brave/build/android/jni_headers/BravePrefServiceBridge_jni.h' file not found
    6 | #include "brave/build/android/jni_headers/BravePrefServiceBridge_jni.h"
2024-09-10 14:42:50 -04:00
deeppandya 098bb8a68c Update deps to resolve gn issues 2024-08-16 00:28:39 +05:30
deeppandya e22594f8b1 Add an option for index other serach engines 2024-08-16 00:28:37 +05:30
deeppandya 86694abad2 Add search_engine prefs for android 2024-08-16 00:28:34 +05:30
vadimsandNuo Xu 43735ef5b2 Deprecate local node support and ipfs scheme (#23808)
deprecated IPFS local node support and IPFS scheme
https://github.com/brave/brave-browser/issues/37735
---------

Signed-off-by: Vadym Struts <vstruts@brave.com>
Co-authored-by: Nuo Xu <nuoxu.nx@gmail.com>
2024-07-09 12:34:31 +02:00
Artem Samoilenko e5d34071ef [Android] Remove remnants of ProfileAndroid
Chromium change:
https://source.chromium.org/chromium/chromium/src/+/8d32d8bc17cad5c37c8e5869501e1e8e3283bc47

Android: Remove remnants of ProfileAndroid

ProfileAndroid was merged with Profile, so just use Profile directly
everywhere.

Bug: b/339851174
2024-06-25 13:13:07 +01:00
Serg 68d8ab7694 Enabled bg playback flag on Android by default 2024-06-06 11:12:05 -04:00
Darnell Andries cffd7732f0 Add "day zero" feature, add metrics for "day zero" 2024-03-21 13:55:22 -07:00
Artem Samoilenko 1d11921670 [Android] Translate pref names were moved to header
Chromium change:
https://source.chromium.org/chromium/chromium/src/+/a4c48222fda7787f88f27bbfd4aa589eaf1cfeb9

Translate: Make all pref names `constexpr`

This will allow using them in `consteval` contexts, specifically
`MakeFixedFlatMap()` - see linked bug for more context.
(It's also arguably preferable anyway - they're now all in one place,
the header, rather than split across .h and .cc.)

Bug: 1512537
2024-03-08 09:17:44 -03:00
Jacob Sikorski ab332ff65c Cleanup brave_shields component 2024-02-12 15:47:01 -07:00
Jacob Sikorski 1ac7c89839 Add DebounceService for iOS (#20315)
* Add DebounceService for iOS

* Remove imports
2024-02-05 19:20:26 -07:00
deeppandya e853517923 Add ZeroDayFlag to feature list
Update style for ZeroDayFlag
2024-01-28 20:11:55 -05:00
AlexeyBarabash 02909e2166 Fixed gn_check tool error for Android without enable_ai_chat flag (#21286)
Fixed gn_check tool error for Android without enable_ai_chat flag; fixes brave/brave-browser#34760
2023-12-08 12:57:31 +02:00
cdesouza-chromium 75bbf7d53c Convert various extern strings to constexpr (#20959)
These change are being done to make use of `absl::StrFormat` in the
future, and also to get some better codegen with these constants.
There's also some harderning on upstream code to avoid unnecessary
conversions involving constants, which can only be enforced in a
`constexpr` constext.
2023-11-15 09:02:30 +00:00
Brandon-T 06bc0b8974 Fix #33451: Refactor ai_chat component for iOS (#20425)
Refactor ai_chat_tab_helper to platform generic, so that iOS can use the same core code for its APIs.

With this change, iOS is able to supply a web-page, URL, and all of the things Desktop does.

Fix layering violation.

Fix iOS not compiling due to unit tests that include "content".

Renamed from AIChatDriver to ConversationDriver
2023-11-08 13:02:32 -05:00
Serg 875a2bc14a Opens Android Brave Leo Settings page on a web ui Settings click 2023-10-13 11:47:11 -04:00
Serg 88dd443003 Adds Reset Leo data preference on Android 2023-10-13 11:47:11 -04:00
Mark Pilgrimanddeeppandya 87cece9f32 Add Android settings UI and enable Android support for OTR tab (#18931)
* Add Android pref for Request OTR

* Update android UI changes

* .

* exclude browser tests on Android

* build fiddling

* remove platform gate on string resources

* fix Android include

* fix link error

* fix Android test

* normalize capitalization

---------

Co-authored-by: deeppandya <deeppandya91@gmail.com>
2023-07-04 03:49:03 +02:00
wchen342 04ab04e829 Add prompt for speedreader 2023-03-07 13:04:22 +02:00
Jay Harris 492eb68e49 Rename Brave Today to Brave News (#17265) 2023-02-24 13:22:47 +13:00
wchen342 3ee7f22fa0 Remove more BravePrefServiceBridge functions 2023-01-20 22:31:59 +02:00
AlexeyBarabash 0b34338030 Move UD/ENS/SNS prefs from BravePrefServiceBridge to BraveLocalState Java wrapper 2023-01-04 15:00:51 +02:00
AlexeyBarabash 121f8d576b Removed unused Java/JNI methods:
- BravePrefServiceBridge.setReferralAndroidFirstRunTimestamp;
- BravePrefServiceBridge.setReferralCheckedForPromoCodeFile;
- BravePrefServiceBridge.setReferralInitialization;
- BravePrefServiceBridge.setReferralPromoCode;
- BravePrefServiceBridge.setReferralDownloadId.
2023-01-04 12:13:09 +02:00
AlexeyBarabash 0d73687b06 Move safetynet status pref from BravePrefServiceBridge to BraveLocalState Java wrapper 2023-01-04 12:13:09 +02:00
AlexeyBarabash 1e7774c179 Move stats reporting pref from BravePrefServiceBridge to BraveLocalState Java wrapper 2023-01-04 12:13:09 +02:00
AlexeyBarabash 26afec4595 Move P3A prefs from BravePrefServiceBridge to BraveLocalState Java wrapper 2023-01-04 12:13:09 +02:00
Anton Paymyshev cc7c53d244 ENS offchain support for android (#16453) 2022-12-29 14:05:34 +07:00
Anton Paymyshev 6c732a6aad Sns pref for android 2022-12-16 16:00:36 +07:00
Cepera 8f2fdbea9b Refactoring for components/brave_vpn folder (#16319)
* Move kLocalizedStrings -> brave_vpn_localized_string_provider

* Move shared code to common folder

* Move BraveAPI related code to api folder

* Move connection related code to `connection` folder

* Move components/brave_vpn/[api,connection,.cc,.h,.gn] -> components/brave_vpn/browser/[api,connection,.cc,.h,.gn]
2022-12-15 21:49:05 +03:00
wchen342 bfe7ffc519 Remove usage of BravePrefServiceBridge for boolean BravePrivacySettings 2022-12-13 21:17:18 +02:00