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

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

Issue 2772393002: [subresource_filter] Add domains to content settings whitelist (Closed)
Patch Set: fix join string rebase Created 3 years, 9 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 4a8afd516ad84d99b7018ee4c4dc8120ca6183ee..be0df93b39eadbe8498fccd26223e02bb0d76d54 100644
--- a/chrome/browser/subresource_filter/chrome_subresource_filter_client.cc
+++ b/chrome/browser/subresource_filter/chrome_subresource_filter_client.cc
@@ -4,6 +4,8 @@
#include "chrome/browser/subresource_filter/chrome_subresource_filter_client.h"
+#include <string>
+
#include "base/metrics/histogram_macros.h"
#include "chrome/browser/content_settings/host_content_settings_map_factory.h"
#include "chrome/browser/content_settings/tab_specific_content_settings.h"
@@ -53,3 +55,15 @@ bool ChromeSubresourceFilterClient::IsWhitelistedByContentSettings(
std::string());
return setting == CONTENT_SETTING_BLOCK;
}
+
+void ChromeSubresourceFilterClient::WhitelistByContentSettings(
+ const GURL& url) {
+ Profile* profile =
+ Profile::FromBrowserContext(web_contents_->GetBrowserContext());
+ DCHECK(profile);
+ HostContentSettingsMap* settings_map =
+ HostContentSettingsMapFactory::GetForProfile(profile);
+ settings_map->SetContentSettingDefaultScope(
+ url, url, ContentSettingsType::CONTENT_SETTINGS_TYPE_SUBRESOURCE_FILTER,
+ std::string(), CONTENT_SETTING_BLOCK);
+}

Powered by Google App Engine
This is Rietveld 408576698