Commit Graph
1286 Commits
Author SHA1 Message Date
Claudio DeSouza b4591a82e3 [cr149] Update BraveUpdateClientConfig ctor calls
`ChromeUpdateClientConfig` has dropped the `url_override` arg. Th change
also removes an unnecessary patch for `ChromeUpdateClientConfig` which
was causing issues.

Chromium changes:
https://chromium.googlesource.com/chromium/src/+/e585ba13ce9ed5667530a315850713c1eeb3cd20

commit e585ba13ce9ed5667530a315850713c1eeb3cd20
Author: Joshua Pawlicki <waffles@chromium.org>
Date:   Fri Apr 17 07:58:49 2026 -0700

    extension updater: Use update_client updater for sync/policy installs

    Previously, the first install of an extension (when driven by sync or
    policy) would still default to using the old extension update stack.
    This isn't necessary; the new stack can be used in this case.

    This relands
    https://chromium-review.googlesource.com/c/chromium/src/+/7545510
    The original CL is patchset 1. Since then,
    ExternalProviderImplTest.InAppPayments (which isn't covered by CQ)
    is fixed, which was unfortunately a bigger job than I hoped.

    Fixed: 482088398, 500551122
    Change-Id: Iee3d224770896f5abc288d1facbd492f67ef9554
    Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/7769170
    Reviewed-by: Owen Min <zmin@chromium.org>
    Auto-Submit: Joshua Pawlicki <waffles@chromium.org>
    Commit-Queue: Joshua Pawlicki <waffles@chromium.org>
    Reviewed-by: Devlin Cronin <rdevlin.cronin@chromium.org>
    Cr-Commit-Position: refs/heads/main@{#1616564}
2026-05-22 16:25:03 -04:00
Max Karolinskiy 0525d152fb [cr149] ManifestV2ExperimentManager moved to //extensions
Chromium changes:
https://chromium.googlesource.com/chromium/src/+/c1c2d43e698d1109f8924adee57dd21062ad9a2d

commit c1c2d43e698d1109f8924adee57dd21062ad9a2d
Author: Miyoung shin <myid.shin@igalia.com>
Date:   Thu Apr 16 04:33:36 2026 -0700

    Move ManifestV2ExperimentManager to //extensions

    This CL relocates ManifestV2ExperimentManager to //extensions,
    as it no longer depends on //chrome.
    It also introduces interfaces to check whether a manifest version
    is allowed and whether a profile can use non-component extensions.

    Bug: 358567092
    Change-Id: I74667a139b36de0c16159d7de17f78ee76aea2ab
    Bypass-Check-License: Moving files
    Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/7735248
    Reviewed-by: Devlin Cronin <rdevlin.cronin@chromium.org>
    Commit-Queue: Miyoung Shin <myid.shin@igalia.com>
    Cr-Commit-Position: refs/heads/main@{#1615751}
2026-05-22 16:24:59 -04:00
Claudio DeSouza 82a6cc677d [cr149] MV2DeprecationImpactChecker moved and ctor changed
Chromium changes:
https://chromium.googlesource.com/chromium/src/+/b11ac9f51e136dd9f345c3f9f79b83aca5d6cb1f

commit b11ac9f51e136dd9f345c3f9f79b83aca5d6cb1f
Author: Miyoung shin <myid.shin@igalia.com>
Date:   Tue Apr 14 17:37:04 2026 -0700

    Move MV2DeprecationImpactChecker to //extensions

    This CL relocate MV2DeprecationImpactChecker to //extensions since
    it no longer depends on //chrome.

    Bug: 358567092
    Change-Id: Ie50342cb170f33ff1b2ae5981d6f556c134c0ac8
    Bypass-Check-License: Moving files
    Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/7736242
    Reviewed-by: Devlin Cronin <rdevlin.cronin@chromium.org>
    Commit-Queue: Miyoung Shin <myid.shin@igalia.com>
    Cr-Commit-Position: refs/heads/main@{#1614819}
2026-05-22 16:24:57 -04:00
Claudio DeSouza 3e5f041d1b [cr149] mv2_experiment_stage.h changed path
Chromium changes:
https://chromium.googlesource.com/chromium/src/+/277ef269ab36909b8f8e0408942855fc67de1a86

commit 277ef269ab36909b8f8e0408942855fc67de1a86
Author: Miyoung shin <myid.shin@igalia.com>
Date:   Mon Apr 13 22:37:48 2026 -0700

    Move mv2_experiment_stage.h to //extensions

    This CL relocate mv2_experiment_stage.h to //extensions since it no
    longer depends on //chrome.

    Bug: 358567092
    Change-Id: I8184bdfcdb3e6cc1dd60e310687f3f5a7b43bd5b
    Bypass-Check-License: Moving files
    Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/7738462
    Commit-Queue: Miyoung Shin <myid.shin@igalia.com>
    Reviewed-by: Devlin Cronin <rdevlin.cronin@chromium.org>
    Cr-Commit-Position: refs/heads/main@{#1614234}
2026-05-22 16:24:54 -04: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 CliftonandShivan d7cee10cab Allow users to disable extension updates via brave://flags (#35301)
* Create a new feature for toggling extension updates

Also creates an entry on brave://flags

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

* Wire up the extension update check to the feature

* Update browser/about_flags.cc

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

---------

Co-authored-by: Shivan <shivankaulsahib@gmail.com>
2026-04-10 13:40:20 -07: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
Claudio DeSouza c61ac48541 [cr147] crx_installer.h under //extensions now
Chromium changes:
https://chromium.googlesource.com/chromium/src/+/b802470f2e9a7990d71239cc00c70e27048e6fa3

commit b802470f2e9a7990d71239cc00c70e27048e6fa3
Author: Miyoung shin <myid.shin@igalia.com>
Date:   Mon Feb 23 22:36:04 2026 -0800

    Move CrxInstaller to //extensions.

    This CL relocates CrxInstaller to //extensions since it no
    longer depends on //chrome, add interfaces for plumbing interfaces
    to get Blocklist, InstallStageTracker and InstallTracker
    from factories created in //chrome.

    Bug: 358567092
    Change-Id: I99827ac0dd76c89cefceacdeed4096c892ba4eba
    Bypass-Check-License: Moving files
    Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/7547427
    Commit-Queue: Miyoung Shin <myid.shin@igalia.com>
    Reviewed-by: Devlin Cronin <rdevlin.cronin@chromium.org>
    Reviewed-by: Hidehiko Abe <hidehiko@chromium.org>
    Cr-Commit-Position: refs/heads/main@{#1589181}
2026-03-26 19:25:22 -04:00
Kevin Smith d71c57efde [Rewards] Remove Rewards extension API (#34879) 2026-03-24 19:17:28 -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 6ad9768032 [Rewards] Move browser targets behind build flag (#33798) 2026-02-12 07:50:04 -05:00
cdesouza-chromium c69126a894 [CodeHealth] Use base::DictValue/base::ListValue - Part X (#33715)
These classes were hoisted and renamed. This has been replaced in
Chromium as well. This is a mechanical change for Brave, done with the
following script.

```
git grep -lw 'Value::List' | xargs sed -i 's/\bValue::List\b/ListValue/g'
git grep -lw 'Value::Dict' | xargs sed -i 's/\bValue::Dict\b/DictValue/g'
git cl format
```

Chromium changes:
https://chromium.googlesource.com/chromium/src/+/6bc468d481835992696083e99e556516fb7f5f80

```
commit 6bc468d481835992696083e99e556516fb7f5f80
Author: Avi Drissman <avi@chromium.org>
Date:   Thu Jan 29 22:14:50 2026 -0800

    Remove aliases for base::DictValue and base::ListValue

    This removes a few last stragglers as well.

    Fixed: 478100525
    Cq-Include-Trybots: luci.chromium.try:win-official,mac-official,linux-official,android-official,android-desktop-x64-official
    Change-Id: If92142b8ab0562a82c609b71c6b2a7665cea6ec6
    Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/7513889
    Auto-Submit: Avi Drissman <avi@chromium.org>
    Commit-Queue: Daniel Cheng <dcheng@chromium.org>
    Owners-Override: Daniel Cheng <dcheng@chromium.org>
    Reviewed-by: Daniel Cheng <dcheng@chromium.org>
    Cr-Commit-Position: refs/heads/main@{#1577038}
```

Issue: https://github.com/brave/brave-browser/issues/52435
2026-02-06 12:16:42 -03:00
Kevin Smith 2fd3ffa13a [Shields UI] Add Brave logo to app menu button (#33585) 2026-02-05 20:18:21 -05:00
Kevin Smith d3d3fa0744 [Rewards] Add a buildflag and conditionally disable Rewards UI (#33391) 2026-02-03 13:51:06 -05:00
Max Karolinskiy 66a91ce9f6 [cr145] Moves initializtion of GetComponentExtensionResourceManager data.
Moves initialization of GetComponentExtensionResourceManager data from
BraveExtensionsBrowserClientImpl::Init into BraveBrowserProcessImpl::Init.
BraveExtensionsBrowserClientImpl::Init is called early in the
BrowserProcessImple::Init code and at that point ApplicationLocaleStorage
(which is needed by GetComponentExtensionResourceManager) has not been
created yet. That now happens at the very end of BrowserProcessImple::Init.
So moving the data initialization code to BraveBrowserProcessImple::Init
after it calls BrowserProcessImple::Init.

Chromium change:
https://source.chromium.org/chromium/chromium/src/+/24ba37124af3a5f7b541389fa53c7876290d553f

commit 24ba37124af3a5f7b541389fa53c7876290d553f
Author: Glenn Hartmann <hartmanng@chromium.org>
Date:   Thu Dec 11 12:45:21 2025 -0800

    Start GlobalFeatures earlier and add more lifecycle hooks.

    Notable code changes:

    * `GlobalFeatures` initialization is split into 2 phases, with the first
      one happening very early in `BrowserProcessImpl::Init()` - before
      `ProfileManager` is created. The `CreateGlobalFeaturesForTesting()`
      method is correspondingly split in two. For now, the first phase only
      initializes `GlobalBrowserCollection`.

    * `GlobalFeatures` "core features" initialization is also split into 2,
      since `GlobalBrowserCollection` is a core feature needed in tests, and
      some tests need to be able to initialize `TestingProfileManager` after
      `GlobalBrowserCollection` and before the rest of `GlobalFeatures`.

    * `GlobalFeatures` shutdown is split into 2 phases to mirror the
      initialization order. The latter shutdown phase only cleans up
      `GlobalBrowserCollection` for now, and happens very late - in
      particular, after `ProfileManager` and `ResourceCoordinatorParts` are
      shut down.

    * A few unit tests are updated to sandwich the `TestingProfileManager`
      initialization and shutdown between `GlobalFeatures` init and shutdown
      phases. This needs to happen in this CL (not a follow-up) because
      these tests instantiate their own `TestingProfileManager` and also
      rely on Glic `GlobalFeatures` which interact with `ProfileManager` and
      `GlobalBrowserCollection`.

    * New methods `TestingBrowserProcess::SetUpGlobalFeaturesForTesting()`
      and `TestingBrowserProcess::TearDownGlobalFeaturesForTesting()` are
      added so test authors (usually) don't need to worry about the specific
      init and shutdown order of profile manager, global features, and
      resource coordinator parts.

    Bug: 467395900
2026-01-29 13:40:40 -05:00
Claudio DeSouza c164d6759c [cr145] IWYU for callback_helpers.h
This change does IWYU additions for all cases where `base::DoNothing` is
used. Furthermore, this change removes some of the uses of
`base::DoNothing` as an argument default value in a header, removing the
need to add `callback_helpers.h` to those headers.

Chromium changes:
https://chromium.googlesource.com/chromium/src/+/e8436cccafc34d6e4d9c060f682345060579d208
https://chromium.googlesource.com/chromium/src/+/227f058d9b9e27370a64b34046d71b9f23106409

commit e8436cccafc34d6e4d9c060f682345060579d208
Author: Lei Zhang <thestig@chromium.org>
Date:   Fri Dec 12 15:16:22 2025 -0800

    Forward declare base::ScopedClosureRunner in some Blink headers

    Avoid including base/functional/callback_helpers.h when not needed. Also
    use base/functional/callback_forward.h since callback_helpers.h was
    providing callback.h. For scrollable_area.h, make this possible by
    getting rid the default arguments to PerformSnapping(),
    SnapAtCurrentPosition(), and SnapForEndPosition(). These methods have
    very few callers, so just pass in all the arguments. Then do IWYU to fix
    the build.

    Change-Id: I5cfd017bd6f392b0d97e99c41d4885fac7140a4c
    Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/7254408
    Commit-Queue: Philip Rogers <pdr@chromium.org>
    Auto-Submit: Lei Zhang <thestig@chromium.org>
    Reviewed-by: Philip Rogers <pdr@chromium.org>
    Reviewed-by: Christoph Schwering <schwering@google.com>
    Reviewed-by: Robert Flack <flackr@chromium.org>
    Cr-Commit-Position: refs/heads/main@{#1558318}

commit 227f058d9b9e27370a64b34046d71b9f23106409
Author: Lei Zhang <thestig@chromium.org>
Date:   Thu Dec 11 21:30:12 2025 -0800

    Do IWYU for callback_helpers.h in async_dom_storage_database.cc

    Add callback_helpers.h for base::DoNothing() usage. The transitive
    include that makes this work as-is will be deleted in the near future.

    Change-Id: Id5ba6db705434734a854874923b7bb196392ca6c
    Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/7253640
    Commit-Queue: Mingyu Lei <leimy@chromium.org>
    Auto-Submit: Lei Zhang <thestig@chromium.org>
    Reviewed-by: Mingyu Lei <leimy@chromium.org>
    Cr-Commit-Position: refs/heads/main@{#1557849}
2026-01-29 13:40:34 -05:00
Aleksei Seren 5035b4095b [ads] Add Brave Ads buildflag for Rewards code (#33180)
Add Brave Ads buildflag checks to Brave Rewards code
which depends on Brave Ads. This is a pre-requisite for
moving Brave Ads code under a build flag.
2026-01-19 16:27:23 -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
Kevin Smith 0164d5508a [NTP] Move browser test to new NTP target (#32659) 2025-12-04 07:21:40 -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
cdesouza-chromium b4326e9f20 [CodeHealth] namespace pollution clean up for BaseLocalDataFilesBrowserTest (#32447)
This PR is a namespace pollution clean up, following the style guide
recommendation that `using` namespace inclusions should not be done in
header files, or in the global namespace.

https://google.github.io/styleguide/cppguide.html#Namespaces

Bug: https://github.com/brave/brave-browser/issues/50970
2025-11-20 18:37:28 +00:00
Claudio DeSouza 40707f07a9 [cr143] Several extension install files moved
This affects a few file inclusion and the introduction of a factory for
the instantiation of one fo the classes, but all this is very minimal,
and straight up mechanical changes. The exception is that
install_verifier.cc override is including code from
brave/browser/extensions which would now be a layering violation. To
avoid adding new patches for dependencies, moved the content of
brave/browser/extensions/manifest_v2/brave_hosted_extensions.h/cc into
chromium_src overrides of extensions/browser/extension_util.h/cc.

Chromium changes:
https://chromium.googlesource.com/chromium/src/+/ad059894f54753f71cf686fa67677339254921b4

commit ad059894f54753f71cf686fa67677339254921b4
Author: Miyoung shin <myid.shin@igalia.com>
Date:   Fri Oct 17 06:55:39 2025 -0700

    Move InstallVerifier and related install* files to //extensions
    as they no longer depend on //chrome.

    This CL does not introduce any behavior changes, but it adds interfaces
    for plumbing to ExtensionManagement in ExtensionsBrowserClient.

    Bug: 358567092
    Change-Id: I38faba23335364c47a4f93c3d886d03dd44586a7
    Bypass-Check-License: Moving files
    Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/7005871
    Commit-Queue: Miyoung Shin <myid.shin@igalia.com>
    Reviewed-by: David Trainor <dtrainor@chromium.org>
    Reviewed-by: Mike West <mkwst@chromium.org>
    Reviewed-by: Devlin Cronin <rdevlin.cronin@chromium.org>
    Cr-Commit-Position: refs/heads/main@{#1531391}
2025-11-18 11:26:21 -05:00
Claudio DeSouza 13a2651e70 [cr143] GURL::*_piece() removed
All the main methods now return a string_piece, which made the `_piece`
functions redundant.

Chromium changes:
https://chromium.googlesource.com/chromium/src/+/566074ac1aee3a91cbec0d2eac3120b7dd71860b

commit 566074ac1aee3a91cbec0d2eac3120b7dd71860b
Author: Charlie Harrison <csharrison@chromium.org>
Date:   Mon Oct 6 19:18:05 2025 -0700

    Remove GURL::*_piece() method

    There are no more users of this deprecated and misnamed API.
    This completes phase 1.5 of crbug.com/448174617.

    Bug: 448174617
    Change-Id: I82918ec4ec10b68729c31cb36487c7cb02ad0b56
    Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/7008912
    Reviewed-by: Daniel Cheng <dcheng@chromium.org>
    Commit-Queue: Daniel Cheng <dcheng@chromium.org>
    Owners-Override: Charlie Harrison <csharrison@chromium.org>
    Owners-Override: Daniel Cheng <dcheng@chromium.org>
    Cr-Commit-Position: refs/heads/main@{#1525986}
2025-11-18 11:18:46 -05:00
Claudio DeSouza b751afaf3d [cr143] Extension::Create taking a u16string arg
This used to be a `std::string`.

Chromium changes:
https://chromium.googlesource.com/chromium/src/+/79167e224d3cd322af1031bb0124212580e7cde8

commit 79167e224d3cd322af1031bb0124212580e7cde8
Author: Jaewon Jung <jw.jung@navercorp.com>
Date:   Thu Oct 2 19:04:02 2025 -0700

    Use std::u16string for Extension::Create() error parameter

    The `Extension::Create()` method and its callers used `std::string` for
    the error output parameter, leading to unnecessary conversions between
    UTF-8 and UTF-16.

    This change migrates the error parameter to `std::u16string` across
    the call stack. This eliminates string conversions, simplifying the
    code and improving consistency. In a few places where a `std::string`
    is still required, a temporary conversion is performed.

    Signed-off-by: Jaewon Jung <jw.jung@navercorp.com>
    Bug: 41317803
    Change-Id: Ia660ca60834f233eca82e8f2b65961cce48230d6
    Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/6975452
    Reviewed-by: Devlin Cronin <rdevlin.cronin@chromium.org>
    Reviewed-by: Hidehiko Abe <hidehiko@chromium.org>
    Cr-Commit-Position: refs/heads/main@{#1524554}
2025-11-18 11:18:38 -05:00
cdesouza-chromium 44dd177f5d [IWYU] base/memory/scoped_refptr.h in //brave/browser (#32381)
This PR does some IWYU for `base/memory/scoped_refptr.h` under
`//brave/browser`. This uses the standard script with the following
dataset:

```
HEADER_FUNCTION_SETS = [
    (
        '"base/memory/scoped_refptr.h"',
        (
          "scoped_refptr",
        ),
    ),
]
```

Bug: https://github.com/brave/brave-browser/issues/42212
2025-11-18 15:14:30 +00: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
Simon Hong da6981ee11 Migrated to chromium's browser color scheme handling (#32113)
Resolves brave/brave-browser#40863

With this PR, we use chromium's browser theme instead of ours.
Removed all our dark mode handling code.
Only left dark mode value in local state for migration.

BraveCustomzieColorSchemeModeHandler was introduced to set user's theme choice
to our local state prefs instead of chromium's profile color scheme. Removed.

All our changes to NativeTheme are removed.

Migrated current dark theme mode to per-profile browser color scheme.
ThemeService migrates only once.
After it's migrated, browser will have per-profile theme mode like chromium does.

TEST=BraveThemeServiceTest.BraveDarkModeMigrationTest
2025-11-13 11:39:18 +09: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
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
Simon Hong f064098d43 Cleanup deprecated brave theme apis (#32089)
Issue: brave/brave-browser#40863

This is the effort to reduce the size of #31939
and only removes already deprecated codes that refers brave dark theme api.
2025-10-30 09:24:51 +09:00
cdesouza-chromium 07b587a892 [CodeHealth] Use BASE_FEATURE with two args where possible (#32041)
This PR corrects several places where `BASE_FEATURE` is being used to
rely on the two-arg variant of this macro. This particular PR has no
functional changes, and the only feature declarations affected are the
ones for which the feature-name constant, and the actual value are
identical.

The particular issue for this will be left open so subsequent work for
the other features can be followed up on.

Bug: https://github.com/brave/brave-browser/issues/50492
2025-10-27 18:56:50 +00:00
cdesouza-chromium 12e0c0aed7 [CodeHealth] Use base::WriteJson - Part I (#32035)
This PR migrates several uses of `base::JSONWriter::Write` over to
`base::WriteJson`, following the upstream migration.

Bug: https://github.com/brave/brave-browser/issues/50480
2025-10-26 10:42:47 +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
Claudio DeSouza dacb37795f [cr142] JSONReader::ReadDict removed default options
Callsites to this function are now expected to provide the options
value. This change corrects all callsite to the previous default value,
`JSON_PARSE_CHROMIUM_EXTENSIONS`.

Chromium changes:
https://chromium.googlesource.com/chromium/src/+/cdb7175c83d9cc319e437da48836ae961cac4adc

commit cdb7175c83d9cc319e437da48836ae961cac4adc
Author: Daniel Cheng <dcheng@chromium.org>
Date:   Thu Sep 25 08:39:08 2025 -0700

    Remove base::JSONReader::ReadDict's default argument for parsing options

    Callers should be explicit if they need to opt into non-compliant JSON
    parsing that allows Chromium-specific extensions, e.g. comments.

    Bug: 446188265
    Change-Id: If70a198e7c1266ec22e8ef6dc6c38b01504bb530
    Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/6976572
    Commit-Queue: Daniel Cheng <dcheng@chromium.org>
    Reviewed-by: Lei Zhang <thestig@chromium.org>
    Cr-Commit-Position: refs/heads/main@{#1520631}
2025-10-15 20:31:22 -04:00
Claudio DeSouza 9fd9fa7ca0 [cr142] InstallTracker::Get deleted
`InstallTracker` has been moved from `//extension` to `//chrome`, and
with it `InstallTracker::Get` is removed, with the tracker now retrieved
with `InstallTrackerFactory::GetForBrowserContext`.

Chromium changes:
https://chromium.googlesource.com/chromium/src/+/87793c0b01c26b5bca5e35641c22e9921b78885c

commit 87793c0b01c26b5bca5e35641c22e9921b78885c
Author: Miyoung shin <myid.shin@igalia.com>
Date:   Thu Sep 25 22:02:50 2025 -0700

    Move InstallTracker and related install* files to //extensions
    as they no longer depend on //chrome.

    This CL does not introduce any behavior changes.

    Bug: 358567092
    Bypass-Check-License: Moving files
    Change-Id: I960d8495818ad6e573d8bb9cb44023f701b4d278
    Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/6963957
    Reviewed-by: Hidehiko Abe <hidehiko@chromium.org>
    Reviewed-by: Devlin Cronin <rdevlin.cronin@chromium.org>
    Commit-Queue: Miyoung Shin <myid.shin@igalia.com>
    Cr-Commit-Position: refs/heads/main@{#1521054}
2025-10-15 20:31:16 -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
Pavel Beloborodov 940ddc5ae2 Merge MV2 extension deprecation stages into DeprecationWarning (#31302)
Use only the Warning of MV2 extensions deprecation stages.
2025-10-06 10:59:53 +07: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