Chromium Code Reviews| 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); |