61 Commits
Author SHA1 Message Date
Jocelyn Liu e6ea5cd2f2 [AI Chat] Deprecate conversation API v1 (#36767)
- 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.
2026-05-28 10:48:52 -07:00
StephenHeaps e206aa7e63 [iOS] Brave hiding logic not applying on headers for redirect requests (#35459)
* 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
2026-04-16 13:37:21 +00:00
Kyle Hickinson c827c80ad4 [iOS] Add Origin entry to chrome://flags (#35488) 2026-04-14 18:14:12 +00:00
Nuo Xu 08344c238f [iOS] Initial set up for QuickView feature (#34761) 2026-03-26 18:20:16 -04:00
Kyle Hickinson 8aa3e2808b [iOS] Remove legacy tab tray UI & feature flag (#34840)
This removes the old tab tray UI since the feature flag enabling the new UI has been on by default for 6 months
2026-03-20 11:11:19 -04:00
Emerick Rogul ff669fcb48 [cr146][ios] FeatureVariation param now uses a span
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}
2026-02-26 14:14:53 +00:00
Nuo Xu 410dd6ac25 [iOS][Wallet] Add a feature flag for cardano dapp support (#34155)
* add a feature flag for cardano dapp support

* address review comments
2026-02-24 18:23:40 +00:00
Kyle Hickinson 9c9e246d2a [iOS] [AI Chat] Add missing feature flags to flags WebUI (#34110)
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`)
2026-02-23 12:20:28 -05:00
Kyle Hickinson 321ee90b3d [iOS] Update the Chromium web views JavaScript feature flag name (#34063)
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.
2026-02-19 17:32:54 +00:00
StephenHeaps 97433a406c [iOS] Add feature flag for adjusting default iOS user agent type (#33953)
* Add BraveiOSUserAgentType feature flag and param to allow dynamically adjusting
the Brave user agent on iOS via Griffin
2026-02-19 09:23:51 -05:00
Kyle Hickinson e9c599e52a [iOS] Remove UseChromiumWebViews feature flag (#34018)
Its been enabled by default for 6 months and we are unlikely to ever disable it via griffin for any reason, so this should be safe to remove now
2026-02-18 12:03:43 -05:00
Kyle Hickinson 80aaa36d9f [iOS] Add migration feature flag for using Chromium JavaScript backend (#33994)
This feature flag will be used to refactor Brave iOS's JavaScript backend to utilize Chromium's instead
2026-02-17 18:21:53 -05:00
Nuo Xu a4f2c8090e [iOS][Wallet] Update zcash feature flag option description (#33900)
update zcash feature flag option description
2026-02-12 16:56:11 +00:00
Nuo Xu 7ebfe5c2b4 [iOS][Wallet] Move wallet webui feature flag into components (#33674)
* move wallet webui and debug flags to components

* conditionally compile webui feature flag with iOS BUILDFLAG
2026-02-06 21:35:51 +00:00
Nuo Xu 7a401e1105 [iOS][Wallet] fix wrong kZCashFeatureVariations enable value (#33665)
fix wrong kZCashFeatureVariations enable value
2026-02-04 12:06:10 -05:00
Nuo Xu 30f0c43cd8 [iOS][Wallet] Expand zcash feature flag options (#33583)
expand zcash feature flag options
2026-02-03 12:38:26 -05:00
Kyle Hickinson 17a34c9bf5 [iOS] [AI Chat] Move WebUI feature flag into component (#33572) 2026-02-03 09:42:19 -05:00
Eli Hini 2336058fcb [iOS] Expose Chromium WebView's autofill feature flag (#33501)
exposed autofill feature flag

Signed-off-by: Eli Hini <8249954+EliHini@users.noreply.github.com>
2026-01-31 07:02:34 +00:00
Nuo Xu 6c5fd80a84 [iOS][Wallet] Add cardano feature flag for iOS users (#33465) 2026-01-28 15:01:43 -05:00
Kyle Hickinson 809ab607d4 [iOS] [AI Chat] Expose custom models private IPs feature flag (#33293)
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
2026-01-20 11:37:52 -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
Terry Mancey cd8039ae81 [ads] Remove iOS super referrals (#32093)
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.
2025-10-31 18:59:55 +07:00
Terry Mancey c392f7af40 [ads] Remove sponsored image demo wallpaper (#32101)
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.
2025-10-29 23:12:45 +00:00
StephenHeaps c607480d34 [iOS] Network Connection Integrity (#31410)
Add feature flag (default off) to enable WebKit Advanced Privacy Protections in Nightly iOS.
2025-10-02 15:39:56 -04:00
StephenHeaps 63c348eb9d [iOS] Enable password sync by default (for new users) (#31313)
* Enable sync passwords by default for new users when the feature flag is enabled to align with other platforms.
2025-10-01 11:22:33 -04:00
Kyle Hickinson ecfdd165cd [iOS] Add AI Chat WebUI feature flag (#31496)
Adds the feature flag that will be associated with using Leo in WebUI
2025-09-30 11:08:54 +09:00
Nuo Xu 200872c16d feat(iOS): Add a feature flag for Wallet WebUI (#31405)
* Add a feature flag for Wallet WebUI

* add new dependency in ios/browser/flags/sources.gni

* code review (Stephen)
2025-09-25 18:13:27 -07:00
StephenHeaps 64dcc49d3d feat(privacy): Use Content Settings for some Shields Settings on iOS (#30608)
* 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.
2025-08-19 09:27:45 -04:00
Brian Johnson 464dabb88c Fix handling of --disable-component-update for legacy component registration (#30440)
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
2025-08-06 14:25:38 +09:00
cdesouza-chromium 5eb666f034 [CodeHealth] Run gn format on all files (#30448)
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
2025-08-05 18:08:10 +01:00
Kyle Hickinson bdbb6249b9 [iOS] Introduce new tab tray UI (#29943)
This adds a brand new modern tab tray UI behind a feature flag. This change does not include all new features found in the new design.
2025-07-15 20:45:26 +02:00
Kyle Hickinson 6e3c82634a [iOS] Remove old playlist UI & associated feature flag (#29996)
The new playlist UI has been enabled by default for 10 months, so we can now clean up/remove the old code
2025-07-15 09:47:19 -04:00
Kyle Hickinson 20c8aec3ee [iOS] Remove old menu and associated feature flag (#29994)
The new browser menu has been enabled by default for 6 months, so we can now clean up/remove the old code
2025-07-14 11:10:25 -04:00
Terry Mancey 940a15d419 [ads] Deprecate Griffin feature flags (#29551)
[ads] Deprecate "ShouldAlwaysRunBraveAdsService" and
"ShouldAlwaysTriggerBraveSearchResultAdEvents" Griffin feature flags;
which have been enabled by default since 1.79.
2025-06-13 05:17:52 +02:00
cdesouza-chromium 8df5afaa2f [iwyu] Fixing inclusions for string_util.h pt.1 (#29376)
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
2025-06-04 16:15:27 +01:00
Jay Harris d9d45aa013 [AI Chat]: Remove TextEmbedder (#28874) 2025-05-29 14:31:24 +12:00
Kyle Hickinson 9c7ad15c8c [iOS] Introduce ChromiumTabState & feature flag (#28433) 2025-05-07 11:05:23 -04:00
Terry Mancey 8626a9582c [ads] Enable "ShouldAlwaysRunBraveAdsService" and "ShouldAlwaysTriggerBraveSearchResultAdEvents" by default (#28286) 2025-03-29 14:11:47 -05:00
Kyle HickinsonandStephen Heaps b9c5d44ec0 [iOS] Add Brave to user agent (#27620)
* [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>
2025-03-26 17:30:27 +01:00
Terry Mancey 5ad5b1affc [ads] Deprecate ShouldAlwaysTriggerBraveNewTabPageAdEvents feature flag (#28244) 2025-03-22 17:37:21 +01:00
Claudio DeSouza 0a7802d702 [cr135] flags_ui moved under //components/webui/
This affects several gn inclusion paths, header files, and shadow files
to this component.

Chromium change:
https://chromium.googlesource.com/chromium/src/+/422d5eb80c1ee199aaf98f07707e71449fb42d86

commit 422d5eb80c1ee199aaf98f07707e71449fb42d86
Author: rbpotter <rbpotter@chromium.org>
Date:   Wed Feb 5 08:42:48 2025 -0800

    WebUI: Refactor components/flags_ui into components/webui/flags

    Followup from refactoring recommended by components/ OWNER in
    https://chromium-review.googlesource.com/c/chromium/src/+/6178599

    no other changes

    Bug: 379889249
2025-03-18 20:02:00 -04:00
Brandon-T 26d559947a [iOS] - Move all BraveTranslate features behind a feature flag (#27940)
* 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
2025-03-06 14:24:45 -05:00
Anton Paymyshev a6a0b65fbe Cardano keyring (#27525) 2025-02-09 10:29:08 +07:00
StephenHeaps 4b8ae005e6 fix(privacy): Disable plugin farbling on iOS (#27544)
* Disable plugin farbling.

* Feature flag around plugins farbling (disabled by default).
2025-02-06 22:49:40 -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
Max Karolinskiy ca7921cb42 [cr133][iOS] kHttpsOnlyMode feature flag was removed.
Chromium change:

https://source.chromium.org/chromium/chromium/src/+/a355eaae7dea12674ddc29419f24f5a27fe09094

commit a355eaae7dea12674ddc29419f24f5a27fe09094
Author: Stepan Khapugin <stkhapugin@chromium.org>
Date:   Mon Dec 23 07:00:42 2024 -0800

    [iOS] Clean up stale HttpsOnlyModeEnabled flag.

    Existing unit tests are kept, as the feature can be disabled with a
    pref.

    Bug: 356624511
2025-01-27 09:41:46 -05:00
Brian Johnson afd4e0239d fix overly permissive DEPS (#27193)
Fix overly permissive deps
2025-01-12 21:43:04 -07:00
Kyle Hickinson 3188d479d6 [iOS] Add new browser menu UI (#26805) 2024-12-12 16:01:48 -05:00
StephenHeaps 3d4911560f feature(privacy): Add debug view to iOS to display blocked requests per-tab (#26987)
* Use secure copy of window origin for tracking protection stats.
* Add feature flag to display blocked requests per-tab in shields panel on iOS.
2024-12-12 15:25:35 -05:00
vadims 3386ed8a99 Put "block all cookies" under a default-off feature flag (#26479)
Put "block all cookies" under a default-off feature flag
(https://github.com/brave/brave-browser/issues/42061)
---------

Signed-off-by: Vadym Struts <vstruts@brave.com>
2024-11-13 22:30:59 +01:00