| 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 27 matching lines...) Expand all Loading... |
| 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 // Resets the state of the provider to the default. | 41 // Resets the state of the provider to the default. |
| 42 virtual void ResetToDefaults() = 0; | 42 virtual void ResetToDefaults() = 0; |
| 43 | 43 |
| 44 // True if the default setting for the |content_type| is policy managed, i.e., | 44 // True if the default setting for the |content_type| is policy managed, i.e., |
| 45 // there shouldn't be any UI shown to modify this setting. | 45 // there shouldn't be any UI shown to modify this setting. |
| 46 virtual bool DefaultSettingIsManaged( | 46 virtual bool DefaultSettingIsManaged( |
| 47 ContentSettingsType content_type) const = 0; | 47 ContentSettingsType content_type) const = 0; |
| 48 |
| 49 virtual void ShutdownOnUIThread() = 0; |
| 48 }; | 50 }; |
| 49 | 51 |
| 50 class ProviderInterface { | 52 class ProviderInterface { |
| 51 public: | 53 public: |
| 52 struct Rule { | 54 struct Rule { |
| 53 Rule(); | 55 Rule(); |
| 54 Rule(const ContentSettingsPattern& primary_pattern, | 56 Rule(const ContentSettingsPattern& primary_pattern, |
| 55 const ContentSettingsPattern& secondary_pattern, | 57 const ContentSettingsPattern& secondary_pattern, |
| 56 ContentSetting setting); | 58 ContentSetting setting); |
| 57 | 59 |
| (...skipping 41 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 99 // must be non-empty. | 101 // must be non-empty. |
| 100 // | 102 // |
| 101 // This may be called on any thread. | 103 // This may be called on any thread. |
| 102 virtual void GetAllContentSettingsRules( | 104 virtual void GetAllContentSettingsRules( |
| 103 ContentSettingsType content_type, | 105 ContentSettingsType content_type, |
| 104 const ResourceIdentifier& resource_identifier, | 106 const ResourceIdentifier& resource_identifier, |
| 105 Rules* content_setting_rules) const = 0; | 107 Rules* content_setting_rules) const = 0; |
| 106 | 108 |
| 107 // Resets all content settings for the given |content_type| to | 109 // Resets all content settings for the given |content_type| to |
| 108 // CONTENT_SETTING_DEFAULT. For content types that require a resource | 110 // CONTENT_SETTING_DEFAULT. For content types that require a resource |
| 109 // identifier all content settings for any resource identifieres of the given | 111 // identifier all content settings for any resource identifiers of the given |
| 110 // |content_type| will be reset to CONTENT_SETTING_DEFAULT. | 112 // |content_type| will be reset to CONTENT_SETTING_DEFAULT. |
| 111 // | 113 // |
| 112 // This should only be called on the UI thread, and not after | 114 // This should only be called on the UI thread, and not after |
| 113 // ShutdownOnUIThread has been called. | 115 // ShutdownOnUIThread has been called. |
| 114 virtual void ClearAllContentSettingsRules( | 116 virtual void ClearAllContentSettingsRules( |
| 115 ContentSettingsType content_type) = 0; | 117 ContentSettingsType content_type) = 0; |
| 116 | 118 |
| 117 // Resets all content settings to CONTENT_SETTINGS_DEFAULT. | 119 // Resets all content settings to CONTENT_SETTINGS_DEFAULT. |
| 118 // | 120 // |
| 119 // This should only be called on the UI thread, and not after | 121 // This should only be called on the UI thread, and not after |
| 120 // ShutdownOnUIThread has been called. | 122 // ShutdownOnUIThread has been called. |
| 121 virtual void ResetToDefaults() = 0; | 123 virtual void ResetToDefaults() = 0; |
| 122 | 124 |
| 123 // Detaches the Provider from all Profile-related objects like PrefService. | 125 // Detaches the Provider from all Profile-related objects like PrefService. |
| 124 // This methods needs to be called before destroying the Profile. | 126 // This methods needs to be called before destroying the Profile. |
| 125 // Afterwards, none of the methods above that should only be called on the UI | 127 // Afterwards, none of the methods above that should only be called on the UI |
| 126 // thread should be called anymore. | 128 // thread should be called anymore. |
| 127 virtual void ShutdownOnUIThread() {} | 129 virtual void ShutdownOnUIThread() = 0; |
| 128 }; | 130 }; |
| 129 | 131 |
| 130 } // namespace content_settings | 132 } // namespace content_settings |
| 131 | 133 |
| 132 #endif // CHROME_BROWSER_CONTENT_SETTINGS_CONTENT_SETTINGS_PROVIDER_H_ | 134 #endif // CHROME_BROWSER_CONTENT_SETTINGS_CONTENT_SETTINGS_PROVIDER_H_ |
| OLD | NEW |