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

Unified Diff: chrome/browser/content_settings/host_content_settings_map.cc

Issue 475193002: Add a single site view page to view and modify content settings. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Rebase. Created 6 years, 4 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/content_settings/host_content_settings_map.cc
diff --git a/chrome/browser/content_settings/host_content_settings_map.cc b/chrome/browser/content_settings/host_content_settings_map.cc
index e9ebe313388bf08b5c06eaca1b1399ec11e4e8fe..f65ccbd2e43f59e6c3439867e8e4093d5e4e20c9 100644
--- a/chrome/browser/content_settings/host_content_settings_map.cc
+++ b/chrome/browser/content_settings/host_content_settings_map.cc
@@ -293,6 +293,34 @@ void HostContentSettingsMap::SetWebsiteSetting(
NOTREACHED();
}
+void HostContentSettingsMap::SetNarrowestWebsiteSetting(
+ const ContentSettingsPattern& primary_pattern,
+ const ContentSettingsPattern& secondary_pattern,
+ ContentSettingsType content_type,
+ const std::string& resource_identifier,
+ ContentSetting setting,
+ content_settings::SettingInfo existing_info) {
+ ContentSettingsPattern narrow_primary = primary_pattern;
+ ContentSettingsPattern narrow_secondary = secondary_pattern;
+
+ DCHECK_EQ(content_settings::SETTING_SOURCE_USER, existing_info.source);
+ ContentSettingsPattern::Relation r1 =
+ existing_info.primary_pattern.Compare(primary_pattern);
+ if (r1 == ContentSettingsPattern::PREDECESSOR) {
+ narrow_primary = existing_info.primary_pattern;
+ } else if (r1 == ContentSettingsPattern::IDENTITY) {
+ ContentSettingsPattern::Relation r2 =
+ existing_info.secondary_pattern.Compare(secondary_pattern);
+ DCHECK(r2 != ContentSettingsPattern::DISJOINT_ORDER_POST &&
+ r2 != ContentSettingsPattern::DISJOINT_ORDER_PRE);
+ if (r2 == ContentSettingsPattern::PREDECESSOR)
+ narrow_secondary = existing_info.secondary_pattern;
+ }
+
+ SetContentSetting(
+ narrow_primary, narrow_secondary, content_type, std::string(), setting);
+}
+
void HostContentSettingsMap::SetContentSetting(
const ContentSettingsPattern& primary_pattern,
const ContentSettingsPattern& secondary_pattern,
« no previous file with comments | « chrome/browser/content_settings/host_content_settings_map.h ('k') | chrome/browser/resources/options/options.html » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698