| OLD | NEW |
| 1 // Copyright (c) 2011 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2011 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 #pragma once | 10 #pragma once |
| (...skipping 106 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 117 // must be a non-NULL outparam. If this map was created for the | 117 // must be a non-NULL outparam. If this map was created for the |
| 118 // incognito profile, it will only return those settings differing from | 118 // incognito profile, it will only return those settings differing from |
| 119 // the main map. For ContentSettingsTypes that require an resource identifier | 119 // the main map. For ContentSettingsTypes that require an resource identifier |
| 120 // to be specified, the |resource_identifier| must be non-empty. | 120 // to be specified, the |resource_identifier| must be non-empty. |
| 121 // | 121 // |
| 122 // This may be called on any thread. | 122 // This may be called on any thread. |
| 123 void GetSettingsForOneType(ContentSettingsType content_type, | 123 void GetSettingsForOneType(ContentSettingsType content_type, |
| 124 const std::string& resource_identifier, | 124 const std::string& resource_identifier, |
| 125 SettingsForOneType* settings) const; | 125 SettingsForOneType* settings) const; |
| 126 | 126 |
| 127 // For a given content type, returns all patterns with a non-default setting, |
| 128 // mapped to their actual setting, in the order in which they would be checked |
| 129 // by GetContentSetting. |
| 130 void GetConcatenatedSettingsForOneType(ContentSettingsType content_type, |
| 131 const std::string& resource_identifier, |
| 132 ContentSettingRules* rules) const; |
| 133 |
| 127 // Sets the default setting for a particular content type. This method must | 134 // Sets the default setting for a particular content type. This method must |
| 128 // not be invoked on an incognito map. | 135 // not be invoked on an incognito map. |
| 129 // | 136 // |
| 130 // This should only be called on the UI thread. | 137 // This should only be called on the UI thread. |
| 131 void SetDefaultContentSetting(ContentSettingsType content_type, | 138 void SetDefaultContentSetting(ContentSettingsType content_type, |
| 132 ContentSetting setting); | 139 ContentSetting setting); |
| 133 | 140 |
| 134 // Sets the content setting for the given patterns and content type. | 141 // Sets the content setting for the given patterns and content type. |
| 135 // Setting the value to CONTENT_SETTING_DEFAULT causes the default setting | 142 // Setting the value to CONTENT_SETTING_DEFAULT causes the default setting |
| 136 // for that type to be used when loading pages matching this pattern. For | 143 // for that type to be used when loading pages matching this pattern. For |
| (...skipping 122 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 259 mutable base::Lock lock_; | 266 mutable base::Lock lock_; |
| 260 | 267 |
| 261 // Misc global settings. | 268 // Misc global settings. |
| 262 bool block_third_party_cookies_; | 269 bool block_third_party_cookies_; |
| 263 bool is_block_third_party_cookies_managed_; | 270 bool is_block_third_party_cookies_managed_; |
| 264 | 271 |
| 265 DISALLOW_COPY_AND_ASSIGN(HostContentSettingsMap); | 272 DISALLOW_COPY_AND_ASSIGN(HostContentSettingsMap); |
| 266 }; | 273 }; |
| 267 | 274 |
| 268 #endif // CHROME_BROWSER_CONTENT_SETTINGS_HOST_CONTENT_SETTINGS_MAP_H_ | 275 #endif // CHROME_BROWSER_CONTENT_SETTINGS_HOST_CONTENT_SETTINGS_MAP_H_ |
| OLD | NEW |