Chromium Code Reviews| 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 25 matching lines...) Expand all Loading... | |
| 36 // normal mode. Otherwise, it returns the content settings for the normal | 36 // normal mode. Otherwise, it returns the content settings for the normal |
| 37 // mode. The caller takes the ownership of the returned |RuleIterator|. It is | 37 // mode. The caller takes the ownership of the returned |RuleIterator|. It is |
| 38 // not allowed to call other |ProviderInterface| functions (including | 38 // not allowed to call other |ProviderInterface| functions (including |
| 39 // |GetRuleIterator|) for the same provider until the |RuleIterator| is | 39 // |GetRuleIterator|) for the same provider until the |RuleIterator| is |
| 40 // destroyed. | 40 // destroyed. |
| 41 virtual RuleIterator* GetRuleIterator( | 41 virtual RuleIterator* GetRuleIterator( |
| 42 ContentSettingsType content_type, | 42 ContentSettingsType content_type, |
| 43 const ResourceIdentifier& resource_identifier, | 43 const ResourceIdentifier& resource_identifier, |
| 44 bool incognito) const = 0; | 44 bool incognito) const = 0; |
| 45 | 45 |
| 46 // Sets the content setting for a particular |primary_pattern|, | 46 // Askes the provider to set the website setting for a particular |
| 47 // |secondary_pattern|, |content_type| tuple. For ContentSettingsTypes that | 47 // |primary_pattern|, |secondary_pattern|, |content_type| tuple. For |
| 48 // require a resource identifier to be specified, the |resource_identifier| | 48 // ContentSettingsTypes that require a resource identifier to be specified, |
| 49 // must be non-empty. | 49 // the |resource_identifier| must be non-empty. If the provider accepts the |
|
Bernhard Bauer
2011/11/15 15:40:28
The part about requiring a resource identifier is
markusheintz_
2011/11/15 17:36:58
Done.
| |
| 50 // setting it returns true and takes the ownership of the |value|. Otherwise | |
| 51 // false is returned and the ownership of the |value| stays with the caller. | |
| 50 // | 52 // |
| 51 // This should only be called on the UI thread, and not after | 53 // This should only be called on the UI thread, and not after |
| 52 // ShutdownOnUIThread has been called. | 54 // ShutdownOnUIThread has been called. |
| 53 virtual void SetContentSetting( | 55 virtual bool SetWebsiteSetting( |
| 54 const ContentSettingsPattern& primary_pattern, | 56 const ContentSettingsPattern& primary_pattern, |
| 55 const ContentSettingsPattern& secondary_pattern, | 57 const ContentSettingsPattern& secondary_pattern, |
| 56 ContentSettingsType content_type, | 58 ContentSettingsType content_type, |
| 57 const ResourceIdentifier& resource_identifier, | 59 const ResourceIdentifier& resource_identifier, |
| 58 ContentSetting content_setting) = 0; | 60 Value* value) = 0; |
| 59 | 61 |
| 60 // Resets all content settings for the given |content_type| and empty resource | 62 // Resets all content settings for the given |content_type| and empty resource |
| 61 // identifier to CONTENT_SETTING_DEFAULT. | 63 // identifier to CONTENT_SETTING_DEFAULT. |
| 62 // | 64 // |
| 63 // This should only be called on the UI thread, and not after | 65 // This should only be called on the UI thread, and not after |
| 64 // ShutdownOnUIThread has been called. | 66 // ShutdownOnUIThread has been called. |
| 65 virtual void ClearAllContentSettingsRules( | 67 virtual void ClearAllContentSettingsRules( |
| 66 ContentSettingsType content_type) = 0; | 68 ContentSettingsType content_type) = 0; |
| 67 | 69 |
| 68 // Detaches the Provider from all Profile-related objects like PrefService. | 70 // Detaches the Provider from all Profile-related objects like PrefService. |
| 69 // This methods needs to be called before destroying the Profile. | 71 // This methods needs to be called before destroying the Profile. |
| 70 // Afterwards, none of the methods above that should only be called on the UI | 72 // Afterwards, none of the methods above that should only be called on the UI |
| 71 // thread should be called anymore. | 73 // thread should be called anymore. |
| 72 virtual void ShutdownOnUIThread() = 0; | 74 virtual void ShutdownOnUIThread() = 0; |
| 73 }; | 75 }; |
| 74 | 76 |
| 75 } // namespace content_settings | 77 } // namespace content_settings |
| 76 | 78 |
| 77 #endif // CHROME_BROWSER_CONTENT_SETTINGS_CONTENT_SETTINGS_PROVIDER_H_ | 79 #endif // CHROME_BROWSER_CONTENT_SETTINGS_CONTENT_SETTINGS_PROVIDER_H_ |
| OLD | NEW |