Commit Graph
76038 Commits
Author SHA1 Message Date
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
Jocelyn Liu 1aff3a28ed [AI Chat] [Conversation API V2] Ignore empty favicon string in WebSource (#34402)
[AI Chat] [Conversation API V2] Ignore empty favicon string

Treat empty favicon strings the same as missing ones.
2026-03-04 00:46:30 +01:00
samartnik 5fce4013bc [Code Health][Android] Clean up code for brave_xml_preprocessor template (#34406) 2026-03-03 23:01:03 +00:00
Eli Hini e374bfc6fe [iOS]Fix Unlock and Cancel buttons not shown when creating new private tab (#34382)
Fix Unlock and Cancel buttons not shown when creating new private tab with lock enabled

When "Require Touch ID/Face ID" was enabled for private tabs, the Unlock and Cancel buttons were hidden when creating a new private tab via the + button and cancelling the biometric prompt.

- Always show Unlock button when auth fails so user can retry
- Set isCancellable=true for non-external view types to show Cancel button

Signed-off-by: Eli Hini <8249954+EliHini@users.noreply.github.com>
2026-03-03 14:13:06 -08:00
Sangwoo Ko 263959fa7f [Containers] Show PageActionView for partitioned storage tab in location bar (#34248)
* Show PageActionView for partitioned storage tab in location bar

When the current tab uses a Brave container (partitioned storage), show the
page action in the location bar with the container's icon, name, and
background color from ContainerModel.

- Register kPartitionedStorageActionIconType and enable it in the location
    bar only when ENABLE_CONTAINERS and the Containers feature are on.
- Add PartitionedStoragePageActionController that resolves the tab's
    container via GetContainerIdForWebContents and ContainerModel, and drives
    the generic PageActionView (Show/Hide, OverrideImage/Text, etc.); the
    action is hidden when the tab has no container.
2026-03-04 06:49:08 +09:00
Serg 8c0ed68c2e [Android] Gate email aliases preference behind kEmailAliases feature flag (#34403)
The email aliases toggle in Brave Origin settings was always visible
regardless of whether the feature flag is enabled. Since the feature is
disabled by default, users would see a non-functional toggle.

Expose kEmailAliases to Java via ChromeFeatureList and hide the
preference when the flag is disabled.

Resolves: https://github.com/brave/brave-browser/issues/53323
2026-03-03 21:36:30 +00:00
Jay Harris 5b27bedcaa [AI Chat]: Limit results displayed in attachments menu (#34350) 2026-03-04 10:02:21 +13:00
Kyle Hickinson 70bb0664dd [iOS] Add package.json to control module type in iOS (#34363)
* [iOS] Add package.json to control module type in iOS

This adds a new `package.json` in `//brave/ios` to ensure that usages of the iOS JS tooling `optimize_ts`/`compile_ts` use the correct module type (`nodenext`). This is a prerequisite to building Brave JavaScriptFeature's with TypeScript

* Migrate iOS webpack.config.js to ESM syntax
2026-03-03 21:12:21 +01:00
Agustín RuizandSimon Hong 1fd45449a4 Update to sidebar header styles for upcoming wallet as sidepanel (#34354)
* Update to styles for upcoming wallet as sidepanel

effort to standadrize panels in desktop so the future wallet as a sidebar item can work correctly https://www.figma.com/design/Fbtxfv2ATGlfH7nPXiWAbR/%F0%9F%92%BB-Browser-Sidebar?node-id=1749-34459

* remove hardcoded background color that was messing up theming

* update backgrounds in panels so now they're themable

* update theme selector and toolbar customizer to be responsive.

Bonus, but it's very badly needed to have a properly responsive panel

* Address feedback

Address feedback from @fallaciousreasoning

* Delete unnecessary image files

* Formatting

---------

Co-authored-by: Simon Hong <shong@brave.com>
2026-03-04 09:01:46 +13:00
Darnell Andries 23fe5d1991 Add "is default" metric attribute (#33851)
* Add "is default" metric attribute

* Address PR feedback

* Use `static_library` for `default_browser_monitor`

* Address PR feedback
2026-03-03 10:51:22 -08:00
brave-builds 6d3a46264d 1.89.98 2026-03-03 16:35:33 +00:00
Jakub Wądołowski 22ed791e75 fix(script/uplift): Handle empty cherry-pick errors gracefully (#33142)
* fix(script/uplift): Handle empty cherry-picks

* fix(script/uplift): Skip commit squashing for empty change sets
2026-03-03 16:58:01 +01:00
Anton Paymyshev f39f0bebb0 Fix send max amount regression for Cardano (#34385) 2026-03-03 15:38:43 +00:00
Serg e7fa442510 DayZeroBrowserUIExptManager crashes when P3A is toggled off-on-off (#34370)
fix: DayZeroBrowserUIExptManager crashes when P3A is toggled off-on-off

ResetBrowserUIStateForAllProfiles() was resetting observation_ when P3A
was disabled, but SetDayZeroBrowserUIForAllProfiles() never re-established
it when P3A was re-enabled. Toggling P3A off a second time hit the
CHECK(observation_.IsObserving()) because the observation was already reset.

Remove the observation_.Reset() from ResetBrowserUIStateForAllProfiles().
It's unnecessary because OnProfileAdded() already guards on IsP3AEnabled(),
making it a no-op when P3A is off.

Also destroy the p3a_enabled_ pref subscription in
OnProfileManagerDestroying() to prevent the callback from firing after
the ProfileManager is gone.

Resolves: https://github.com/brave/brave-browser/issues/53294
2026-03-03 15:30:10 +00:00
brave-builds c689c93d48 1.89.97 2026-03-03 14:28:30 +00:00
yan fb22490342 update serialize-javascript (#34349)
fix https://github.com/brave/brave-browser/issues/53268
2026-03-03 14:24:22 +00:00
brave-builds 0466dcb4f2 1.89.96 2026-03-03 12:33:34 +00:00
Terry Mancey 6220eb7035 Deterministically classify “other” search engines (#34271)
Use an allow list to deterministically classify ‘other’ search engines.
2026-03-03 12:10:02 +00:00
brave-builds 099988b0dc 1.89.95 2026-03-03 12:03:36 +00:00
Agustín Ruiz f7629d9a13 Remove inner shadow from Settings header when inner page scroll is used (#34359)
remove inner shadow
2026-03-03 11:52:40 +00:00
Pavel Beloborodov c67e3ed3f4 Fixed SameSite cookies exposed due cross-site navigations. (#34352)
* Fixed SameSite cookies exposed due cross-site navigations.
2026-03-03 16:08:02 +07:00
Darnell Andries 8e2d58111d [AI Chat] Add chart creation ability to code execution tool (#33457)
* [AI Chat] Add chart creation ability to code execution tool

* Move chart display to separate web ui

* Address PR feedback

* Add story for chart display

* Address PR feedback

* Disable chart generation by default

* Fix broken browser test

* Add data size limits to chart artifact
2026-03-03 07:59:35 +00:00
Jocelyn Liu d30001c5a5 [AI Chat] [BYOM] Support tab focus in oai_engine and oai_api_client (#34204)
* [AI Chat] [BYOM] Support tab focus in oai_engine and oai_api_client

- Use shared OAI message utils to build tab focus messages in oai_engine
- Translate customized tab focus content blocks to standard text content
  blocks with prompts in oai_api_client

* [AI Chat] Handle empty tabs in tab focus APIs

Add early-return with InternalError when empty tabs are passed
to GetSuggestedTopics and GetFocusTabs, preventing
base::BarrierCallback from being created with 0 callbacks.
2026-03-03 07:23:39 +00:00
brave-builds 66fe8feb2c 1.89.94 2026-03-03 05:58:01 +00:00
Kyle Hickinson b700154649 [iOS] Don't create default WebKit configuration in TabStateFactory (#34378)
Follow-up fix for #34329 where a default WebKit configuration was being created anyways and would assert when `UseProfileWebViewConfiguration` was enabled.
2026-03-03 05:36:47 +00:00
Anthony Tseng 371b87ab2b Add LocalAIService for on-device ML inference via Mojo (part 1) (#33724)
* Add simplified candle.mojom interface

Add the CandleService and EmbeddingGemmaInterface mojom interfaces
for communication between the browser process and WASM renderer.

* Add CandleService and CandleServiceFactory

Add the CandleService KeyedService with background WebContents
management for running WASM in a hidden renderer. Includes the
CandleServiceFactory, idle timer for cleanup, and pending request
queue.

* Rename CandleService to LocalAIService

- Rename CandleService -> LocalAIService
- Rename CandleServiceFactory -> LocalAIServiceFactory
- Update all file names and references
- Add comprehensive class documentation explaining:
  - Purpose: on-device ML capabilities
  - Implementation: Currently uses Candle via WASM
  - Architecture: Hidden WebContents + Mojo IPC
  - Memory management: Idle timeout and cleanup
- Keep Candle-specific names for WASM bridge and resources

* Extract BackgroundWebContents interface for LocalAIService

Move background WebContents management from LocalAIService into a
BackgroundWebContents abstract interface (core/) with
BackgroundWebContentsImpl (content/) as the concrete implementation.
This follows the BackgroundContents delegate pattern from Chromium,
providing renderer crash detection and clean shutdown semantics.

LocalAIService now receives a factory callback instead of a
BrowserContext*, keeping it platform-agnostic and testable.

* Add unit tests for LocalAIService

Test request queueing, BindEmbeddingGemma processing pending
requests, Shutdown failing pending requests, and delegate
callback state reset on terminated/closed events.

* Add task manager integration for BackgroundWebContents

Tag the BackgroundWebContents with CreateForToolContents so it shows
up as "Tool: Local AI" in the task manager. Use a callback injected
by LocalAIServiceFactory to respect the components/chrome layering
boundary.

* Rename to model-agnostic terminology per review

- EmbeddingGemmaInterface -> OnDeviceModelWorker
- BindEmbeddingGemma -> RegisterOnDeviceModelWorker
- Embed -> GenerateEmbeddings
- kUntrustedCandleEmbeddingGemmaWasmURL -> kUntrustedOnDeviceModelWorkerURL
- URL: chrome-untrusted://on-device-model-worker/
- Internal members: embedding_gemma_remote_ -> model_worker_remote_,
  PendingEmbedRequest -> PendingRequest, EnsureWasmWebContents ->
  EnsureBackgroundContents, CloseWasmWebContents ->
  CloseBackgroundContents

* Add PassageEmbedder interface and eliminate LocalAIService proxy

Introduce a shared PassageEmbedder mojom interface that replaces
OnDeviceModelWorker. Move the ReceiverSet and forwarding logic into
BackgroundWebContentsImpl so consumers get a Remote<PassageEmbedder>
bound directly to the content layer. LocalAIService becomes pure
lifecycle management with RegisterPassageEmbedder/GetPassageEmbedder.

* Replace PassageEmbedder proxy with PassageEmbedderFactory

BackgroundWebContentsImpl was acting as a ReceiverSet proxy between
consumers and the renderer's PassageEmbedder. Per review feedback,
this is an unnecessary layer — consumers should bind directly to the
renderer.

Introduce PassageEmbedderFactory (renderer-implemented) that creates
direct consumer→renderer PassageEmbedder bindings on demand. The
service manages the factory lifecycle and defers GetPassageEmbedder
callbacks until the factory is registered.

BackgroundWebContents interface is now pure lifecycle (no mojo).
BackgroundWebContentsImpl no longer implements mojom::PassageEmbedder.
2026-03-02 19:06:13 -08:00
Jocelyn Liu ea3947f810 [AI Chat] Fix web sources display delay for server search tools (#34377)
* [AI Chat] Emit server search web source events from parser immediately

Move web source/query event extraction from
ConversationHandler::OnEngineCompletionComplete into the OAI
parser. ParseToolCallResult now returns all events (ToolUse +
WebSources + SearchQueries) and the API client fires them
individually through the streaming callback, so they arrive
immediately during streaming rather than being extracted
after completion.

* [AI Chat]  Show web sources from earlier entries in task views

Source and search query events can arrive in earlier assistant
entries while the completion comes in a later entry in mixed
server and client tool case. Collect these events across all
entries and forward them to the completion step in both Progress
and Steps task views.
2026-03-03 02:26:12 +00:00
Simon Hong 01f638c996 [Cleanup] Delete redundant logic for centering dialog in split view (#34353)
As upstream manages tab modal's reposition for split tabs, we don't need to have ours.
`ContentsContainerView`'s `TabModalDialogHost` does it.

Deleted code was added by https://github.com/brave/brave-core/pull/24540.
2026-03-03 09:08:28 +09:00
brave-builds a0f500d790 1.89.93 2026-03-03 00:03:09 +00:00
Jay Harris a2cdd38ef2 [AI Chat]: Add box for filtering conversations by title (#34244) 2026-03-02 23:43:43 +00:00
Kyle Hickinson 510aaebc55 [iOS] [CodeHealth] Use tab's profile directly when available (#34374)
This replaces access to the global profile in scenarios that include a tab's context
2026-03-02 17:54:35 -05:00
Brian R. Bondy 1cbc3afe9a Narrow DEPS codeowners to root and chromium_src only (#34376)
Other DEPS files are covered by netzenbot's automated checks
and gn check. Root DEPS is a code execution channel on checkout
and chromium_src DEPS can't be validated by gn check, so those
still need manual review.
2026-03-02 16:36:04 -05:00
Brian R. Bondy e886177073 Remove CODEOWNERS rules for Brave Account (#34372)
Remove land-grab CODEOWNERS rules for Brave Account

The *brave_account* and *BraveAccount* wildcard rules match any file
path containing those strings, which is overly broad and triggers
unnecessary reviews. This is a "land-grab" pattern that taxes
productivity for developers who trigger those reviews.
2026-03-02 16:02:38 -05:00
Brian R. Bondy d6db5f12d7 Remove dead CODEOWNERS rules (#34371)
Remove dead CODEOWNERS rules for deleted files

- script/build-bisect.py: file was removed
- browser/ui/webui/brave_web_uicontroller_factory.cc: file was removed
- browser/ui/webui/brave_rewards_page_ui.{cc,h}: files were removed
- browser/ui/webui/brave_rewards_ui.{cc,h}: files were removed
- third_party/boost: directory was removed
- brave/components/l10n/: wrong path prefix (brave/) so it never
  matched anything, and the component is deprecated anyway
2026-03-02 16:02:22 -05:00
Serg cb5b0a007d [Android] fix: handle Mojo BadMessageException gracefully (#34360)
Chromium 146 introduced BadMessageException in the Java Mojo bindings
(crbug.com/469861566, https://github.com/chromium/chromium/commit/c04b8552deeef)
to surface malformed or unexpected messages (invalid headers, unknown methods,
deserialization errors, responses for already-cancelled requests). However, the
default ExceptionHandler simply re-throws the exception as unchecked, causing
crashes instead of gracefully closing the pipe.

This differs from the C++ Mojo bindings behavior where
Connector::DispatchMessage (mojo/public/cpp/bindings/lib/connector.cc) handles
dispatch failures by calling HandleError() which resets the pipe cleanly.

Set a delegate on ExceptionHandler.DefaultExceptionHandler that catches
BadMessageException and returns false (closing the pipe), while re-throwing
all other exceptions to preserve existing behavior.

Resolves: https://github.com/brave/brave-browser/issues/53290
2026-03-02 21:44:20 +01:00
Kyle Hickinson b21818c51d [iOS] Cancel navigations that respond with 204/205 status codes (#34325)
In iOS 26.2 a change shipped in WebKit (https://github.com/WebKit/WebKit/blob/2298f97e1caf0add0fd3d962dcbe7eb024a60b5f/Source/WebCore/loader/DocumentLoader.cpp#L1182) that aborted navigations that responded with 204 and 205 status codes.
2026-03-02 15:40:58 -05:00
Kyle Hickinson ec0b3a1f3d [iOS] Shift responsibility of nil WKWebViewConfiguration to call site (#34329)
Now that `TabStateFactory` is only used when creating actual tabs, the responsibility of passing in a nil `WKWebViewConfiguration` when `UseProfileWebViewConfiguration` is enabled can be shifted to the call site.

This also adds new asserts to ensure we aren't using TabManager's configurations when the feature flag is enabled.
2026-03-02 15:00:58 -05:00
Kyle Hickinson 9fb150885f [iOS] Add additional checks for updating loading bar progress (#34324)
This fixes a bug where the progress bar can get stuck at 10% even after a navigation finishes.
2026-03-02 14:32:46 -05:00
Kyle Hickinson 495b3fb3a0 [iOS] Add fallbacks for toolbar visibility & keyboard state conflicts (#34237)
This is a speculative fix for the URL bar being hidden after background Brave. It attempts to restore toolbar interactivity based on the keyboards state upon the scene activating along with adds additional checks during the visibility updates.
2026-03-02 14:18:00 -05:00
Netzenbot 3ff0c23ad0 Disable Chromium test RuntimeGetContextsApiTest.GetServiceWorkerContext (#34365)
This is an upstream Chromium test
(chrome/browser/extensions/api/runtime/runtime_apitest.cc) that crashes
with a segmentation fault on Linux x64 nightly builds (issue #53280).

The test is already disabled on Mac upstream (IS_MAC). Upstream LUCI
Analysis shows occasional failures in the android_browsertests variant
(1.4% flake rate, increasing to 5-6% in late February/March 2026),
while the browser_tests desktop variant shows 0.3% flake rate.

No Brave chromium_src overrides exist for ProcessManager, service
worker lifecycle, or the chrome.runtime.getContexts() API, so this
failure is not caused by Brave-specific modifications.

Another test from the same fixture (GetOffscreenDocumentContext) is
already disabled in this filter file.
2026-03-02 14:16:53 -05:00
NetzenbotandBrian R. Bondy 9f626444ef Disable flaky upstream test AutoPictureInPictureTabHelperBrowserTest.PromptResultRecorded_VideoConferencingAllowOnce (#34364)
Disable flaky Chromium test AutoPictureInPictureTabHelperBrowserTest.PromptResultRecorded_VideoConferencingAllowOnce

This is an upstream Chromium test with a 10.5% flake rate over 30 days
per LUCI Analysis. The crash is a null pointer dereference in
AutoPipSettingView::OnButtonPressed when the widget is destroyed before
the test can interact with the bubble view.

Brave does not modify any code in the auto picture-in-picture path.
Multiple other tests from the same test suite are already disabled in
the filter file for similar reasons.

Resolves https://github.com/brave/brave-browser/issues/53277

Co-authored-by: Brian R. Bondy <netzen@gmail.com>
2026-03-02 14:08:05 -05:00
AlexeyBarabash 352dd8ee1e [Android] Cherry-pick of M147 crash fix at ActivityTabWebContentsDelegateAndroid (#34356)
[Android] Cherry-pick of M147 crash fix at ActivityTabWebContentsDelegateAndroid.java

Resolves https://github.com/brave/brave-browser/issues/53285

This is a cherry-pick to fix the crash

Original commit:
https://source.chromium.org/chromium/chromium/src/+/ad0cd3bfdafd8f641c623a63647066567c1cf234

commit ad0cd3bfdafd8f641c623a63647066567c1cf234
Author: Abdelrahman Eed <abdoeed@google.com>
Date:   Tue Feb 24 01:29:51 2026 -0800

    [ExclusiveAccessManager] Fix crash in 'requestPointerLock'

    Change assert with a check to fail gracefully in stable if
    mExclusiveAccessManager is null.

    Bug: 484081504
    Change-Id: I64fd1d3a954d6c0b806c1f5f466d36d4c1dd3f45
    Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/7599042
    Reviewed-by: Andrew Grieve <agrieve@chromium.org>
    Auto-Submit: Abdelrahman Eed <abdoeed@google.com>
    Commit-Queue: Abdelrahman Eed <abdoeed@google.com>
    Cr-Commit-Position: refs/heads/main@{#1589245}
2026-03-02 21:05:31 +02:00
NetzenbotandClaude Opus 4.6 5d80fd8a18 Fix flaky BraveWalletSignMessageBrowserTest.SIWE test (#34285)
* Fix flaky BraveWalletSignMessageBrowserTest.SIWE test

The SIWE test sends two sign messages per iteration: one with matching
origin and one with a different origin ("www.a.com"). The second message
is rejected immediately by the provider, overwriting the global
signMessageResult variable with an error. After
NotifySignMessageRequestProcessed approves the first message, the test
immediately checked signMessageResult, but the mojo approval response
may not have been delivered to the renderer yet, so signMessageResult
still contained the rejection error.

Fix by replacing the immediate getSignMessageResult() check with a
Promise-based wait that polls until signMessageResult is a string
starting with "0x" (the signature). This is safe because both the
rejection and approval go through the same mojo interface, so the
rejection always arrives before the approval.

Resolves https://github.com/brave/brave-browser/issues/53167

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>

* Address review: fix same race condition in other sign message tests

Apply the same async polling pattern to UserApprovedRequest and
UserRejectedRequest tests, which had the same race condition of
calling getSignMessageResult() immediately after
NotifySignMessageRequestProcessed() without waiting for the mojo
response to arrive at the renderer.

---------

Co-authored-by: Claude Opus 4.6 <noreply@anthropic.com>
2026-03-02 13:12:55 -05:00
Shisir Basel d6eaac8271 Fix Leo Temporary Button Bug (#34328) 2026-03-02 12:56:47 -05:00
Stephen O'Farrellandjameshawrych c333ff87e7 [Leo] 2026 Feb Model Upgrade (#33973)
* [Leo] update models

* add near GLM 5

* address netzen comments

* formatting

* add removed models to clearprefs migration

* correct model key name to chat-near-deepseek

* clean up strings

---------

Co-authored-by: jameshawrych <69646550+jameshawrych@users.noreply.github.com>
2026-03-02 17:18:22 +00:00
brave-builds 70d8ceceed 1.89.92 2026-03-02 16:03:20 +00:00
Simone Arpe 32a340275c Fix HeadingH1/2/3/4 by adding android:textStyle bold (#34355) 2026-03-02 16:49:20 +01:00
brave-builds 1cbbe20a66 1.89.91 2026-03-02 12:33:38 +00:00
brave-builds b7a041c678 1.89.90 2026-03-02 12:03:26 +00:00
Dev 36605e97e0 fix: remove secret key material from log messages (#34265)
* fix: remove secret key material from log messages

CRITICAL: Several VLOG(1) statements were logging plaintext secret
key material that could be captured via adb logcat (Android) or
Console.app (iOS):

- browser/android/brave_sync_worker.cc: Sync recovery phrase (seed
  words) and hex-encoded sync seed logged on parse failure
- ios/browser/api/sync/brave_sync_worker.cc: Same issue on iOS
- components/brave_wallet/browser/filecoin_keyring.cc: Import payload
  containing Filecoin private key logged on JSON parse failure

These log statements would expose the user's master sync secret or
private key material to any process with log access. The fix removes
the secret material from all log messages while preserving the
diagnostic error information.

* fix: also redact plaintext sync code from LOG(ERROR) in SetSyncCode (iOS) and SaveCodeWords (Android)

* fix: apply clang-format to sync worker files
2026-03-02 10:51:59 +00:00