Commit 543ebe41 authored by Gauthier Ambard's avatar Gauthier Ambard Committed by Commit Bot

[iOS] Change URL blocking check

The URL blocking check should actually check if the URL might be blocked
instead of checking for the feature being enabled.

Bug: 1073932
Change-Id: Idd3cc76fa04e6db45fb2eab3e3ee9dc674705834
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/2230480
Commit-Queue: Mark Cogan <marq@chromium.org>
Reviewed-by: default avatarMark Cogan <marq@chromium.org>
Auto-Submit: Gauthier Ambard <gambard@chromium.org>
Cr-Commit-Position: refs/heads/master@{#775060}
parent 96ce7602
......@@ -346,8 +346,5 @@ web::UserAgentType ChromeWebClient::GetDefaultUserAgent(
}
bool ChromeWebClient::IsEmbedderBlockRestoreUrlEnabled() {
if (@available(iOS 13, *)) {
return base::FeatureList::IsEnabled(kEmbedderBlockRestoreUrl);
}
return false;
return ios::GetChromeBrowserProvider()->MightBlockUrlDuringRestore();
}
......@@ -118,6 +118,10 @@ class ChromeBrowserProvider {
virtual void AddSerializableData(
web::SerializableUserDataManager* user_data_manager,
web::WebState* web_state);
// Whether the embedder might block specific URL.
virtual bool MightBlockUrlDuringRestore();
// Allow embedders to block a specific URL.
virtual bool ShouldBlockUrlDuringRestore(const GURL& url,
web::WebState* web_state);
......
......@@ -76,6 +76,10 @@ void ChromeBrowserProvider::AddSerializableData(
web::SerializableUserDataManager* user_data_manager,
web::WebState* web_state) {}
bool ChromeBrowserProvider::MightBlockUrlDuringRestore() {
return false;
}
bool ChromeBrowserProvider::ShouldBlockUrlDuringRestore(
const GURL& url,
web::WebState* web_state) {
......
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