Chromium Code Reviews| OLD | NEW |
|---|---|
| 1 // Copyright (c) 2010 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2010 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_HOST_CONTENT_SETTINGS_MAP_H_ | 8 #ifndef CHROME_BROWSER_HOST_CONTENT_SETTINGS_MAP_H_ |
| 9 #define CHROME_BROWSER_HOST_CONTENT_SETTINGS_MAP_H_ | 9 #define CHROME_BROWSER_HOST_CONTENT_SETTINGS_MAP_H_ |
| 10 #pragma once | 10 #pragma once |
| (...skipping 232 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 243 friend class base::RefCountedThreadSafe<HostContentSettingsMap>; | 243 friend class base::RefCountedThreadSafe<HostContentSettingsMap>; |
| 244 | 244 |
| 245 typedef std::pair<ContentSettingsType, std::string> | 245 typedef std::pair<ContentSettingsType, std::string> |
| 246 ContentSettingsTypeResourceIdentifierPair; | 246 ContentSettingsTypeResourceIdentifierPair; |
| 247 typedef std::map<ContentSettingsTypeResourceIdentifierPair, ContentSetting> | 247 typedef std::map<ContentSettingsTypeResourceIdentifierPair, ContentSetting> |
| 248 ResourceContentSettings; | 248 ResourceContentSettings; |
| 249 | 249 |
| 250 struct ExtendedContentSettings; | 250 struct ExtendedContentSettings; |
| 251 typedef std::map<std::string, ExtendedContentSettings> HostContentSettings; | 251 typedef std::map<std::string, ExtendedContentSettings> HostContentSettings; |
| 252 | 252 |
| 253 ContentSetting ClickToPlayFixup(ContentSettingsType content_type, | |
|
Mattias Nissler (ping if slow)
2010/11/12 11:49:46
Maybe add a comment explaining what it does?
| |
| 254 ContentSetting setting); | |
| 255 | |
| 253 // Sets the fields of |settings| based on the values in |dictionary|. | 256 // Sets the fields of |settings| based on the values in |dictionary|. |
| 254 void GetSettingsFromDictionary(const DictionaryValue* dictionary, | 257 void GetSettingsFromDictionary(const DictionaryValue* dictionary, |
| 255 ContentSettings* settings); | 258 ContentSettings* settings); |
| 256 | 259 |
| 257 // Populates |settings| based on the values in |dictionary|. | 260 // Populates |settings| based on the values in |dictionary|. |
| 258 void GetResourceSettingsFromDictionary(const DictionaryValue* dictionary, | 261 void GetResourceSettingsFromDictionary(const DictionaryValue* dictionary, |
| 259 ResourceContentSettings* settings); | 262 ResourceContentSettings* settings); |
| 260 | 263 |
| 261 // Forces the default settings to be explicitly set instead of themselves | 264 // Forces the default settings to be explicitly set instead of themselves |
| 262 // being CONTENT_SETTING_DEFAULT. | 265 // being CONTENT_SETTING_DEFAULT. |
| (...skipping 61 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 324 }; | 327 }; |
| 325 | 328 |
| 326 // Stream operator so HostContentSettingsMap::Pattern can be used in | 329 // Stream operator so HostContentSettingsMap::Pattern can be used in |
| 327 // assertion statements. | 330 // assertion statements. |
| 328 inline std::ostream& operator<<( | 331 inline std::ostream& operator<<( |
| 329 std::ostream& out, const HostContentSettingsMap::Pattern& pattern) { | 332 std::ostream& out, const HostContentSettingsMap::Pattern& pattern) { |
| 330 return out << pattern.AsString(); | 333 return out << pattern.AsString(); |
| 331 } | 334 } |
| 332 | 335 |
| 333 #endif // CHROME_BROWSER_HOST_CONTENT_SETTINGS_MAP_H_ | 336 #endif // CHROME_BROWSER_HOST_CONTENT_SETTINGS_MAP_H_ |
| OLD | NEW |