| 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 34 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 45 EXTENSION_PROVIDER, | 45 EXTENSION_PROVIDER, |
| 46 PREF_PROVIDER, | 46 PREF_PROVIDER, |
| 47 DEFAULT_PROVIDER, | 47 DEFAULT_PROVIDER, |
| 48 NUM_PROVIDER_TYPES, | 48 NUM_PROVIDER_TYPES, |
| 49 }; | 49 }; |
| 50 | 50 |
| 51 HostContentSettingsMap(PrefService* prefs, | 51 HostContentSettingsMap(PrefService* prefs, |
| 52 ExtensionService* extension_service, | 52 ExtensionService* extension_service, |
| 53 bool incognito); | 53 bool incognito); |
| 54 | 54 |
| 55 // In some cases, the ExtensionService is not available at the time the |
| 56 // HostContentSettingsMap is constructed. In these cases, we register the |
| 57 // service once it's available. |
| 58 void RegisterExtensionService(ExtensionService* extension_service); |
| 59 |
| 55 static void RegisterUserPrefs(PrefService* prefs); | 60 static void RegisterUserPrefs(PrefService* prefs); |
| 56 | 61 |
| 57 // Returns the default setting for a particular content type. If |provider_id| | 62 // Returns the default setting for a particular content type. If |provider_id| |
| 58 // is not NULL, the id of the provider which provided the default setting is | 63 // is not NULL, the id of the provider which provided the default setting is |
| 59 // assigned to it. | 64 // assigned to it. |
| 60 // | 65 // |
| 61 // This may be called on any thread. | 66 // This may be called on any thread. |
| 62 ContentSetting GetDefaultContentSetting(ContentSettingsType content_type, | 67 ContentSetting GetDefaultContentSetting(ContentSettingsType content_type, |
| 63 std::string* provider_id) const; | 68 std::string* provider_id) const; |
| 64 | 69 |
| (...skipping 157 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 222 // Content setting providers. | 227 // Content setting providers. |
| 223 ProviderMap content_settings_providers_; | 228 ProviderMap content_settings_providers_; |
| 224 | 229 |
| 225 // Used around accesses to the following objects to guarantee thread safety. | 230 // Used around accesses to the following objects to guarantee thread safety. |
| 226 mutable base::Lock lock_; | 231 mutable base::Lock lock_; |
| 227 | 232 |
| 228 DISALLOW_COPY_AND_ASSIGN(HostContentSettingsMap); | 233 DISALLOW_COPY_AND_ASSIGN(HostContentSettingsMap); |
| 229 }; | 234 }; |
| 230 | 235 |
| 231 #endif // CHROME_BROWSER_CONTENT_SETTINGS_HOST_CONTENT_SETTINGS_MAP_H_ | 236 #endif // CHROME_BROWSER_CONTENT_SETTINGS_HOST_CONTENT_SETTINGS_MAP_H_ |
| OLD | NEW |