Commit Graph
3276 Commits
Author SHA1 Message Date
Emerick Rogul 7500c3cf00 [cr148][ios] Add Cobalt to brave_providers
Chromium changes:
https://chromium.googlesource.com/chromium/src/+/d496e5519d6508de272a548da0d2ce586461dd1c

commit d496e5519d6508de272a548da0d2ce586461dd1c
Author: Quentin Pubert <qpubert@google.com>
Date:   Tue Mar 17 13:29:39 2026 -0700

    [iOS] Add Cobalt overflow menu destination

    This CL adds an overflow menu destination for the Cobalt feature. It is
    only visible if `web::features::IsCobaltEnabled()` and the browser is
    not managed.

    NO_IFTTT=Files have been moved thus invalidating IFTTT guards

    Bug: 475807780
    Change-Id: I20ed089aca62c181c58666b4eaf249317c405f1a
    Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/7670757
    Reviewed-by: Gauthier Ambard <gambard@chromium.org>
    Reviewed-by: Olivier Robin <olivierrobin@chromium.org>
    Auto-Submit: Quentin Pubert <qpubert@google.com>
    Commit-Queue: Quentin Pubert <qpubert@google.com>
    Cr-Commit-Position: refs/heads/main@{#1600776}
2026-04-27 12:00:49 +01:00
Emerick Rogul b204a0a22b [cr148][ios] Use spanified version of WriteAtCurrentPos
Chromium changes:
https://chromium.googlesource.com/chromium/src/+/42d167bff187e08502aeab99bc9ec8fe81e0d233

commit 42d167bff187e08502aeab99bc9ec8fe81e0d233
Author: Andrew Paseltiner <apaseltiner@chromium.org>
Date:   Wed Mar 11 05:24:26 2026 -0700

    Make non-spanified base::File::WriteAtCurrentPos overload private

    Bug: 435317390
    Change-Id: Iab79430a615d36c1a528a3cd4f96bca1cd38bec3
    Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/7653098
    Reviewed-by: Daniel Cheng <dcheng@chromium.org>
    Reviewed-by: Petr Cermak <petrcermak@chromium.org>
    Commit-Queue: Andrew Paseltiner <apaseltiner@chromium.org>
    Cr-Commit-Position: refs/heads/main@{#1597668}
2026-04-27 12:00:45 +01:00
Emerick Rogul b2920f72ad [cr148][ios] TargetDeviceInfo no longer includes full_name and short_name fields
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}
2026-04-27 12:00:44 +01:00
Kyle Hickinson df01d3e55f [iOS] [AI Chat] Replace Skia with UIKit for image decoding & scaling (#35878)
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.
2026-04-26 09:41:16 -04:00
Kyle Hickinson 55141b78df [iOS] Dont update url when safe browsing interstitials are visible (#35889)
This created further issues with Chromium web views and never updated the security icon either
2026-04-24 15:59:09 -04:00
Kyle Hickinson faa9db41a8 [iOS] [AI Chat] Downscale large images selected from photo picker/camera (#35880)
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.
2026-04-24 15:08:17 -04:00
Nuo Xu e2c9911067 [iOS] QuickView Toolbar UI Follow Up (#35788)
Quickview toolbar UI follow up

1. progress bar for loading state
2. forward button
3. update open in tab icon
2026-04-24 14:44:32 -04:00
Terry Mancey c8ad84b117 [ads][CodeHealth] Add single-notification guard and clean up naming (#35872)
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.
2026-04-24 16:15:23 +01:00
Nuo Xu 533ce11a7e [iOS] QuickView Toolbar UI Layout in SwiftUI (#35405) 2026-04-24 10:12:10 -04:00
Terry Mancey 170d7b5f8b [ads] Add AdsService lifecycle state and AdsServiceWaiter test support (#35845)
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.
2026-04-24 00:31:37 +01:00
Kyle Hickinson ebf278fdc3 [iOS] Re-add legacy NTP internal scheme handler (#35844)
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
2026-04-23 18:33:06 -04:00
Aleksei Seren 1591448a01 Add SerpMetrics ObjC bridge (#35542)
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.
2026-04-23 16:10:13 -05:00
Kyle Hickinson 617b17cc2a [iOS] [AI Chat] Use Skia to process images pasted into the input field (#35826)
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
2026-04-23 20:55:14 +00:00
Kyle Hickinson 8e463b3d5e [iOS] Add Youtube video quality JavaScriptFeature (#35738)
This adds a JavaScriptFeature that enables the auto highest quality video feature on YouTube videos when using the `UseProfileWebViewConfiguration` feature flag
2026-04-23 15:24:40 +00:00
Szilard Szaloki 87659c5394 Account: migrate BraveAccountService to async OSCrypt (#35795) 2026-04-22 17:05:32 -06:00
Kyle Hickinson b63114511d [iOS] Migrate youtube quality preference to Chromium (#35736)
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.
2026-04-22 16:52:36 -04:00
Aleksei Seren 826ec7684b [CodeHealth] Clean up SerpMetrics time period storage API (#35755)
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.
2026-04-22 21:34:30 +01:00
Kyle Hickinson 779110a2b6 [iOS] Add safe builtins JavaScript feature (#35629)
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)
2026-04-22 10:41:47 -04:00
r0hit0303 5547ce3413 Add logic to load and parse query filter rule file (#35586)
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.
2026-04-22 09:04:47 +02:00
Kyle Hickinson 81a466d5d6 [iOS] Enable smooth scrolling in BraveWebClient (#35740)
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}
2026-04-21 19:49:57 -04:00
Aleksei Seren f778f3623b Make SerpMetrics specific copy of TimePeriodStorage (#35697)
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.
2026-04-21 10:10:09 -05:00
Kyle Hickinson a19526809f [iOS] Update Brave Origin product copy (#35685) 2026-04-20 16:48:42 -04:00
Nuo Xu 7438f2fb47 [iOS][P3A] Add Brave.Search.QuickMostUsedAction P3A answer in iOS (#35605) 2026-04-20 16:37:42 -04:00
Kyle Hickinson cebb58cd22 [iOS] Remove basic auth failure count from TabDelegate (#35681)
This argument was never used with Chromium web views and now can be fully removed
2026-04-20 14:24:29 -04:00
Kyle Hickinson 09d2051d9e [iOS] Update doc in BraveStoreSDK.updateSkusPurchaseState (#35682)
This doc was out of date when we added Origin to this
2026-04-20 16:52:23 +00:00
Kyle Hickinson 97888c0118 [iOS] Only restore Origin when using restoring in Origin paywall (#35470)
This avoids attempts to restore other Leo & VPN services when tapping the restore button on the Origin paywall
2026-04-20 12:37:36 -04:00
Kyle Hickinson 72ced66216 [iOS] Always show basic auth prompt even with a preexisting credential (#35677)
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.
2026-04-20 12:25:15 -04:00
Terry Mancey 8399272cbd [ads][CodeHealth] Remove redundant callback type aliases (#35646)
[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.
2026-04-20 14:41:19 +00:00
Kyle Hickinson 85dd9fc324 [iOS] Dismiss and show Origin settings after successful purchase (#35644) 2026-04-20 10:19:56 -04:00
Terry Mancey 1db81bf72c [ads][CodeHealth] Use correct mojom header variants in headers (#35643)
* [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.
2026-04-19 20:35:46 +01:00
Nuo Xu 8c6ac7a41d [iOS][l10n] Add translation for 1.89.x (downlift to 1.91.x) (#35635)
add translation for 1.89.x
2026-04-17 17:24:58 -04:00
Anthony Tseng 9df0bef8ab Reland "[AI Chat] Support text file uploads with renderer-based extraction"" (#35613)
Revert "Revert "[AI Chat] Support text file uploads with renderer-based extra…"

This reverts commit c0e4f7effd.
2026-04-17 12:06:01 -07:00
Nuo Xu cfd978ae4f [iOS] Remove unused transifex scripts (#35630)
remove transifex scripts
2026-04-17 13:56:21 -04:00
Terry Mancey faf0439eb1 [ads][CodeHealth] Use raw_ref for prefs_ and local_state_ members (#35611)
[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.
2026-04-17 17:06:12 +01:00
Anirudha Bose 38bcd00cd9 [Wallet] [Swap] Migrate LiFi to gate3 (#35585)
* [Wallet] [Swap] Migrate LiFi to gate3

* Remove TODO comment
2026-04-16 21:12:29 +01:00
Anthony Tseng c0e4f7effd Revert "[AI Chat] Support text file uploads with renderer-based extraction" (#35582)
Revert "[AI Chat] Support text file uploads with renderer-based extraction (#…"

This reverts commit 0a0068baf7.
2026-04-16 17:53:48 +01:00
Kyle Hickinson 144a23d129 [iOS] Force left-to-right URL rendering in collapsed URL bar state (#35564) 2026-04-16 15:16:08 +00:00
StephenHeaps 009f227b0b [iOS] Prefer security origin over window origin for iOS script messages (#35161)
* Use WKWebView frame security origin for tracking protection stats, request blocking, and cosmetic filtering on iOS.
2026-04-16 10:39:29 -04: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
Szilard Szaloki d615f4b477 Account: moves to OTP-based email verification (#35502) 2026-04-16 05:42:25 +01:00
Anthony Tseng 0a0068baf7 [AI Chat] Support text file uploads with renderer-based extraction (#35305)
* [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.
2026-04-15 21:11:01 +01:00
Anirudha Bose cdac42ed79 [Wallet] [Swap] Migrate Jupiter to gate3 (#34056)
* [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
2026-04-15 22:49:18 +05:30
Terry Mancey 1cac9ae1c0 [ads] Migrate JSON confirmation state to database (#35342)
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.
2026-04-15 17:15:14 +00:00
Anton Paymyshev eebe1d9885 Remove KeyedService from some wallet services (#35527) 2026-04-15 18:09:18 +01:00
r0hit0303 5341fea4de Add a new query-filter component installer (#35408)
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.
2026-04-15 14:50:38 +01:00
Kevin Smith beee7d891d [Rewards] Remove Gemini wallet provider (#35380) 2026-04-14 22:11:29 -04:00
Nuo Xu adbc04e1f5 [iOS][Wallet] Fix .zec/.btc/.ada tx doesn't show to address in pending tx screen (#35494)
fix .zec/.btc/.ada tx doesn't show to address
2026-04-14 20:59:34 -04:00
Brian R. Bondy 754872677b Open origin settings on first purchase (#35460)
* 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.
2026-04-14 18:09:51 -04:00
Kyle Hickinson c827c80ad4 [iOS] Add Origin entry to chrome://flags (#35488) 2026-04-14 18:14:12 +00:00
Kyle Hickinson 614c95c1df [iOS] Increase sync device limit to 50 to match backend (#35457)
The current client-side limit of 10 was out of date
2026-04-13 12:38:14 -04:00