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 76 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
87 // Returns all non-default ContentSettings which apply to a given URL. For | 87 // Returns all non-default ContentSettings which apply to a given URL. For |
88 // content setting types that require an additional resource identifier, | 88 // content setting types that require an additional resource identifier, |
89 // CONTENT_SETTING_DEFAULT is returned. | 89 // CONTENT_SETTING_DEFAULT is returned. |
90 // | 90 // |
91 // This may be called on any thread. | 91 // This may be called on any thread. |
92 ContentSettings GetNonDefaultContentSettings(const GURL& url) const; | 92 ContentSettings GetNonDefaultContentSettings(const GURL& url) const; |
93 | 93 |
94 // For a given content type, returns all patterns with a non-default setting, | 94 // For a given content type, returns all patterns with a non-default setting, |
95 // mapped to their actual settings, in lexicographical order. |settings| | 95 // mapped to their actual settings, in lexicographical order. |settings| |
96 // must be a non-NULL outparam. If this map was created for the | 96 // must be a non-NULL outparam. If this map was created for the |
97 // off-the-record profile, it will only return those settings differing from | 97 // incognito profile, it will only return those settings differing from |
98 // the main map. For ContentSettingsTypes that require an resource identifier | 98 // the main map. For ContentSettingsTypes that require an resource identifier |
99 // to be specified, the |resource_identifier| must be non-empty. | 99 // to be specified, the |resource_identifier| must be non-empty. |
100 // | 100 // |
101 // This may be called on any thread. | 101 // This may be called on any thread. |
102 void GetSettingsForOneType(ContentSettingsType content_type, | 102 void GetSettingsForOneType(ContentSettingsType content_type, |
103 const std::string& resource_identifier, | 103 const std::string& resource_identifier, |
104 SettingsForOneType* settings) const; | 104 SettingsForOneType* settings) const; |
105 | 105 |
106 // Sets the default setting for a particular content type. This method must | 106 // Sets the default setting for a particular content type. This method must |
107 // not be invoked on an off-the-record map. | 107 // not be invoked on an incognito map. |
108 // | 108 // |
109 // This should only be called on the UI thread. | 109 // This should only be called on the UI thread. |
110 void SetDefaultContentSetting(ContentSettingsType content_type, | 110 void SetDefaultContentSetting(ContentSettingsType content_type, |
111 ContentSetting setting); | 111 ContentSetting setting); |
112 | 112 |
113 // Sets the blocking setting for a particular pattern and content type. | 113 // Sets the blocking setting for a particular pattern and content type. |
114 // Setting the value to CONTENT_SETTING_DEFAULT causes the default setting | 114 // Setting the value to CONTENT_SETTING_DEFAULT causes the default setting |
115 // for that type to be used when loading pages matching this pattern. For | 115 // for that type to be used when loading pages matching this pattern. For |
116 // ContentSettingsTypes that require an resource identifier to be specified, | 116 // ContentSettingsTypes that require an resource identifier to be specified, |
117 // the |resource_identifier| must be non-empty. | 117 // the |resource_identifier| must be non-empty. |
(...skipping 20 matching lines...) Expand all Loading... |
138 // This should only be called on the UI thread. | 138 // This should only be called on the UI thread. |
139 void ClearSettingsForOneType(ContentSettingsType content_type); | 139 void ClearSettingsForOneType(ContentSettingsType content_type); |
140 | 140 |
141 // This setting trumps any host-specific settings. | 141 // This setting trumps any host-specific settings. |
142 bool BlockThirdPartyCookies() const { return block_third_party_cookies_; } | 142 bool BlockThirdPartyCookies() const { return block_third_party_cookies_; } |
143 bool IsBlockThirdPartyCookiesManaged() const { | 143 bool IsBlockThirdPartyCookiesManaged() const { |
144 return is_block_third_party_cookies_managed_; | 144 return is_block_third_party_cookies_managed_; |
145 } | 145 } |
146 | 146 |
147 // Sets whether we block all third-party cookies. This method must not be | 147 // Sets whether we block all third-party cookies. This method must not be |
148 // invoked on an off-the-record map. | 148 // invoked on an incognito map. |
149 // | 149 // |
150 // This should only be called on the UI thread. | 150 // This should only be called on the UI thread. |
151 void SetBlockThirdPartyCookies(bool block); | 151 void SetBlockThirdPartyCookies(bool block); |
152 | 152 |
153 bool GetBlockNonsandboxedPlugins() const { | 153 bool GetBlockNonsandboxedPlugins() const { |
154 return block_nonsandboxed_plugins_; | 154 return block_nonsandboxed_plugins_; |
155 } | 155 } |
156 | 156 |
157 void SetBlockNonsandboxedPlugins(bool block); | 157 void SetBlockNonsandboxedPlugins(bool block); |
158 | 158 |
(...skipping 54 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
213 | 213 |
214 // Misc global settings. | 214 // Misc global settings. |
215 bool block_third_party_cookies_; | 215 bool block_third_party_cookies_; |
216 bool is_block_third_party_cookies_managed_; | 216 bool is_block_third_party_cookies_managed_; |
217 bool block_nonsandboxed_plugins_; | 217 bool block_nonsandboxed_plugins_; |
218 | 218 |
219 DISALLOW_COPY_AND_ASSIGN(HostContentSettingsMap); | 219 DISALLOW_COPY_AND_ASSIGN(HostContentSettingsMap); |
220 }; | 220 }; |
221 | 221 |
222 #endif // CHROME_BROWSER_CONTENT_SETTINGS_HOST_CONTENT_SETTINGS_MAP_H_ | 222 #endif // CHROME_BROWSER_CONTENT_SETTINGS_HOST_CONTENT_SETTINGS_MAP_H_ |
OLD | NEW |