| 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 // Interface for objects providing content setting rules. | 5 // Interface for objects providing content setting rules. |
| 6 | 6 |
| 7 #ifndef CHROME_BROWSER_CONTENT_SETTINGS_CONTENT_SETTINGS_PROVIDER_H_ | 7 #ifndef CHROME_BROWSER_CONTENT_SETTINGS_CONTENT_SETTINGS_PROVIDER_H_ |
| 8 #define CHROME_BROWSER_CONTENT_SETTINGS_CONTENT_SETTINGS_PROVIDER_H_ | 8 #define CHROME_BROWSER_CONTENT_SETTINGS_CONTENT_SETTINGS_PROVIDER_H_ |
| 9 #pragma once | 9 #pragma once |
| 10 | 10 |
| (...skipping 24 matching lines...) Expand all Loading... |
| 35 // Notifies the provider that the host content settings map would like to | 35 // Notifies the provider that the host content settings map would like to |
| 36 // update the default setting for the given |content_type|. The provider may | 36 // update the default setting for the given |content_type|. The provider may |
| 37 // ignore this. | 37 // ignore this. |
| 38 virtual void UpdateDefaultSetting(ContentSettingsType content_type, | 38 virtual void UpdateDefaultSetting(ContentSettingsType content_type, |
| 39 ContentSetting setting) = 0; | 39 ContentSetting setting) = 0; |
| 40 | 40 |
| 41 // True if the default setting for the |content_type| is policy managed, i.e., | 41 // True if the default setting for the |content_type| is policy managed, i.e., |
| 42 // there shouldn't be any UI shown to modify this setting. | 42 // there shouldn't be any UI shown to modify this setting. |
| 43 virtual bool DefaultSettingIsManaged( | 43 virtual bool DefaultSettingIsManaged( |
| 44 ContentSettingsType content_type) const = 0; | 44 ContentSettingsType content_type) const = 0; |
| 45 |
| 46 virtual void ShutdownOnUIThread() = 0; |
| 45 }; | 47 }; |
| 46 | 48 |
| 47 class ProviderInterface { | 49 class ProviderInterface { |
| 48 public: | 50 public: |
| 49 struct Rule { | 51 struct Rule { |
| 50 Rule(); | 52 Rule(); |
| 51 Rule(const ContentSettingsPattern& primary_pattern, | 53 Rule(const ContentSettingsPattern& primary_pattern, |
| 52 const ContentSettingsPattern& secondary_pattern, | 54 const ContentSettingsPattern& secondary_pattern, |
| 53 ContentSetting setting); | 55 ContentSetting setting); |
| 54 | 56 |
| (...skipping 41 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 96 // must be non-empty. | 98 // must be non-empty. |
| 97 // | 99 // |
| 98 // This may be called on any thread. | 100 // This may be called on any thread. |
| 99 virtual void GetAllContentSettingsRules( | 101 virtual void GetAllContentSettingsRules( |
| 100 ContentSettingsType content_type, | 102 ContentSettingsType content_type, |
| 101 const ResourceIdentifier& resource_identifier, | 103 const ResourceIdentifier& resource_identifier, |
| 102 Rules* content_setting_rules) const = 0; | 104 Rules* content_setting_rules) const = 0; |
| 103 | 105 |
| 104 // Resets all content settings for the given |content_type| to | 106 // Resets all content settings for the given |content_type| to |
| 105 // CONTENT_SETTING_DEFAULT. For content types that require a resource | 107 // CONTENT_SETTING_DEFAULT. For content types that require a resource |
| 106 // identifier all content settings for any resource identifieres of the given | 108 // identifier all content settings for any resource identifiers of the given |
| 107 // |content_type| will be reset to CONTENT_SETTING_DEFAULT. | 109 // |content_type| will be reset to CONTENT_SETTING_DEFAULT. |
| 108 // | 110 // |
| 109 // This should only be called on the UI thread, and not after | 111 // This should only be called on the UI thread, and not after |
| 110 // ShutdownOnUIThread has been called. | 112 // ShutdownOnUIThread has been called. |
| 111 virtual void ClearAllContentSettingsRules( | 113 virtual void ClearAllContentSettingsRules( |
| 112 ContentSettingsType content_type) = 0; | 114 ContentSettingsType content_type) = 0; |
| 113 | 115 |
| 114 // Detaches the Provider from all Profile-related objects like PrefService. | 116 // Detaches the Provider from all Profile-related objects like PrefService. |
| 115 // This methods needs to be called before destroying the Profile. | 117 // This methods needs to be called before destroying the Profile. |
| 116 // Afterwards, none of the methods above that should only be called on the UI | 118 // Afterwards, none of the methods above that should only be called on the UI |
| 117 // thread should be called anymore. | 119 // thread should be called anymore. |
| 118 virtual void ShutdownOnUIThread() {} | 120 virtual void ShutdownOnUIThread() = 0; |
| 119 }; | 121 }; |
| 120 | 122 |
| 121 } // namespace content_settings | 123 } // namespace content_settings |
| 122 | 124 |
| 123 #endif // CHROME_BROWSER_CONTENT_SETTINGS_CONTENT_SETTINGS_PROVIDER_H_ | 125 #endif // CHROME_BROWSER_CONTENT_SETTINGS_CONTENT_SETTINGS_PROVIDER_H_ |
| OLD | NEW |