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

Unified Diff: components/content_settings/core/browser/host_content_settings_map.cc

Issue 1741123002: Add removal filter support for Cookies, Storage, and Content Settings. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 4 years, 10 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: components/content_settings/core/browser/host_content_settings_map.cc
diff --git a/components/content_settings/core/browser/host_content_settings_map.cc b/components/content_settings/core/browser/host_content_settings_map.cc
index 303ec9855df7551c4c7d78eabbf5190e8278c968..f3e73cb655d126a38a52da65dfbc585cc0c8198d 100644
--- a/components/content_settings/core/browser/host_content_settings_map.cc
+++ b/components/content_settings/core/browser/host_content_settings_map.cc
@@ -525,6 +525,24 @@ void HostContentSettingsMap::ClearSettingsForOneType(
FlushLossyWebsiteSettings();
}
+void HostContentSettingsMap::ClearSettingsForOneTypeWithPredicate(
+ ContentSettingsType content_type,
+ const base::Callback<
+ bool(const ContentSettingsPattern& primary_pattern,
+ const ContentSettingsPattern& secondary_pattern)> predicate) {
+ UsedContentSettingsProviders();
+ ContentSettingsForOneType settings;
+ GetSettingsForOneType(content_type, std::string(), &settings);
+ for (const ContentSettingPatternSource& setting : settings) {
+ if (predicate.Run(setting.primary_pattern, setting.secondary_pattern)) {
+ SetWebsiteSettingCustomScope(setting.primary_pattern,
+ setting.secondary_pattern, content_type,
+ std::string(), nullptr);
+ }
+ }
+ FlushLossyWebsiteSettings();
+}
+
// TODO(raymes): Remove this function. Consider making it a property of
// ContentSettingsInfo or removing it altogether (it's unclear whether we should
// be restricting allowed default values at this layer).

Powered by Google App Engine
This is Rietveld 408576698