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 #pragma once | 10 #pragma once |
(...skipping 147 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
158 // This should only be called on the UI thread. | 158 // This should only be called on the UI thread. |
159 void ClearSettingsForOneType(ContentSettingsType content_type); | 159 void ClearSettingsForOneType(ContentSettingsType content_type); |
160 | 160 |
161 static bool IsValueAllowedForType(PrefService* prefs, | 161 static bool IsValueAllowedForType(PrefService* prefs, |
162 const base::Value* value, | 162 const base::Value* value, |
163 ContentSettingsType content_type); | 163 ContentSettingsType content_type); |
164 static bool IsSettingAllowedForType(PrefService* prefs, | 164 static bool IsSettingAllowedForType(PrefService* prefs, |
165 ContentSetting setting, | 165 ContentSetting setting, |
166 ContentSettingsType content_type); | 166 ContentSettingsType content_type); |
167 | 167 |
| 168 // Returns true if the values for content type are of type dictionary/map. |
| 169 static bool ContentTypeHasCompoundValue(ContentSettingsType type); |
| 170 |
168 // Detaches the HostContentSettingsMap from all Profile-related objects like | 171 // Detaches the HostContentSettingsMap from all Profile-related objects like |
169 // PrefService. This methods needs to be called before destroying the Profile. | 172 // PrefService. This methods needs to be called before destroying the Profile. |
170 // Afterwards, none of the methods above that should only be called on the UI | 173 // Afterwards, none of the methods above that should only be called on the UI |
171 // thread should be called anymore. | 174 // thread should be called anymore. |
172 void ShutdownOnUIThread(); | 175 void ShutdownOnUIThread(); |
173 | 176 |
174 // content_settings::Observer implementation. | 177 // content_settings::Observer implementation. |
175 virtual void OnContentSettingChanged( | 178 virtual void OnContentSettingChanged( |
176 const ContentSettingsPattern& primary_pattern, | 179 const ContentSettingsPattern& primary_pattern, |
177 const ContentSettingsPattern& secondary_pattern, | 180 const ContentSettingsPattern& secondary_pattern, |
(...skipping 47 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
225 // Content setting providers. | 228 // Content setting providers. |
226 ProviderMap content_settings_providers_; | 229 ProviderMap content_settings_providers_; |
227 | 230 |
228 // Used around accesses to the following objects to guarantee thread safety. | 231 // Used around accesses to the following objects to guarantee thread safety. |
229 mutable base::Lock lock_; | 232 mutable base::Lock lock_; |
230 | 233 |
231 DISALLOW_COPY_AND_ASSIGN(HostContentSettingsMap); | 234 DISALLOW_COPY_AND_ASSIGN(HostContentSettingsMap); |
232 }; | 235 }; |
233 | 236 |
234 #endif // CHROME_BROWSER_CONTENT_SETTINGS_HOST_CONTENT_SETTINGS_MAP_H_ | 237 #endif // CHROME_BROWSER_CONTENT_SETTINGS_HOST_CONTENT_SETTINGS_MAP_H_ |
OLD | NEW |