| OLD | NEW |
| 1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. |
| 2 // Use of this source code is governed by a BSD-style license that can be | 2 // Use of this source code is governed by a BSD-style license that can be |
| 3 // found in the LICENSE file. | 3 // found in the LICENSE file. |
| 4 | 4 |
| 5 // Maps hostnames to custom content settings. Written on the UI thread and read | 5 // Maps hostnames to custom content settings. Written on the UI thread and read |
| 6 // on any thread. One instance per profile. | 6 // on any thread. One instance per profile. |
| 7 | 7 |
| 8 #ifndef CHROME_BROWSER_CONTENT_SETTINGS_HOST_CONTENT_SETTINGS_MAP_H_ | 8 #ifndef CHROME_BROWSER_CONTENT_SETTINGS_HOST_CONTENT_SETTINGS_MAP_H_ |
| 9 #define CHROME_BROWSER_CONTENT_SETTINGS_HOST_CONTENT_SETTINGS_MAP_H_ | 9 #define CHROME_BROWSER_CONTENT_SETTINGS_HOST_CONTENT_SETTINGS_MAP_H_ |
| 10 | 10 |
| (...skipping 128 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 139 // for that type to be used when loading pages matching this pattern. | 139 // for that type to be used when loading pages matching this pattern. |
| 140 // | 140 // |
| 141 // Takes ownership of the passed value. | 141 // Takes ownership of the passed value. |
| 142 void SetWebsiteSetting(const ContentSettingsPattern& primary_pattern, | 142 void SetWebsiteSetting(const ContentSettingsPattern& primary_pattern, |
| 143 const ContentSettingsPattern& secondary_pattern, | 143 const ContentSettingsPattern& secondary_pattern, |
| 144 ContentSettingsType content_type, | 144 ContentSettingsType content_type, |
| 145 const std::string& resource_identifier, | 145 const std::string& resource_identifier, |
| 146 base::Value* value); | 146 base::Value* value); |
| 147 | 147 |
| 148 // Convenience method to add a content setting for the given URLs, making sure | 148 // Convenience method to add a content setting for the given URLs, making sure |
| 149 // that there is no setting overriding it. For ContentSettingsTypes that | 149 // that there is no setting overriding it. |
| 150 // require an resource identifier to be specified, the |resource_identifier| | |
| 151 // must be non-empty. | |
| 152 // | 150 // |
| 153 // This should only be called on the UI thread. | 151 // This should only be called on the UI thread. |
| 154 void AddExceptionForURL(const GURL& primary_url, | 152 void AddExceptionForURL(const GURL& primary_url, |
| 155 const GURL& secondary_url, | 153 const GURL& secondary_url, |
| 156 ContentSettingsType content_type, | 154 ContentSettingsType content_type, |
| 157 const std::string& resource_identifier, | |
| 158 ContentSetting setting); | 155 ContentSetting setting); |
| 159 | 156 |
| 160 // Clears all host-specific settings for one content type. | 157 // Clears all host-specific settings for one content type. |
| 161 // | 158 // |
| 162 // This should only be called on the UI thread. | 159 // This should only be called on the UI thread. |
| 163 void ClearSettingsForOneType(ContentSettingsType content_type); | 160 void ClearSettingsForOneType(ContentSettingsType content_type); |
| 164 | 161 |
| 165 static bool IsValueAllowedForType(PrefService* prefs, | 162 static bool IsValueAllowedForType(PrefService* prefs, |
| 166 const base::Value* value, | 163 const base::Value* value, |
| 167 ContentSettingsType content_type); | 164 ContentSettingsType content_type); |
| (...skipping 89 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 257 | 254 |
| 258 // Content setting providers. This is only modified at construction | 255 // Content setting providers. This is only modified at construction |
| 259 // time and by RegisterExtensionService, both of which should happen | 256 // time and by RegisterExtensionService, both of which should happen |
| 260 // before any other uses of it. | 257 // before any other uses of it. |
| 261 ProviderMap content_settings_providers_; | 258 ProviderMap content_settings_providers_; |
| 262 | 259 |
| 263 DISALLOW_COPY_AND_ASSIGN(HostContentSettingsMap); | 260 DISALLOW_COPY_AND_ASSIGN(HostContentSettingsMap); |
| 264 }; | 261 }; |
| 265 | 262 |
| 266 #endif // CHROME_BROWSER_CONTENT_SETTINGS_HOST_CONTENT_SETTINGS_MAP_H_ | 263 #endif // CHROME_BROWSER_CONTENT_SETTINGS_HOST_CONTENT_SETTINGS_MAP_H_ |
| OLD | NEW |