Chromium changes:
https://chromium.googlesource.com/chromium/src/+/c9dcfbf7aa3318b019a3802c0bdc0f7ee452c731
commit c9dcfbf7aa3318b019a3802c0bdc0f7ee452c731
Author: Michael Tatarski <mtatarski@google.com>
Date: Tue Mar 10 08:07:45 2026 -0700
Consolidate device name resolution logic into sync_device_info
Building on the previous extraction of `GetDeviceDisplayNames`
(https://crrev.com/c/7638170), this CL further centralizes device naming
logic by introducing `GetDeviceDisplayNamesForList()`.
Previously, both Send Tab to Self and Sharing Message independently
implemented logic to deduplicate device lists, filter out the local
device, and choose between short and full device names based on name
collisions. This logic is now unified within `sync_device_info`.
This is a pure refactoring and introduces no functional changes to the
generated device lists or names.
Bug: 485549442
Change-Id: Ib1f2c020386f23306edc35b43b9521027b9624ba
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/7645592
Commit-Queue: Michael Tatarski <mtatarski@google.com>
Reviewed-by: Mitsuru Oshima <oshima@chromium.org>
Reviewed-by: Mikel Astiz <mastiz@chromium.org>
Cr-Commit-Position: refs/heads/main@{#1597067}
Skia's `SkCanvas` requires the usage of a `DiscardableMemoryAllocator` which is not set in Chromium iOS so the shared scale logic fails a CHECK and crashes at runtime.
This applies the same 1024x768 limit as when you paste an image into Leo to the photo picker & camera attachment options which should help with web process lagging and possibly crashing while it loads the image into context.
Guards against notifying observers more than once when multiple pref
changes trigger the ineligibility check simultaneously, and renames
related identifiers for clarity. No behavioral changes.
Part of https://github.com/brave/brave-browser/issues/54917.
Adds IsIneligibleToStart and IsInitialized accessors to AdsService
along with an OnAdsServiceIneligibleToStart observer notification.
AdsServiceWaiter gains wait helpers that check whether a lifecycle
event has already fired before blocking, so tests can safely observe
startup and shutdown regardless of timing.
This temporarily adds a internal scheme handler for the old NTP url (`internal://local/about/home`) so that legacy URLs that may still exist in a users back/forward list and open tabs will load correctly after upgrade
Add ObjC bridge for the SERP metrics
Expose the SERP metrics service to iOS Swift and Objective-C consumers
through a new ObjC protocol and SERP metrics service factory bridge.
This replaces the DataDecoder service which is not available to use and hits a fatal CHECK on iOS when not building with blink, fixing the crash when pasting images into the input field on Leo WebUI
This adds a JavaScriptFeature that enables the auto highest quality video feature on YouTube videos when using the `UseProfileWebViewConfiguration` feature flag
This migrates the media preference that controls whether or not we automatically set youtube videos to the highest quality to Chromium's preferences. This is required to implement the same JavaScript feature when using profile web view configurations.
Applies a set of code health fixes to the serp metrics time period
storage layer: normalises the pref store constructor interface,
uses C++ references for non-nullable service dependencies, adds
final to concrete classes, relocates test-only headers to test/
subdirectories, and gives test helpers fully qualified names.
This adds a base JavaScriptFeature for accessing safe builtins in Brave JS features that require it based on the code in `__firefox__.js`. The main difference here is that this PR only focuses on the builtins (Object, Function, Array) needed for Web3 scripts and does not handle any `toString` overrides (which were only needed for tokenized communication)
Adds a singleton QueryFilterData class to load, and then parse the downloaded rules of [query-filter component](https://github.com/brave/brave-browser/issues/54393). The `QueryFilterData` class then store these rules in memory via a `vector` of new data structure `QueryFilterRule` which is exposed to public via the member `rules()` method.
Client integration to consume the query-filter would be followed-up in the next change. This change also includes unit tests, and was also tested manually to ensure the component was downloaded from server and was parsed correctly. The change is behind the feature flag [kQueryFilterComponent](https://sourcegraph.com/r/github.com/brave/brave-core/-/blob/components/query_filter/common/features.cc?L13) which is disabled by default.
Brave handles the web views frame while scrolling on the Swift side so we need to return true for the `IsSmoothScrollingSupported` web client method so that it doesn't automatically inset the web view by the safe area
Chromium change:
commit 0b9166658b79a5f788860e3e215165d8d26d73b1
Author: Gauthier Ambard <gambard@chromium.org>
Date: Mon Mar 9 08:40:04 2026 -0700
[iOS] Replace use of SmoothScrolling flag with the provider
This is how it is supposed to be used. Make sure to move all the uses of
the smooth scrolling flag at the same time to have a state where half
the app is using the flag and the other app the provider.
Also, updates the test to ensure they only run when the provider is
returning true.
The download manager test is updated as the tap was failing.
Bug: 483998779
Change-Id: Ic81a977ecbc0ebc131c49bd992511a97eb916abb
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/7648409
Reviewed-by: Aliona Dangla <alionadangla@chromium.org>
Commit-Queue: Gauthier Ambard <gambard@chromium.org>
Cr-Commit-Position: refs/heads/main@{#1596357}
serp_metrics makes its own copy of the time_period_storage types
with SerpMetrics prefixed names to allow adding new functionality
that is not compatible with existing interfaces and to reduce the
risk of breaking existing P3A functionality.
This fixes a bug where the a webpage could request basic auth credentials indefinitely after a user inputs invalid credentials as Brave would simply automatically resubmit with those credentials. This change ensures that the prompt is always displayed to the user regardless and just pre-fills the prompt with the supplied credential for the user to correct on follow-up auth attempts.
[ads][CodeHealth] Separate callback type ownership by build layer
Removes callback type aliases from `core/public/ads_callback.h` that
are no longer used by the `Ads` public interface. Separates callback
type ownership by build layer: `ads_service_callback.h` (always-built)
owns the callback types for `AdsService`, and `ads_callback.h`
(ads-only, with `static_assert(BUILDFLAG(ENABLE_BRAVE_ADS))`) owns the
callback types for `Ads`. This prevents the always-built `AdsService`
from including ads-only headers. No behavioral changes.
* [ads][CodeHealth] Improve code documentation
Documents nullable constructor parameters, standardises the not-owned
comment style, adds missing override group labels, wraps code
identifiers in backticks in comments, and expands the GLOSSARY with
new terminology.
No behavioral changes.
* [ads][CodeHealth] Use correct mojom header variants in headers
Replace heavyweight mojom includes with the lightest variant that
satisfies each header's actual type dependencies. Headers that only
need enum values switch from .mojom.h to .mojom-shared.h, which is
the correct public route to enum definitions. Headers that only
reference a type in a function signature or type alias switch to
.mojom-forward.h. Two files that directly included .mojom-data-view.h
are fixed since that file carries IWYU pragma: private and must not be
included outside of mojom_traits files. One test utility that included
both .mojom-forward.h and .mojom.h for the same module drops the
redundant forward include, as .mojom.h already re-exports it.
No behavioral changes.
[ads][CodeHealth] Use raw_ref for prefs_ and local_state_ members
Replace raw_ptr with raw_ref for all prefs_ and local_state_ members
across VirtualPrefProvider, AdsServiceImpl, AdsServiceDelegate,
AdsServiceImplIOS, and BraveStatsHelper. These members are always
non-null at construction and are now typed to express that invariant.
Update the VirtualPrefProvider free functions IsSurveyPanelist and
GetSkus to take const PrefService& to eliminate conversion at call
sites. Simplify the CHECK_IS_TEST guard in AdsServiceImpl to check
only the nullable history_service_ pointer.
No behavioral changes.
* 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
* [AI Chat] Add kText file type and ProcessTextFile mojom interface
Add kText to UploadedFileType enum and ProcessTextFile method to
AIChatUIHandler for upcoming text file upload support. Include iOS
no-op implementation.
* [AI Chat] Add TextFileExtractor for text file upload
Add TextFileExtractor subclass of FileTextExtractorBase that extracts
text via document.body.innerText after loading the file in a hidden
WebContents. The renderer handles MIME sniffing and encoding detection.
* [AI Chat] Add text file type detection and unfiltered file picker
Treat all non-image/non-PDF files as text (kText), letting the
renderer handle MIME sniffing — matching how Chromium's
Browser::OpenFile works. Remove extension-based file picker filtering.
* [AI Chat] Integrate TextFileExtractor into page handler
Add ProcessTextFile mojo endpoint implementation and text extraction
in the file picker upload flow. Text files from the file picker are
extracted via TextFileExtractor after PDF extraction completes.
* [AI Chat] Add text file content blocks for LLM engine
Handle kText uploaded files in BuildOAIMessages by sending extracted
text as TextContentBlock with "[File: filename]" prefix, following
the same pattern as PDF text extraction.
* [AI Chat] Add frontend support for text file uploads
Accept all files in drag-and-drop and paste. Handle non-image/non-PDF
files as text via processTextFile mojo call. Treat kText as document
type for upload limits. Display text files with file icon.
* [AI Chat] Add unit tests for text file type detection
Update AcceptedFileExtensions test for unfiltered file picker.
Add tests for text file handling: known extension (.txt),
extensionless files, and unknown extensions (.diff).
* [AI Chat] Show alert when files cannot be read as text
Show an error alert via Leo AlertCenter when uploaded files are
dropped because the renderer could not extract text from them
(e.g. binary files, unsupported formats).
* [AI Chat] Move ExtractText overloads to FileTextExtractorBase
Both PdfTextExtractor and TextFileExtractor had identical
ExtractText implementations. Move both the file-path and
file-bytes overloads to the base class. PdfTextExtractor
keeps a convenience overload that passes "pdf" as extension.
* [AI Chat] Unify PDF and text file extraction into a single flow
Use one barrier callback and one extractors_ vector instead of
separate pdf_extractors_/text_extractors_ and chained extraction
passes. This removes duplicated scanning, barrier setup, and
per-file callback logic.
* [Wallet] [Swap] Migrate Jupiter to gate3
* review(douglashdaniel): localize via text
* review(netzenbot): improve swap service unit tests
* review(bbondy): remove parsing of decimals since it is unused
* review(netzenbot): do not parse decimals
* review(netzenbot): return nullptr from ParseRouteStep if token fails to parse
* review(kdenhartog): extract sanitizeImageURL utility for chrome://image proxy
* Update comment regarding kJupiterLegacy
Replaces the JSON-backed TokenStateManager with a database-backed
implementation. On first run MigrateConfirmationState reads the
existing confirmations.json file, writes confirmation tokens,
confirmation queue items, and payment tokens into their respective
database tables, and deletes the file. Subsequent runs skip migration
because the file no longer exists. TokenStateManager::LoadState now
warms the in-memory token caches from the database on every startup
instead of parsing JSON. All mutation helpers write through to the
database directly. Removes JSON value utilities, unused in-memory
methods, and utility functions superseded by the migration.
Adds support to install a new component updater package "query-filter" to migrate from our current hardcoded to a more on-the-fly approach.
Corresponding CRX package tracked at https://github.com/brave/brave-core-crx-packager/pull/1176.
* Open Origin settings page on first purchase detection
- Add Delegate interface to BraveOriginService for browser-layer actions
- Watch skus::prefs::kSkusState changes to re-check purchase state
when credentials update (e.g. after purchasing on account.brave.com)
- On first purchase detection, open brave://settings/origin via the
delegate so the user can configure Origin policies
- Add BraveOriginNavigationDelegate (browser layer) implementing the
delegate using chrome::ShowSettingsSubPageForProfile
- Move navigation impl to its own source_set to avoid adding sources
directly to browser/ui/BUILD.gn
- Add unit tests for delegate, one-shot behavior, and pref-triggered
recheck
* Address review feedback on PR #35460
- Move Delegate from SetDelegate() setter to constructor parameter
per ARCH-025 (constructor injection over setter methods)
- Add //chrome/browser/ui dep in browser/ui/brave_origin/BUILD.gn
for chrome_pages.h include per BS-012
- Move //brave/components/brave_origin to public_deps in
browser/brave_origin/BUILD.gn since the header exposes it per BS-024
* Guard brave_origin UI dep on !is_android
chrome::ShowSettingsSubPageForProfile is only compiled for desktop
(chrome_pages.cc is in the !is_android sources block). Move the
//brave/browser/ui/brave_origin dep and its allow_circular_includes_from
entry behind !is_android to fix the Android linker error.
* Address remaining review feedback on PR #35460
- Move SkusServiceGetter into Delegate::GetSkusService() so the
component layer no longer depends on the browser-layer SKU factory
- Track first-purchase settings open with a boolean instead of
resetting the delegate; delegate is only dropped in Shutdown()
- Change BraveOriginNavigationDelegate to use raw_ref<Profile>
- Add TODO comment in config.gni for the circular dependency
- Add //brave/browser/skus dep to browser/ui/brave_origin BUILD.gn
* Fix Android linker error for ShowSettingsSubPageForProfile
chrome::ShowSettingsSubPageForProfile is not available on Android.
Guard the call and its include with #if !BUILDFLAG(IS_ANDROID),
matching the pattern used in ai_chat and other Brave features.
* Register kOriginFreeTierAccepted pref in settings handler unit tests on Linux
The three test fixtures in this file manually register prefs but were
missing kOriginFreeTierAccepted, which is registered in production code
via RegisterLocalStatePrefs and read during BraveOriginService
construction on Linux. This caused a CHECK failure on Linux:
"Trying to access an unregistered pref: brave.origin.free_tier_accepted"
* Fix linker errors for BraveOriginNavigationDelegate on Android/tests and iOS constructor mismatch
The brave_origin_navigation.cc implementation was only compiled for
desktop (!is_android) but the factory references it on all platforms.
Move the dep outside the platform guard so it links on Android too, and
add it to the unit_tests target. For iOS, create a BraveOriginDelegateIOS
that wraps the SKU service getter to match the new Delegate-based
constructor signature.