* 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.
* 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
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
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
* 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
* 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.
* Implement BuildTreeTabs() and FlattenTreeTabs()
TreeTabNodes are specialized TabCollections that wrap individual tabs,
allowing for hierarchical nesting and advanced tab relationships.
- `BuildTreeTabs()`: Converts tab structure to tree hierarchy
by wrapping all tabs in TreeTabNodes
- `FlattenTreeTabs()`: Reverses the process, extracting tabs from
TreeTabNodes back to non-tree-tabs structure while preserving order
- `BraveTabStripModel` exposes BuildTreeTabs/FlattenTreeTabs APIs for testing
- `BraveTabStripModel` will automatically build or flatten tree tabs
based on user preferences, specifically the `kTreeTabsEnabled` and
`kVerticalTabsEnabled` preferences.
- Methods are feature-gated behind kBraveTreeTab feature flag
- TreeTabNodes can be added to unpinned collections, split and tab groups
- Support for recursive nesting: TreeTabNode -> Group -> TreeTabNode
- Maintains compatibility with existing tab strip infrastructure
This PR removes some of the uses of `NoDestructor` for cases where
`std::vector` was being used to store static data. This is safe, as the
storage of the data is static.
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
* Support Leo Autocomplete suggestion
When typing search keyword, Leo suggestion should show up from Omnibox popup.
This suggestion will lead to the Leo sidebar panel.