Removes the `NOTREACHED` in `-[CWVWebViewConfiguration preferences]` that is hit in some new `CWVWebView` code, the `NOTREACHED` was originally to avoid developer error in accessing it from Swift, but we can instead just mark it as unavailable with `NS_UNAVAILABLE` to avoid that possibility instead and allow the Obj-C side to just coalesce on null.
Chromium change:
commit 29b0e7808c42609ad6a816161d65acc6d2b46841
Author: Anuj Kumar <anujbh@google.com>
Date: Fri Apr 17 15:27:16 2026 -0700
[ios/web_view] Add triggerNonFatalCheck to CWVPreferences
Adds a new non-persistent, in-memory property 'triggerNonFatalCheck'
to CWVPreferences. When enabled, it triggers a non-fatal CHECK during
CWVWebView initialization to facilitate integration testing of
non-fatal checks by CWV clients.
Note: All code added in this CL is temporary for release integration
testing and will be reverted after testing in the stable channel
concludes.
The CHECK is implemented as:
CHECK(false, base::NotFatalUntil::M235); with a distant launch
milestone to ensure cleanup occurs before it becomes fatal.
Bug: 503005516
Change-Id: Ifea699ed37f2760bcc80cc49a71968075c2ad148
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/7751665
Reviewed-by: Justin Cohen <justincohen@google.com>
Commit-Queue: Anuj Kumar <anujbh@google.com>
Reviewed-by: John Wu <jzw@chromium.org>
Cr-Commit-Position: refs/heads/main@{#1616907}
Upstream's `webView:startURLSchemeTask:` now rejects any WebUI sub-resource
whose `SchemeHostPort` differs from the main `webView.URL` unless it is
served from `chrome://resources`. That breaks Brave's per-frame `WebUIIOS`
support (04db68e84d), where a trusted WebUI page deliberately embeds a
chrome-untrusted (or sibling-host) WebUI iframe (e.g. AI Chat).
Extend the existing chromium_src override to also admit any URL recognized
by a registered `WebUIIOSControllerFactory`. Non-WebUI URLs continue to
fall through to the upstream check, preserving its hardening intent.
Fixes the `WebUITest.LoadWebUIPageWithWebUIChildFrame` integration test.
Note: AI-assisted: requires thorough review
Chromium changes:
https://source.chromium.org/chromium/chromium/src/+/6b67808f449e4e6ebfd00182dcf09c7a37bb75b9
commit 6b67808f449e4e6ebfd00182dcf09c7a37bb75b9
Author: Mike Dougherty <michaeldo@chromium.org>
Date: Mon Apr 27 02:18:09 2026 -0700
Correctly pass WebUI headers to resource response
This CL forwards headers set on URLRequestChromeJob instances inside
URLDataManagerIOSBackend to the actual response. Previously these
headers were unintentionally discarded.
Although set_add_content_security_policy is being explicitly disabled in
this CL, it represents no change in behavior because the header was not
previously forwarded to the response.
Bug: 502503860
Change-Id: I85b33794a405bf132b094c47e890df0473c1b591
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/7764734
Auto-Submit: Mike Dougherty <michaeldo@chromium.org>
Commit-Queue: Gauthier Ambard <gambard@chromium.org>
Reviewed-by: Gauthier Ambard <gambard@chromium.org>
Cr-Commit-Position: refs/heads/main@{#1620954}
* [BraveSync] Migrate from os_crypt/sync to async
Starting from cr149 components/os_crypt/sync will be
removed completely in a favor of components/os_crypt/async.
Resolves https://github.com/brave/brave-browser/issues/55192
This updates the chromium_src overrides that enable the usage of `CWVAutofillController`, namely removing logic in the `WebView*` types that use `WebViewBrowserState` rather than a dependency injected into the client. This means creating a few new overrides for `IOSWebViewPaymentsAutofillClient` and supplying a different autofill client bridge/driver for the `CWVAutofillController` (via subclass)
This tab helper was converted to `WebStateUserData` in cr147 so it was no longer being created correctly. This change refactors the override to expose the tab helper properly so that it can be created it in `AttachTabHelpers`
Chromium change:
commit b689e19d72624727f68767ca806a1de7044f97a7
Author: Sylvain Defresne <sdefresne@chromium.org>
Date: Mon Feb 23 05:15:34 2026 -0800
[ios] Convert CaptivePortalTabHelper into a WebStateUserData<T>
With the optimisation to create TabHelper only for realized WebStates,
it is no longer necessary to use LazyWebStateUserData<T>. Convert the
class CaptivePortalTabHelper to use WebStateUserData<T> instead.
Bug: 409299519
Change-Id: Ib14babdf5bd6f1ea43b494f4ccce62e43084e3d8
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/7594552
Commit-Queue: Sylvain Defresne <sdefresne@chromium.org>
Auto-Submit: Sylvain Defresne <sdefresne@chromium.org>
Commit-Queue: Federica Germinario <fedegermi@google.com>
Reviewed-by: Federica Germinario <fedegermi@google.com>
Cr-Commit-Position: refs/heads/main@{#1588636}
This implements the required method in `BraveWebView` to access the embedded `CWVTranslationController`. The controller will only function correctly when `UseProfileWebViewConfiguration` is enabled since it requires the Chromium JavaScript features to be injected.
Chromium change:
https://chromium.googlesource.com/chromium/src.git/+/a5a6bc4b29a9a
commit a5a6bc4b29a9a1c2dd75775f30c0937424218c5c
Author: Sylvain Defresne <sdefresne@chromium.org>
Date: Mon Feb 23 09:14:05 2026 -0800
[ios] Remove unused and deprecated template LazyWebStateUserData<T>
This class is no longer useful since the WebStateUserData<T> are
only created when the WebState becomes realized.
Bug: 409299519
This adds a new override on `web::NavigationManager` to expose the private field in `NavigatonManagerImpl`: `native_restore_in_progress_`. This field can be used the same way `TabState.isRestoring` was used on the Swift side which is a requirement for moving certain logic done in the Swift side into WebState tab helpers.
Chromium changes:
https://chromium.googlesource.com/chromium/src/+/97b35f324629e1c84577db7a7c625213ecb24bf7
commit 97b35f324629e1c84577db7a7c625213ecb24bf7
Author: Tomek Jurkiewicz <tju@google.com>
Date: Tue Jan 20 05:14:00 2026 -0800
Rename Supervised User settings service and data type to family link.
This renaming aims at better reflecting service's function in the wake
of multiple user supervision systems: this service exclusively handles
supervision settings related to family link users.
"Supervised user" relates to any parental controls type, and "Family
Link" is a specific one.
Minor: declare supervised_user namespace for the service and its
factory.
BYPASS_LARGE_CHANGE_WARNING=Gerrit is not picking up renaming
Bug: 475731719
Bypass-Check-License: Renaming
Change-Id: Icc59347f6e1a515db6fb1d53d2f7b60adba32089
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/7493784
Reviewed-by: Mark Cogan <marq@chromium.org>
Reviewed-by: Rushan Suleymanov <rushans@google.com>
Commit-Queue: Tomek Jurkiewicz <tju@google.com>
Cr-Commit-Position: refs/heads/main@{#1571571}
This adds a temporary WebClient method–exposed through `BraveWebView`–that will allow Brave to perform additional changes to the underlying `WKWebViewConfiguration ` when said configuration is reset in `WKWebViewConfigurationProvider`. This is a requirement for being able to add the `internal` scheme handler and adjust a few WebKit preferences still controlled by Brave when the `UseProfileWebViewConfiguration` feature flag is enabled.
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
This adds patches & overrides in order to install Brave's policy provider at an app and profile level.
These changes attempt to match desktop/android's existing overrides, specifically:
- `patches/chrome-browser-policy-profile_policy_connector.cc.patch`
- `chromium_src/chrome/browser/policy/chrome_browser_policy_connector.h`
- `chromium_src/chrome/browser/policy/chrome_browser_policy_connector.cc``
- `chromium_src/chrome/browser/policy/profile_policy_connector.cc`
- `chromium_src/chrome/browser/policy/profile_policy_connector.h`
- `chromium_src/chrome/browser/policy/profile_policy_connector_builder.cc`
The values have been moved to the header, and made `constexpr`,
therefore the value in our own shadow file should also be moved to the
header.
Chromium changes:
https://chromium.googlesource.com/chromium/src/+/1683e4329a3d271cd98620fe85d1bf38b67c75dc
commit 1683e4329a3d271cd98620fe85d1bf38b67c75dc
Author: Sylvain Defresne <sdefresne@chromium.org>
Date: Fri Oct 17 02:30:17 2025 -0700
[ios] Modernize definition of //ios/components/webui constants
Declare the constants as `inline constexpr char kConstant[] = "...";`
in the header (this allow initializing other constexpr constants from
them).
Bug: none
Change-Id: Iae79669bf5d16042c9cdc66247cd88ee878b7521
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/7046203
Commit-Queue: Sylvain Defresne <sdefresne@chromium.org>
Reviewed-by: Mike Dougherty <michaeldo@chromium.org>
Cr-Commit-Position: refs/heads/main@{#1531309}
This migration has been effected in upstream, but several places in our
codebase got broken by this transition. This change makes several parts
of our codebase more friendly to passing `string_view`.
Chromium changes:
https://chromium.googlesource.com/chromium/src/+/0e1784e3cf990560b173f40338e582f50aba0e85
commit 0e1784e3cf990560b173f40338e582f50aba0e85
Author: Charlie Harrison <csharrison@chromium.org>
Date: Fri Oct 3 11:04:26 2025 -0700
RELAND: Migrate GURL::path() and friends to return string_view
This relands crrev.com/c/7003625. Missing cases were found by staring
at the output of `git grep` for the whole codebase.
Origin description:
Also migrates some last remaining callers of the std::string APIs.
This completes phase 1 of crbug.com/448174617.
Bug: 448174617
Change-Id: I7f24f81d1fbf129d8b0dd94f4cf948626deab933
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/7007010
Reviewed-by: Daniel Cheng <dcheng@chromium.org>
Commit-Queue: Charlie Harrison <csharrison@chromium.org>
Cr-Commit-Position: refs/heads/main@{#1524878}
This change introduces a chromium_src override to expose the internal `web::DownloadTask` so that we can expose some values that are not currently wrapped in the `CWVDownloadTask` type.
This commit can be reverted when the change is upstreamed and pulled down in future Chromium bumps
This is a simple function signature correction.
Chromium changes:
https://chromium.googlesource.com/chromium/src/+/51e89f623c0c6ef196225a84fd3fad42ae6f54b4
commit 51e89f623c0c6ef196225a84fd3fad42ae6f54b4
Author: Sylvain Defresne <sdefresne@chromium.org>
Date: Fri Sep 5 11:37:22 2025 -0700
[ios] Convert factories to BuildServiceInstanceFor(ProfileIOS*)
{Refcounted,}ProfileKeyedServiceFactoryIOS exposes a method
BuildServiceInstanceFor(ProfileIOS*) so convert factories
to override this method instead of the deprecated method
BuildServiceInstanceFor(web::BrowserState*).
This convert factories in //ios/chrome/browser/metrics/model.
Bug: 436484783
Change-Id: I62cdee5338106ed3c824fb61bdf546ca4cf51c02
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/6912798
Reviewed-by: Olivier Robin <olivierrobin@chromium.org>
Commit-Queue: Sylvain Defresne <sdefresne@chromium.org>
Cr-Commit-Position: refs/heads/main@{#1511760}
This change ensures that the menu builder is called even when there is no active text selected by the user so that we can display `Force Paste` next to the standard `Paste` when the user is simply attempting to paste into an empty field.
* Override for Chromium's Content Rule List
Chromium's content rule list will block all external links so that webui cannot open. We need override it to unlock external links so that our webui can open external links.
* formatting
* update new lines
This change in the argument list is of no consequence.
commit 4872f010a3dea54020cfab52049604d8f4780afb
Author: Sylvain Defresne <sdefresne@chromium.org>
Date: Wed Aug 27 09:06:36 2025 -0700
[ios] Improve AutofillClientIOS::FromWebState(...)
Instead of storing a set of function pointer, and calling the in order,
use an helper class to attach an instance of AutofillClientIOS to the
WebState.
This is an intermediate step on the way to convert AutofillClientIOS in
a tab helper (which will fix the WebViewAutofillClientIOS lifetime).
This first step fixes a crash where some test where registering function
that would crash if no AutofillClientIOS was created (in fact any test
that would create an AutofillTabHelper may cause later tests to crash
if they tried to access to the AutofillClientIOS, this would depend on
the ordering of the function pointers registered in the set).
Bug: 441444002
Change-Id: I59c4ef2e44eee1c61c1b7f4fc7881309064bb968
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/6890091
Reviewed-by: Olivier Robin <olivierrobin@chromium.org>
Auto-Submit: Sylvain Defresne <sdefresne@chromium.org>
Commit-Queue: Olivier Robin <olivierrobin@chromium.org>
Cr-Commit-Position: refs/heads/main@{#1507117}
This was potentially included to preemtp substitutions.
commit 49070328441e905c8cab66f2a3b7ba724ad5dd2e
Author: Sylvain Defresne <sdefresne@chromium.org>
Date: Mon Aug 25 09:25:04 2025 -0700
[ios] Implement PrerenderBrowserAgent without using PrerenderService
Implement PrerenderBrowserAgent directly without delegating to the
PrerenderService and remove the now obsolete PrerenderService class.
Bug: 40726702
Change-Id: Ie82def0522c0c35cccbed174c312b1a2e8d8a16b
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/6850951
Auto-Submit: Sylvain Defresne <sdefresne@chromium.org>
Commit-Queue: Mark Cogan <marq@chromium.org>
Reviewed-by: Mark Cogan <marq@ch
This change replaces WebState's `*WebUI` related methods with ones that allow storing a set of WebUI's such that WebUI's can create child frames that also load WebUI which can be necessary for untrusted frames.
This ensures that if a frame can't be found with the given id it falls back to the main frame so that mojo can handle the callback correctly even if it will error later.
This change adds the frame ID for the facade handling mojo communications calls so that it may execute responses on the correct frame. This is a requirement for WebUI that may have child frames that also use mojo binding.
This adds a new factory to the dependencies list created in Chrome's `EnsureProfileKeyedServiceFactoriesBuilt`.
`IOSChromeAimEligibilityService::IsAimLocallyEligible` returns false so no Aim features are enabled
Chromium changes:
https://chromium.googlesource.com/chromium/src/+/d7b2a0942e5a6955f27950d2201d4965901cf837
commit d7b2a0942e5a6955f27950d2201d4965901cf837
Author: Sylvain Defresne <sdefresne@chromium.org>
Date: Wed Jul 16 05:32:22 2025 -0700
[ios] Improve creation/destruction of IOSChromeSyncedTabDelegate
Move creation of the IOSChromeSyncedTabDelegate from AttachTabHelpers
to SyncedWindowDelegateBrowserAgent when the WebState is inserted in
the WebStateList, and destroy it when it is removed.
This allow changing the SessionID corresponding to the window into a
constant (it is known when the object is created) and ensure that it
is always valid for the lifetime of the object.
Bug: 409299519
Change-Id: Ibcced453c1b3b5ef335a64de7214a5144c0125ca
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/6734760
Reviewed-by: Mark Cogan <marq@chromium.org>
Commit-Queue: Mark Cogan <marq@chromium.org>
Auto-Submit: Sylvain Defresne <sdefresne@chromium.org>
Cr-Commit-Position: refs/heads/main@{#1487553}
`IOSChromeSessionTabHelper` is now removed upstream, so use
`IOSChromeSyncedTabDelegate` to set the window id now.
Chromium changes:
https://chromium.googlesource.com/chromium/src/+/740997ee78781dbfe8830047554de4497c4ebc2d
commit 740997ee78781dbfe8830047554de4497c4ebc2d
Author: Sylvain Defresne <sdefresne@chromium.org>
Date: Wed Jul 9 05:06:12 2025 -0700
[ios] Remove IOSChromeSessionTabHelper class
This tab helper was only used to store the tab's window identifier
which was used by IOSChromeSyncedTabDelegate and HistoryTabHelper.
Instead store the value in IOSChromeSyncedTabDelegate and change
HistoryTabHelper to access it from that object instead.
Fixed: 430235574
Change-Id: I403eab9246cac88702800e8c6fbf13177fb2bc2f
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/6714348
Commit-Queue: Sylvain Defresne <sdefresne@chromium.org>
Reviewed-by: Mark Cogan <marq@chromium.org>
Cr-Commit-Position: refs/heads/main@{#1484262}
* Expose Brave Shields Utils to iOS
- Create new `BraveShieldsSettings` class to expose Brave Shield utility apis for per-domain Shield settings and global/default settings.
- Add obj-c wrapper for `BraveShieldsSettings` to expose to iOS, structured within the component.
- Move some of the duplicated function logic from `BraveShieldsTabHelper` to
`BraveShieldsSettings` so more logic can be shared and prevent issues with,
for example, `SetAdBlockMode` calling 2 separate `brave_shields` utility funcs.
- Move shared Shields mojom enums to `shields_settings.mojom`.
- Move logic using shared mojom enums to `BraveShieldsSettings`.
- Expose FingerprintMode to iOS to align with other platforms, but use DCHECK
to validate it's not used on iOS.
- Add default getter / setter helpers to `BraveShieldsSettings`.
- Remove unregister/register of javascript content setting.
- Use a patch to add iOS platform to javascript content setting.
- In case FingerprintMode setting is sync'd later, map `STRICT_MODE` to `STANDARD_MODE` on iOS.
* [iOS] Add ability to enable Brave admin policies on iOS
This change also adds the an example of handling the BraveWalletDisabled policy
* fixed code checks
* update property name; bump to cr139 min; other review feedback
* remove patch, update override
* remove unused DEPS file
* update wallet policy unit test since ios now runs component unit tests
* re-add android buildflag check to brave_wallet IsDisabledByPolicy
This change updates how brave/chromium_src overrides can reference original files: it adds ability to use #include <...> along with #include "src/...". This is enabled by replacing -I../../brave/chromium_src with -iquote../../brave_chromium_src, which adds an include search path only for #include "..." directives.
With this approach, other files in the build tree can reference brave/chromium_src overrides using #include "...", while the overrides themselves can reference original Chromium files using #include <...>. Since Chromium uses #include "..." for all in-tree files, we can leverage this convention and configure our overrides so that we can drop support for #include "src/" later by removing -I../../.. and making rbe_exec_root modification obsolete (the main goal).