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

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

Issue 8539004: Replace SetContentSetting method of the content_settings::Provider interface with GetWebsiteSetting (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: " Created 9 years, 1 month 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.h
diff --git a/chrome/browser/content_settings/host_content_settings_map.h b/chrome/browser/content_settings/host_content_settings_map.h
index 7c91008cf11ebb264e527656b993b48d4fc25fc7..2a754def709a13e37abba542bbd752e241119a19 100644
--- a/chrome/browser/content_settings/host_content_settings_map.h
+++ b/chrome/browser/content_settings/host_content_settings_map.h
@@ -122,11 +122,13 @@ class HostContentSettingsMap
void SetDefaultContentSetting(ContentSettingsType content_type,
ContentSetting setting);
- // Sets the content setting for the given patterns and content type.
- // Setting the value to CONTENT_SETTING_DEFAULT causes the default setting
- // for that type to be used when loading pages matching this pattern. For
- // ContentSettingsTypes that require an resource identifier to be specified,
- // the |resource_identifier| must be non-empty.
+ // Sets the content |setting| for the given patterns, |content_type| and
+ // |resource_identifier|. Setting the value to CONTENT_SETTING_DEFAULT causes
+ // the default setting for that type to be used when loading pages matching
+ // this pattern.
+ // NOTICE: This is just a convenience method for content types that use
+ // |CONTENT_SETTING| as their data type. For content types that user other
Bernhard Bauer 2011/11/15 15:40:28 Nit: "[...] that use other [...]"
markusheintz_ 2011/11/15 17:36:58 Done.
+ // data types please use the method SetWebsiteSetting.
//
// This should only be called on the UI thread.
void SetContentSetting(const ContentSettingsPattern& primary_pattern,
@@ -135,6 +137,17 @@ class HostContentSettingsMap
const std::string& resource_identifier,
ContentSetting setting);
+ // Sets the |value| for the given patterns, |content_type| and
+ // |resource_identifier|. Setting the value to NULL causes the default value
+ // for that type to be used when loading pages matching this pattern.
+ //
+ // Takes ownership of the passed value.
+ void SetWebsiteSetting(const ContentSettingsPattern& primary_pattern,
+ const ContentSettingsPattern& secondary_pattern,
+ ContentSettingsType content_type,
+ const std::string& resource_identifier,
+ base::Value* value);
+
// Convenience method to add a content setting for the given URLs, making sure
// that there is no setting overriding it. For ContentSettingsTypes that
// require an resource identifier to be specified, the |resource_identifier|
@@ -152,6 +165,8 @@ class HostContentSettingsMap
// This should only be called on the UI thread.
void ClearSettingsForOneType(ContentSettingsType content_type);
+ static bool IsValueAllowedForType(const base::Value* value,
+ ContentSettingsType content_type);
static bool IsSettingAllowedForType(ContentSetting setting,
ContentSettingsType content_type);

Powered by Google App Engine
This is Rietveld 408576698