269 Commits
Author SHA1 Message Date
Kevin Smith 56aa81b9f8 [CompactMode] Add a toggle in settings (#36616) 2026-06-03 11:56:55 -04:00
MaxMandInjectorExe 225eefcea2 Add configurable history retention setting (#34737)
Adds a privacy setting for controlling how long browsing history is kept, including options to disable history saving or keep history indefinitely. Updates the history expiration backend when the setting changes and shows a notice on the history page when saving is disabled.

Co-authored-by: InjectorExe <68108452+InjectorExe@users.noreply.github.com>
2026-05-30 22:18:56 -07:00
Sangwoo Ko 21ca687cb4 Add optional horizontal tab strip scroll buttons (#35473)
* Add optional horizontal tab strip scroll buttons

Introduce a profile preference (Appearance → Tabs) to show leading and
trailing scroll controls when the horizontal unpinned tab area overflows.
Expose the pref through settings WebUI, extension settings_private, and the
incognito allowlist where appropriate.

BraveHorizontalTabStripRegionView inserts TabStripControlButton instances
with flex-friendly child ordering and visibility tied to overflow. Scroll
offset changes are observed via BraveTabContainer’s
RegisterHorizontalScrollOffsetChangedCallback subscription.
2026-04-24 10:12:33 -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
Sangwoo Ko 9c3ff661b3 Enable horizontal scrollable tab strip flag and make preference (#35448)
* Horizontal scrollable tab strip is enabled by default

* Remove the min inactive width check for scrollable tab strip
  as we have minimum width control via preference

* Remove redundant check and make comment

* Update scrollable tab strip setting label

* Add test for scroll direction when scrollable horizontal pref is disabled

* Remove unnecessary browser object access

* Simplify method
2026-04-16 08:00:06 +09: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
Sangwoo Ko d140628bb7 Make options for minimum tab width (#35071)
We provide a way to adjust the minimum width of the tab.
There're 5 options:
- default: currently the minimal
- minimum: current behavior,
- medium: 76px
- large: half of the standard width
- full: the standard width
2026-04-01 14:00:18 -04:00
Jocelyn Liu acf20dfedb [AI Chat] Allow users to select Leo or custom models for tab focus (#34333)
* Add pref and backend support for tab organization model key

Introduce kBraveAIChatTabOrganizationModelKey pref (default:
"chat-automatic") to allow users to choose which model is used
for tab organization. Update CreateTabOrganizationEngineIfNeeded
to read from this pref with fallback to "chat-automatic". Add
unit test for the invalid key fallback path.

* Add tab organization model selector in settings UI

Extract shared LeoModelSelector Lit component from personalization
page. Add tab organization model dropdown that appears when the tab
organization feature flag and pref are both enabled. Gate the tab
organization toggle behind the feature flag. Add localized string
for the model selector label.

* Improve tab focus prompts

When testing local model, found gemma tends to reply topics like
"['📰 News', '💻 Web Development', ... ]" which is failed to be parsed
because of the usage of single quotes on strings.
Improve tab focus prompts to mention valid JSON array and examples for
model to follow.
2026-03-04 00:59:09 +01:00
Kevin Smith 2fd3ffa13a [Shields UI] Add Brave logo to app menu button (#33585) 2026-02-05 20:18:21 -05:00
Brian R. Bondy 4049b8799f Add enable_brave_news buildflag (#32852) 2026-01-12 13:22:17 -05:00
Sangwoo Ko 2e2024b511 Add setting to control middle-click-to-close tab behavior (#32926)
This commit adds a new user preference that allows users to disable the
middle-click-to-close tab functionality, addressing user feedback that
accidental middle-clicks can cause unwanted tab closures.

Changes include:

**Browser Preferences:**
- Add kTabsCloseOnMiddleClick pref (default: true) in brave_tab_prefs.h
- Register preference in brave_prefs_util.cc for settings UI exposure

**UI Implementation:**
- Extend TabSlotController interface with CanCloseTabViaMiddleButtonClick()
- Implement pref checking in BraveTabStrip via base class override
- Override TabSlotController methods in tab_strip.h/cc to respect preference
- Add chromium_src overrides for FakeTabSlotController and FakeBaseTabStripController
  to support testing infrastructure

**Tab Click Handling:**
- Patch tab.cc to check controller preference before handling middle clicks
- Use plaster.toml rewrite for cleaner code transformation
- Maintain existing behavior when preference is enabled (default)

**Settings UI:**
- Add "Close tabs on middle click" toggle to Appearance > Tabs settings
- Include localized strings in brave_settings_strings.grdp
2026-01-08 12:52:45 +09: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 facb8df1e1 Add Brave talk build flag (#32917)
* Add Brave talk buildflag

* Review comments
2025-12-23 09:16:42 -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
Sangwoo Ko b0ca080ece [Tabs] Add pref to always hide tab close button (#32189)
* Add pref to always hide tab close button

Some users prefer a cleaner tab appearance without close buttons, as
they close tabs using other methods (e.g., middle-click, shortcuts).
So close button could be no more than a visual distraction or accidental
click.

This commit introduces a new preference that allows users to always hide
the tab close button.

* Introduce ControllableCloseButtonState

This is a sort of decorator class that wraps bool showing_close_button_
so that we can consider additional factors when determining whether to show
the close button, such as whether the mouse is hovering over the tab,
or whether the controller wants to always hide the close button.
2025-11-18 00:36:27 +09:00
Terry Mancey 8f343ac4ad [ads] Remove super referral web UI (#32098)
Remove Super Referrals web UI. The feature is no longer supported or
used, and this cleanup helps reduce unused code and simplify the overall
system as part of https://github.com/brave/brave-browser/issues/44403.
2025-10-31 18:59:26 +07:00
Andrea a98761bc6f [ollama] Add OllamaService connection check with factory and preferences (#31568)
Add OllamaService connection check with factory and preferences

This change introduces a dedicated OllamaService for managing
communication with local Ollama instances:

- Add OllamaService with IsConnected() method to check Ollama
  availability at localhost:11434
- Add OllamaServiceFactory as ProfileKeyedServiceFactory for
  proper lifecycle management
- Add ollama.mojom interface defining kOllamaBaseUrl constant
  and OllamaService mojo interface
- Add comprehensive unit tests for connection scenarios
- Add kBraveAIChatOllamaFetchEnabled preference for user control
- Register OllamaServiceFactory in browser context initialization
- Add preference to settings_private allowlist for WebUI access
- Add browser/ai_chat/ollama directory with factory implementation
- Wire up OllamaService dependency in content/browser layer

The service performs lightweight connection checks (1KB max) to
verify Ollama availability before enabling fetch functionality.
2025-10-30 01:32:31 +00: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 9a1f4f77f4 Fix Block Scripts setting to respect policy (#31929)
PR fixes `Block Scripts` Brave Shields setting to
respect `DefaultJavaScriptSetting` policy
2025-10-21 20:15:23 +01:00
Kevin Smith 5f9aaabf29 [Rounded Corners] Replace flag with a pref and settings toggle (#31602) 2025-10-21 13:47:01 -04:00
Sangwoo Ko 51ffb8502c [Tree Tabs] Add tree tabs prefs to allowlist for settings page (#31755)
Add tree tabs prefs to allowlist for settings page
2025-10-13 06:48:48 +09: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
32909dec30 Ad Block Only mode settings UI (#31311)
* Ad block only mode settings UI

The PR adds “Adblock only mode” alert box and a
“Adblock only mode” toggle to Brave Shields
Settings page.

---------

Co-authored-by: Terry Mancey <terry.mancey@icloud.com>
Co-authored-by: Jay Harris <jay.harris@outlook.co.nz>
2025-09-26 09:45:08 +09:00
Sangwoo Ko 64e16c7744 Add pref to control "Hide vertical tabs completely when minimized" feature (#31202)
* Add pref to control "Hide vertical tabs completely when collapsed" feature

This PR adds a new preference to control the "Hide vertical tabs
completely when minimized" feature.
2025-09-17 00:42:41 +09:00
Brian R. Bondy 24d9b92d6d Remove top sites suggestions provider (#31073)
The list was not updated nor maintained, and even had invalid entries.

On device which uses a local ML model was tied to this preference for some reason too, so that keeps the preference around and has a checkbox for just that now.

For Android, it doesn't support on device suggestions because the ML
models aren't available there, so no checkbox was added there.
2025-09-08 11:42:41 -04:00
Simon Hong 668a7270c1 [cr140] Refactored changes in ShouldShowBookmarkBar() to avoid code copy
In NTP, we show bookmark bar always regardless of bookmarks items/saved
tab group are empty when user selected show bookmarks bar or only show
in NTP.
2025-08-20 01:07:05 +03:00
Brian R. BondyandSerg 7240ef2e2e Add top level toggle to enable/disable Speedreader (#30600)
* Add top level toggle to enable/disable Speedreader

This migrates away an old bad named feature for automatically using
speedreader for all sites.  The pref was wrongly named `enabled`.

This also adds a new preference for actually enabling/disabling the
feature.

* Fixes Android presubmit

---------

Co-authored-by: Serg <serg.zhukovsky@gmail.com>
2025-08-13 11:14:10 -04: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
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
Jocelyn Liu 3a63d15502 [Leo] Support user customization and memory (#30054)
feat(Leo): Support user customization and memory

- Add new preferences for user customization (a dict with name, job, tone,
  other) and memory (a list of user memories)
- Add UserMemory event and the function to create it in conversation
  API engine consumer using values from added preferences
- Settings UI to manage these prefs
- Unit tests and l10n strings

The memory feature allows Leo to retain user-specific information
across sessions, enhancing personalization and creating more relevant
interactions.

1. User Customization Storage: Users can provide their name, job,
   preferred tone, and additional preferences through the settings UI.
   These are stored as user preferences and persist across browser
   sessions.

2. Memory Collection: Users can add, edit, and delete specific memories
   through the memory management interface. These memories are stored
   as a list in user preferences.

3. Conversation Integration: A UserMemory event consists of data from
   user customization and memory preferences would be added into Leo
   conversation requests if user customization or user memory feature
   preference is enabled with non-empty customization data or memories.

4. Personalized Responses: The AI engine receives this memory context
   and can tailor responses based on:
   - How the user prefers to be addressed (name)
   - Their professional context (job)
   - Their preferred communication style (tone)
   - Specific memories and preferences they've shared

5. Memory Management: Users have full control over their memories
   through the settings UI, including:
   - Adding new memories with custom text
   - Editing existing memories
   - Deleting individual memories
   - Clearing all memories at once
   - Enabling/disabling the memory feature entirely

6. Privacy and Control:
   - All memory data is stored locally in user preferences
   - Users can disable memory features at any time via Settings UI
   - Memories can be individually deleted or completely cleared
2025-07-28 13:01:30 -07:00
cypt4 6381e7d43e [Cardano] Add Cardano dApp setting (#30004)
* [Cardano] Add Cardano dApp setting
Resolves https://github.com/brave/brave-browser/issues/46374
2025-07-18 20:32:13 +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
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
Pavel Beloborodov 3d5b91660a Block Windows Recall on Win 11 . (#29251)
* Block Windows Recall on Win 11.
* WindowsRecall pref is stored in the local state.
2025-06-26 14:30:28 +07:00
Brian Clifton cfa161e90d Remove the web torrent code from brave-core (#29320)
* Remove the web torrent code from brave-core

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

Includes manual adjustment for `resources/resource_ids.spec`
2025-06-24 19:11:59 +02:00
Terry ManceyandAleksei Seren babcc60130 [ads] Survey Panelist: Desktop (#28995)
* [ads] Survey Panelist

Co-authored-by: Aleksei Seren <aseren@brave.com>

* [ads] Move survey panelist setting to `Privacy and security` section

Co-authored-by: Terry Mancey <terry.mancey@icloud.com>

---------

Co-authored-by: Aleksei Seren <aseren@brave.com>
2025-06-02 12:05:39 -05:00
Jocelyn Liu c6ba6933df Implement tab focus feature
co-author on the frontend: @douglashdaniel

- Implement GetSuggestedTopics, DedupeTopics, GetFocusTabs in engine consumer
  and conversation api client for tab organization feature
- Implement Brave's own tab organization UI by hooking into where Chromium's
  tab organization UI is located by overriding auto_tab_groups_page to our own
  implementation.
- Chromium's TabSearchPageHandler and TabSearchUI is overriden to include what we
  need for our own tab organization feature using Leo.
- Add a pref toggle in Leo settings page for user to enable/disable tab
  organization UI.
- Add a feature flag for tab organization feature.
2025-03-25 13:24:57 -07:00
Jay Harris d8e73170c8 [Omnibox]: Hide OnDeviceHeadProvider suggestions when top suggestion are disabled (#28094)
* [Omnibox]: Hide OnDeviceHeadProvider suggestions when top suggestions are disabled

* Setup OnDeviceHeadModel
2025-03-24 09:33:38 +01: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
Darnell Andries cf94b54d8b Bootstrap Web Discovery Native, add credential manager and server config loading 2025-01-27 18:22:39 -08:00
Brian Johnson afd4e0239d fix overly permissive DEPS (#27193)
Fix overly permissive deps
2025-01-12 21:43:04 -07:00
8d3cd1bc66 Revert custom sync url (#27136)
* Revert "Merge pull request #25484 from jagadeshjai/feature__add_option_custom_sync_url"

This reverts commit d547c86d6b and 9757d93508, reversing
changes made to ab6eba7159.

* revert https://github.com/brave/brave-core/pull/27054

* fixed presubmit errors

* Removed code supposed to support `Use Sync staging server` QA preference

Related PR - https://github.com/brave/brave-core/pull/26804

---------

Co-authored-by: AlexeyBarabash <alexey@brave.com>
Co-authored-by: AlexeyBarabash <AlexeyBarabash@users.noreply.github.com>
2025-01-08 11:29:45 -07:00
Jay Harris e1a3daade2 [AI Chat]: Android history setting (#26988) 2024-12-18 11:41:30 -07:00
Pavel Beloborodov 1f0e2fcc75 Added Custom Scriptlet section in the settings page. (#25999)
* Added Custom Scriptlet section in the settings page.
* Added security warning message.
* Added adblock `Developer mode` protected pref.
* Make custom filters readonly if dev-mode is disabled.
2024-12-13 12:22:43 +07:00
Jagadesh P 7731484f52 [Sync] Remove Enable/Disable switch and just use input element for handling custom sync url.
Also show Relauch button and Managed icon when required.

Conflicts:
browser/ui/webui/brave_settings_ui.cc
2024-11-27 13:49:47 +05:30
Jagadesh P ed3323db38 [Sync] Add a spearate input element for custom sync url and show
relaunch button when toogle/url change.
2024-11-27 13:49:46 +05:30
Jagadesh P 8775f05028 [Sync] Add an option in setting page to Enable/Enter Custom Sync Url. 2024-11-27 13:49:42 +05:30