- Drop feature flag and v1 routing
The Conversation API v2 client (OpenAI-compatible) has been the default
since kAIChatConversationAPIV2 shipped as ENABLED_BY_DEFAULT. Always route
Leo model engines to the v2 implementation, retire the feature flag, and
de-parameterize the two AI Chat browser tests that toggled it.
- Remove unused v1 implementation
- Drop redundant V2 suffix
History note: the canonical paths were previously occupied by v1 sources
(removed in 2/3). After this rename, \`git log --follow <path>\`,
\`git blame\`, and GitHub's history view follow the rename and surface
the v2 development history. Plain \`git log <path>\` continues to show
v1's history at those paths up to its removal, then the rename arriving
from the V2-suffixed paths.
* Assign BraveCore user agent early & respect always request desktop site.
* Cancel & reload request if User Agent in header is incorrect. This can happen with server-side redirect.
* Add feature flag, disabled by default
Chromium changes:
https://chromium.googlesource.com/chromium/src/+/2e89d3b1ac044129ba5bf54a961a751dff898356
commit 2e89d3b1ac044129ba5bf54a961a751dff898356
Author: Jan Wilken Dörrie <jdoerrie@chromium.org>
Date: Thu Feb 5 12:59:15 2026 -0800
[flags] Use base::span for params in FeatureVariation
Update the FeatureVariation struct to use base::span<const FeatureParam>
for its parameters, replacing the previous raw pointer and explicit
count fields. This modernization improves safety and enables more
concise flag definitions throughout the codebase.
By using base::span, flag variations can now be defined by passing a
FeatureParam array directly, allowing the compiler to implicitly
construct the span and eliminating the need for manual size
specifications via std::size.
Key changes include:
- Updating FeatureVariation in feature_entry.h to store a span.
- Removing explicit size arguments from flag variation definitions in
about_flags.cc and about_flags.mm.
- Refactoring FlagsState to use range-based for loops when iterating
over variation parameters.
- Converting standalone FeatureParam instances into single-element
arrays to support the new span-based constructor.
BYPASS_LARGE_CHANGE_WARNING=Change is already minimal.
Bug: 40285824
Change-Id: I4694ffb3b7a5bcf564bdf0a6bd6f85a26a6a6964
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/7544925
Commit-Queue: Jan Wilken Dörrie <jdoerrie@chromium.org>
Reviewed-by: Dana Fried <dfried@chromium.org>
Reviewed-by: Elly FJ <ellyjones@chromium.org>
Cr-Commit-Position: refs/heads/main@{#1580363}
This adds a few AI Chat feature flags that were also relevant to iOS to `brave://flgas` (`brave-ai-chat-rich-search-widgets`, `brave-ai-chat-conversation-api-v2`, `brave-ai-chat-user-choice-tool`)
This changes the name from `UseChromiumWebViewsJavaScript` to `UseProfileWebViewConfiguration` to better clarify what the feature flag does, which is to remove the usage of per-tab web view configurations.
This simply adds the `brave-ai-chat-allow-private-ips` feature flag to iOS's `brave://flags` page which will be useful in future implementations of custom models in iOS
* 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
Remove iOS Super Referrals. 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.
Remove the legacy support for the sponsored image demo wallpaper. This
functionality is no longer needed now that we can publish directly to
staging for demo purposes. Cleaning it up simplifies the codebase.
* Add feature flag
- Add an iOS-only feature flag for using content settings for persisting Brave Shields settings.
* Update Shields default/global settings.
- Use content settings when the feature flag is enabled for default settings.
* Use content settings for shields when flag is enabled.
- Update BraveShieldsTabHelper to use content settings when the flag is enabled.
* Use core P3A when feature flag is enabled.
Add support for --disable-component-update in all brave components. Use with --allow-brave-component-update to
restore previous behavior for perf and other testing
This PR is the run of `gn format` on all `gn` files. This is a
mechanical change done with:
```sh
git ls-files -- "*.gn" | xargs gn format
git ls-files -- "*.gni" | xargs gn format
```
This change has been motivated primarily by an improvement to the
formatters privided by `gn` correcting cases of redundant target naming,
i.e cases where `//foo:foo` is used, and should just be `//foo`.
For this particular `gn` change, see:
https://chromium.googlesource.com/chromium/src/+/c822490a82cdb6ad479159683a92858f7c6f0a58
Resolves https://github.com/brave/brave-browser/issues/48161
[ads] Deprecate "ShouldAlwaysRunBraveAdsService" and
"ShouldAlwaysTriggerBraveSearchResultAdEvents" Griffin feature flags;
which have been enabled by default since 1.79.
Files that use functions from `string_util.h` should include that header
directly instead of relying on transient inclusions.
This is a mechanical change using this script:
```sh
remove_header_if_unused() {
files=$(git grep -l "base/strings/string_util.h")
for file in $files; do
if ! git grep -qE "base::MakeStringPiece|base::MakeWStringView|base::ToLowerASCII|base::ToUpperASCII|base::CompareCaseInsensitiveASCII|base::EqualsCaseInsensitiveASCII|base::EmptyString|base::RemoveChars|base::ReplaceChars|base::TrimPositions|base::TrimString|base::TruncateUTF8ToByteSize|base::TrimWhitespace|base::CollapseWhitespace|base::ContainsOnlyChars|base::IsStringUTF8|base::IsStringASCII|base::EqualsASCII|base::CompareCase|base::StartsWith|base::EndsWith|base::RemovePrefix|base::RemoveSuffix|base::IsAscii|base::IsUnicodeControl|base::IsHexDigit|base::IsUnicodeWhitespace|base::FormatBytesUnlocalized|base::ReplaceFirstSubstringAfterOffset|base::ReplaceSubstringsAfterOffset|base::WriteInto|base::JoinString|base::ReplaceStringPlaceholders|base::MakeStringViewWithNulChars" "$file"; then
sed -i '/base\/strings\/string_util.h/d' "$file"
echo "Removed 'base/strings/string_util.h' from $file"
fi
done
}
add_header_if_needed() {
files=$(git grep -lE "base::MakeStringPiece|base::MakeWStringView|base::ToLowerASCII|base::ToUpperASCII|base::CompareCaseInsensitiveASCII|base::EqualsCaseInsensitiveASCII|base::EmptyString|base::RemoveChars|base::ReplaceChars|base::TrimPositions|base::TrimString|base::TruncateUTF8ToByteSize|base::TrimWhitespace|base::CollapseWhitespace|base::ContainsOnlyChars|base::IsStringUTF8|base::IsStringASCII|base::EqualsASCII|base::CompareCase|base::StartsWith|base::EndsWith|base::RemovePrefix|base::RemoveSuffix|base::IsAscii|base::IsUnicodeControl|base::IsHexDigit|base::IsUnicodeWhitespace|base::FormatBytesUnlocalized|base::ReplaceFirstSubstringAfterOffset|base::ReplaceSubstringsAfterOffset|base::WriteInto|base::JoinString|base::ReplaceStringPlaceholders|base::MakeStringViewWithNulChars")
for file in $files; do
../tools/add_header.py --header '"base/strings/string_util.h"' "$file"
done
}
remove_header_if_unused
add_header_if_needed
```
Resolves https://github.com/brave/brave-browser/issues/46559
* [iOS] Add Brave to user agent
This adds a `Brave/{version}` entry to the mobile & desktop user agents when browsing and updates our current user agent generation logic to better match Chromium. This change is controlled by a feature flag (on by default)
* Add BraveUserAgentService component that reads brave-checks.txt from local data files. Add masked UA options to iOS for when we should show Brave in the user agent.
* Use component/installer pattern instead of local data files component.
* review(kylehickinson): EOF newline, nil over nullptr in obj-c, destroy BraveUserServiceAgent correctly on Tab, remove feature flag helper in BraveUserAgentService obj-c wrapper, combine early return checks.
* review(Brandon-T): use bulk insert, newline nit.
* review(bridiver): Align patterns. Use a singleton for BraveUserAgentService. Register the component in RegisterComponentsForUpdate.
* Use GetDomainAndRegistry to match against sub-domains for domains in exceptions list.
* Add unit tests for the component.
* review(bridiver): Rename to BraveUserAgentExceptions. Add IOS suffix to iOS wrapper.
* review(kylehickinson): EOF newline, remove feature flag helper method, unneeded nil assignment, remove WebKit only comment.
---------
Co-authored-by: Stephen Heaps <steaps.4@gmail.com>
* Move all Translate features behind a feature flag
* Use cr.googleTranslate instead of __gCrWeb.translate, to follow what TranslateAgent is doing on Desktop, rather than what Chrome is doing on iOS. Add polling translation status like on Desktop, rather than listening to events like on iOS.
* Add feature-flag for Apple Translate
* Disable translate by default