65 Commits
Author SHA1 Message Date
Brian R. Bondy 66f4b76ae3 Gate BraveRewardsDisabled policy on ENABLE_BRAVE_REWARDS (#36587)
Brave Origin builds compile out Brave Rewards
(enable_brave_rewards = !is_brave_origin_branded), but the
BraveRewardsDisabled policy was still registered unconditionally, so
brave://policy listed it on Brave Origin builds even though the feature
isn't present.

Wrap the BraveRewardsDisabled entry in kBraveSimplePolicyMap and the
matching kBraveOriginProfileMetadata entry in #if
BUILDFLAG(ENABLE_BRAVE_REWARDS), mirroring how Wallet, Talk, AI Chat,
etc. are gated. The unit test assertions and BUILD.gn rewards deps move
under the same buildflag.

Fixes brave/brave-browser#55558
2026-05-25 16:32:22 -04:00
Szilard Szaloki f39dc03561 Account/Email Aliases: add profile-scoped enabled predicates (#36262) 2026-05-07 23:02:37 -07:00
r0hit0303 c3cf8bb5aa Refactor query filter to follow modularization. (#36169)
Moves the files in the [components/query_filter](https://sourcegraph.com/r/github.com/brave/brave-core/-/tree/components/query_filter) directory into `components/query_filter/browser` and `components/query_filter/common` to finish modularizing query_filter.

Resolves https://github.com/brave/brave-browser/issues/55258
2026-05-06 17:37:58 +02:00
Pavel Beloborodov b710c75ce3 Added policy for Email Aliases. (#35876)
* Added policy for Email Aliases.
* Added toggle on Brave Origin settings page.
2026-05-05 23:56:05 -07: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 R. BondyandClaude Opus 4.6 55bc3c7913 Add Web Discovery build flag (#35252)
* Add Web Discovery build flag

* Remove obsolete kDontAskEnableWebDiscovery pref

This legacy pref was only being registered and immediately cleared
during migration. Remove it entirely.

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>

---------

Co-authored-by: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
2026-04-04 09:07:56 -04:00
Brian R. Bondy 4049b8799f Add enable_brave_news buildflag (#32852) 2026-01-12 13:22:17 -05:00
Brian R. Bondy facb8df1e1 Add Brave talk build flag (#32917)
* Add Brave talk buildflag

* Review comments
2025-12-23 09:16:42 -05:00
Aleksei Seren dbefb3de84 Add Brave FingerprintingV2 policy handler (#32327)
PR adds Brave FingerprintingV2 policy value validation.
Valid values are:
- name: DisableFingerprintingProtection
  value: 1
- name: EnableFingerprintingProtectionStandardMode
  value: 3
2025-12-05 15:23:38 -05:00
Brian R. Bondy f0656b06f9 Consolidate pref_names.h files (common -> browser) (#32603)
Consolidate pref_names duplicates (common -> browser)
2025-11-29 22:15:10 -05: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
Aleksei Seren d085c08da9 Add adblock content setting policy (#31906)
This change allows to set `adblock`
content setting via managed preference
basing on policy.
2025-11-18 15:56:08 -05:00
Aleksei Seren 4880abf855 Brave Referrer policy description update (#32340)
Update the Brave Referrer policy description
to reflect current behavior.
2025-11-17 19:09:24 -05:00
Aleksei Seren 16f5fd37c9 Add BRAVE_REMEMBER_1P_STORAGE content setting policy (#31908)
This change allows to set BRAVE_REMEMBER_1P_STORAGE
content setting via managed preference
basing on policy.
2025-11-14 19:17:50 -05:00
Aleksei Seren 233f525dc6 Add BRAVE_REFERRERS content setting policy (#31903)
This change allows to set BRAVE_REFERRERS
content setting via managed preference
basing on policy.
2025-11-14 14:23:44 -05:00
Aleksei SerenandShivan a200cde687 Add BRAVE_HTTPS_UPGRADE content setting policy (#31909)
This change allows to set BRAVE_HTTPS_UPGRADE
content setting via managed preference
basing on policy.

---------

Co-authored-by: Shivan <shivankaulsahib@gmail.com>
2025-11-12 15:14:38 -05:00
Brian R. Bondy 72cadbd0c6 AIChat build flag and gn var (#31988)
* Add AI Chat build flag to components/ai_chat

* Add AI Chat build flag to browser/ui

* Add AI Chat build flag to browser/resources

* Add AI Chat build flag to chromium overrides

* Add AI Chat build flag to other components

* Add AI Chat build flag to core browser files

* Add AI Chat build flag to app and renderer

* Add AI Chat build flag to remaining files

* Set enable_ai_chat to !is_brave_origin_branded

* Review comments

Including gn_check errors in chromium_src

* Exclude ai_chat Jest tests when not enabled
2025-11-11 11:20:34 -05:00
Brian Johnson e9277ad0dd [CodeHealth] Remove incorrect policy OS guards (#32182)
OS guards were incorrectly added around policies that are not OS specific
2025-11-10 17:14:56 -08:00
Brian R. Bondy 059995b375 Hide Tor settings only when Tor is disabled and managed (#32162)
Disable Tor settings only when Tor is disabled and managed
2025-11-01 08:13:36 -04:00
Aleksei SerenandShivan ca4f336434 Add policy for GPC (#32045)
The PR adds policy which allows to configure
Global Privacy Control feature

---------

Co-authored-by: Shivan <shivankaulsahib@gmail.com>
2025-10-31 21:08:10 -05:00
Aleksei SerenandBrian Clifton 011984bc0b Policy for tracking query parameters filtering (#31975)
This PR adds a policy for known tracking query
parameters filtering

---------

Co-authored-by: Brian Clifton <brian@clifton.me>
2025-10-27 21:42:34 -05:00
Kyle Hickinson 0fea2d5f95 [CodeHealth] Remove enable_playlist gn arg (#31715)
This arg was now always true so there is no need for it anymore
2025-10-25 13:17:37 -04:00
Aleksei Seren 0f76e9ee88 Add policy for Brave fingerprinting protection (#31235)
This change allows to set Brave
Fingerprinting V2 content setting via
managed preference basing on policy.
2025-10-15 11:38:47 -04:00
Kyle Hickinson b049fa48f7 [Playlist] Convert to a layered component (#31639)
- Everything in `browser` moves to `content/browser`
- Everything in `renderer` moves to `content/renderer`
- Everything in `common` moves to `core/common`
- `pref_names.h` moved into `core/common`
- Fixed copyright notice in `playlistSelect.tsx`
2025-10-06 19:14:46 +01:00
Brian Johnson 7989acf16f [Speedreader] Cleanup pref/feature/method naming (#31415)
Rename pref/features to try to make them more clear. `Enable` means that the site will open in Speedreader automatically. `Allow` means it may open in Speedreader depending on whether it's a site specific override or allow for all readable urls is true and the url looks readable.
2025-09-30 08:07:18 -07:00
Aleksei SerenandShivan 169726e4de Add policies for Reduce Language, De-AMP, Debouncing protection settings (#31260)
* Add policy for Reduce Language protection setting

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

* Add policy for De-AMP setting

* Add policy for Debounce setting

---------

Co-authored-by: Shivan <shivankaulsahib@gmail.com>
2025-09-29 11:40:22 -05:00
Brian R. Bondy e63c411e92 Build Brave Origin policy / pref info (#31179)
* Build policy definitions for use in Brave Origin

* Add unittest for building policy definitions
2025-09-15 19:50:46 -04:00
Darnell Andries 3a90e5a7f0 Add admin policy for Playlist (#30351)
* Add admin policy for Playlist

* Remove Playlist disabled by policy pref, rename policy

* Remove disabled condition for Playlist settings page
2025-09-03 20:41:49 -07:00
Brian R. Bondy de38c2bc73 Cleanup Speedreader group policy (#30680)
- BraveSpeedReaderDisabled is now called BraveSpeedReaderEnabled
- Replace kSpeedreaderDisabledByPolicy with kSpeedreaderPrefFeatureEnabled which already existed
- Invert Disabled policy name to Enabled to match the pref that already existed.
- Invert logic at various places to be for enabled checks instead of disabled.
- Update tests and policy definitions accordingly.
- We now show opt-ins for Recommended policy enforcement (things set via `defaults write` on macOS, it should show an indicator if you match the recommended setting or not)
- We now hide opt-ins for Mandatory enforcements (things set via `sudo /usr/libexec/PlistBuddy`)
2025-08-18 13:27:37 -04:00
Darnell Andries 6ce7e79750 Remove P3A disabled by policy pref, rename policy (#30515)
* Remove P3A disabled by policy pref

* Remove origin user check for P3A setting

* Rename settings handler P3A enabled managed variable
2025-08-13 15:13:32 +09:00
Darnell Andries 07bd2c6079 Remove Web Discovery disabled by policy pref, rename policy (#30516)
* Remove web discovery disabled by policy pref

* Remove Origin user check for WDP setting

* Remove unused include
2025-08-12 20:39:47 -07:00
Darnell Andries 56cc73bdee Remove stats usage ping disabled by policy pref, rename policy (corrected base) (#30555)
* Remove stats usage ping disabled by policy pref

* Remove Origin user check for stats ping setting

* Rename settings handler stats reporting enabled managed var
2025-08-12 16:53:37 -07:00
Brian R. Bondy 510704949f Cleanup Wayback machine group policy (#30594)
- BraveWaybackMachineDisabled is now called BraveWaybackMachineEnabled
- Replace kBraveWaybackMachineDisabledByPolicy with kBraveWaybackMachineEnabled which already existed
- Invert Disabled policy name to Enabled to match the pref that already existed.
- Invert logic at various places to be for enabled checks instead of disabled.
- Update tests and policy definitions accordingly.
- We now hide opt-ins for Recommended policy enforcement (things set via `defaults write` on macOS) but hide for mandatory enforcements (things set via `sudo /usr/libexec/PlistBuddy`)
2025-08-12 15:42:06 -04:00
Darnell Andries 82165c4b01 Add admin policy for Web Discovery (#30023)
Add admin policy for Web Discovery (#30023)

* Fix Web Discovery API to account for policy, add Web Discovery test

* Move IsWebDiscoveryEnabled/pref_names to components/web_discovery/common

* Check Web Discovery Native feature before loading extension background page

* Use PrefService ref in IsWebDiscoveryEnabled

* Mark WDP policy as pending development for Android

* Move Web Discovery enabled/disabled via policy prefs to //brave/components/constants
2025-07-28 22:05:29 -07:00
Darnell AndriesandBrian Clifton 3a17e78e09 Add admin policies for disabling P3A and usage ping (#30022)
Add admin policies for disabling P3A and usage ping (#30022)

* Init P3A admin policy

* Complete P3A admin policy

* Add stats ping admin policy

* Add tests for new P3A/Stats policy prefs

* Update P3A/Stats policy descriptions

* Address P3A admin policy feedback

* Mark P3A/Usage ping policies as pending development for Android

Co-authored-by: Brian Clifton <brian@clifton.me>
2025-07-28 17:05:21 -07:00
Brian R. Bondy fca899dbad Way back machine admin policy (#30020)
Fix Chromium supported versions in other admin policies
2025-07-17 12:27:53 -04:00
Brian R. Bondy df908077f0 Add Speedreader admin policy (#30017) 2025-07-16 02:20:43 +02:00
Brian R. Bondy 7896045f5e Add Brave Talk admin policy on Desktop (#29990)
Add Brave Talk admin policy
2025-07-11 13:34:20 -04:00
Brian R. Bondy b44782779d Add admin policy for Brave News on Desktop (#29989)
Add admin policy for Brave News
2025-07-11 10:56:17 -04: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
vadims 6db5e4ca7e "IPFSEnabled" Group Policy Documentation is No Longer Relevant (#27086)
"IPFSEnabled" Group Policy Documentation is No Longer Relevant
(https://github.com/brave/brave-browser/issues/41529)
----------------
Signed-off-by: Vadym Struts <vstruts@brave.com>
2025-01-14 15:45:06 +01:00
Jocelyn Liu efcb1df7c6 Remove enable_ai_chat buildflag 2024-10-31 20:15:18 -07:00
Brian Clifton 18cf485575 Restricting group policy to Desktop
I can't find documentation about Android administration and the build
fails with sync url set. We need to find the Android equivalent of
`chromium_src/components/policy/tools/generate_policy_source.py`
2024-09-13 16:15:25 -07:00
Brian Clifton f201239c08 Create group policy for sync URL
Fixes https://github.com/brave/brave-browser/issues/20431
2024-09-13 09:54:40 -07:00
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
Anthony Tseng ef6977b775 Add an enabled policy for ai chat 2024-02-07 10:35:56 -08:00
cdesouza-chromium f2ff15cadb [CodeHealth] Use inline namespace-global constants (#20992)
This change adds `inline` to all `constexpr` namespace-global constants
in the codebase, to improve codegen around these constants.
2023-11-16 07:00:46 +00:00
Claudio DeSouza fa5de1e994 Using upstream New Profile/Open Profile menu
Upstream has implemented the menu options for New Profile/Open Profile
existing in brave.

This change removes our own implementation for those menu entries,
using the upstream implementation directly.

Chromium change:
https://chromium.googlesource.com/chromium/src/+/f0116569d73045cde67f8d9553bddc841a742ebe

commit f0116569d73045cde67f8d9553bddc841a742ebe
Author: David Yeung <dayeung@chromium.org>
Date:   Thu Jun 15 05:18:23 2023 +0000

    [CR2023] Added section 4 & 5 to Profile submenu

    This CL adds the Other chrome profile section and the managing profile section to the profile submenu.

    This does the following:
    - Adds strings to the profiles submenu view.
    - Adds the 2 aforementioned sections to the profile submenu.
      - One of the sections will increase the number of possible dynamic menu items in the app menu. This is because the "Other Chrome Profiles" can change depending on the number of profiles available in the browser.
    - Cleaned up some UI code in app_menu to be shared across profile menu items. This is bespoke to the profile section for now and will potentially be removed in the future due to UI changes.
    - Tests for coverage.

    Figma mocks:
    https://www.figma.com/file/NLMJNd5s2g9DEDZCbIngJV/ChroMenu---Desktop-Scalability?type=design&node-id=2560-291355&t=PlIopfjOa2CcJCBY-0

    Screenshot:
    https://screenshot.googleplex.com/BB9ccDaHEwaXPgZ

    Bug: 1427667
2023-07-26 16:50:30 -04:00
Pavel Beloborodov 1b83d2c71a Disable Tor if incognito mode is disabled by group policy. (#19211)
* Disable Tor if incognito mode is disabled by group policy.
* Fixed brave://settings in guest profile.
2023-07-11 13:03:16 +07:00
Cepera cb9a8744d2 Move kBraveSimplePolicyMap to separate file (#17884)
Move kBraveSimplePolicyMap to a separate file
2023-04-04 15:16:16 +03:00