Commit ce75f1a2 authored by Ali Juma's avatar Ali Juma Committed by Commit Bot

[iOS] Add a feature flag for Safe Browsing

This adds a feature flag for Safe Browsing, and disables WKWebView's version
of Safe Browsing when this flag is enabled.

Bug: 1028755, 1050174
Change-Id: I213a3fb1aeaeaa4b497e7ba56be2c61046a5b688
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/2065550Reviewed-by: default avatarKurt Horimoto <kkhorimoto@chromium.org>
Commit-Queue: Ali Juma <ajuma@chromium.org>
Cr-Commit-Position: refs/heads/master@{#743085}
parent 5251bd61
......@@ -55,6 +55,11 @@ extern const base::Feature kUseDefaultUserAgentInWebClient;
// of properties using hard coded logic.
extern const base::Feature kPreserveScrollViewProperties;
// Feature flag for making native (instead of WKWebView-provided) Safe
// Browsing available. When this flag is enabled, Safe Browsing is still
// subject to an opt-out controlled by prefs::kSafeBrowsingEnabled.
extern const base::Feature kSafeBrowsingAvailable;
// Use WKWebView.loading to update WebState::IsLoading.
// TODO(crbug.com/1006012): Clean up this flag after experiment.
bool UseWKWebViewLoading();
......
......@@ -47,6 +47,9 @@ const base::Feature kUseDefaultUserAgentInWebClient{
const base::Feature kPreserveScrollViewProperties{
"PreserveScrollViewProperties", base::FEATURE_DISABLED_BY_DEFAULT};
const base::Feature kSafeBrowsingAvailable{"SafeBrowsingAvailable",
base::FEATURE_DISABLED_BY_DEFAULT};
bool UseWKWebViewLoading() {
return base::FeatureList::IsEnabled(web::features::kUseWKWebViewLoading);
}
......
......@@ -130,6 +130,14 @@ void WKWebViewConfigurationProvider::ResetWithWebViewConfiguration(
} @catch (NSException* exception) {
NOTREACHED() << "Error setting value for longPressActionsEnabled";
}
// WKWebView's "fradulentWebsiteWarning" is an iOS 13+ feature that is
// conceptually similar to Safe Browsing but uses a non-Google provider and
// only works for devices in certain locales. Disable this feature when
// Safe Browsing is available.
if (base::FeatureList::IsEnabled(web::features::kSafeBrowsingAvailable)) {
[[configuration_ preferences] setFraudulentWebsiteWarningEnabled:NO];
}
}
[configuration_ setAllowsInlineMediaPlayback:YES];
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment