Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(801)

Unified Diff: chrome/browser/subresource_filter/chrome_subresource_filter_client.cc

Issue 2890253002: [subresource_filter] Move OnReloadRequested to the ChromeClient (Closed)
Patch Set: rebase on #473448 Created 3 years, 7 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
Index: chrome/browser/subresource_filter/chrome_subresource_filter_client.cc
diff --git a/chrome/browser/subresource_filter/chrome_subresource_filter_client.cc b/chrome/browser/subresource_filter/chrome_subresource_filter_client.cc
index cbb4b0b337751ee8f93a33d54d2af3fa4000528d..475714d977437ea6d2154a0987eb38f10062de2a 100644
--- a/chrome/browser/subresource_filter/chrome_subresource_filter_client.cc
+++ b/chrome/browser/subresource_filter/chrome_subresource_filter_client.cc
@@ -85,6 +85,22 @@ void ChromeSubresourceFilterClient::MaybeAppendNavigationThrottles(
navigation_handle, throttles);
}
+void ChromeSubresourceFilterClient::OnReloadRequested() {
+ UMA_HISTOGRAM_BOOLEAN("SubresourceFilter.Prompt.NumReloads", true);
+ const GURL& whitelist_url = web_contents_->GetLastCommittedURL();
+
+ // Only whitelist via content settings when using the experimental UI,
+ // otherwise could get into a situation where content settings cannot be
+ // adjusted.
+ if (base::FeatureList::IsEnabled(
+ subresource_filter::kSafeBrowsingSubresourceFilterExperimentalUI)) {
+ WhitelistByContentSettings(whitelist_url);
+ } else {
+ WhitelistInCurrentWebContents(whitelist_url);
+ }
+ web_contents_->GetController().Reload(content::ReloadType::NORMAL, true);
+}
+
void ChromeSubresourceFilterClient::ToggleNotificationVisibility(
bool visibility) {
if (did_show_ui_for_navigation_ && visibility)

Powered by Google App Engine
This is Rietveld 408576698