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 COMPONENTS_CONTENT_SETTINGS_CORE_BROWSER_CONTENT_SETTINGS_PROVIDER_H_ | 7 #ifndef COMPONENTS_CONTENT_SETTINGS_CORE_BROWSER_CONTENT_SETTINGS_PROVIDER_H_ |
8 #define COMPONENTS_CONTENT_SETTINGS_CORE_BROWSER_CONTENT_SETTINGS_PROVIDER_H_ | 8 #define COMPONENTS_CONTENT_SETTINGS_CORE_BROWSER_CONTENT_SETTINGS_PROVIDER_H_ |
9 | 9 |
10 #include <memory> | 10 #include <memory> |
(...skipping 14 matching lines...) Expand all Loading... |
25 public: | 25 public: |
26 virtual ~ProviderInterface() {} | 26 virtual ~ProviderInterface() {} |
27 | 27 |
28 // Returns a |RuleIterator| over the content setting rules stored by this | 28 // Returns a |RuleIterator| over the content setting rules stored by this |
29 // provider. If |incognito| is true, the iterator returns only the content | 29 // provider. If |incognito| is true, the iterator returns only the content |
30 // settings which are applicable to the incognito mode and differ from the | 30 // settings which are applicable to the incognito mode and differ from the |
31 // normal mode. Otherwise, it returns the content settings for the normal | 31 // normal mode. Otherwise, it returns the content settings for the normal |
32 // mode. It is not allowed to call other |ProviderInterface| functions | 32 // mode. It is not allowed to call other |ProviderInterface| functions |
33 // (including |GetRuleIterator|) for the same provider until the | 33 // (including |GetRuleIterator|) for the same provider until the |
34 // |RuleIterator| is destroyed. | 34 // |RuleIterator| is destroyed. |
| 35 // Returns nullptr to indicate the RuleIterator is empty. |
35 virtual std::unique_ptr<RuleIterator> GetRuleIterator( | 36 virtual std::unique_ptr<RuleIterator> GetRuleIterator( |
36 ContentSettingsType content_type, | 37 ContentSettingsType content_type, |
37 const ResourceIdentifier& resource_identifier, | 38 const ResourceIdentifier& resource_identifier, |
38 bool incognito) const = 0; | 39 bool incognito) const = 0; |
39 | 40 |
40 // Asks the provider to set the website setting for a particular | 41 // Asks the provider to set the website setting for a particular |
41 // |primary_pattern|, |secondary_pattern|, |content_type| tuple. If the | 42 // |primary_pattern|, |secondary_pattern|, |content_type| tuple. If the |
42 // provider accepts the setting it returns true and takes the ownership of the | 43 // provider accepts the setting it returns true and takes the ownership of the |
43 // |value|. Otherwise false is returned and the ownership of the |value| stays | 44 // |value|. Otherwise false is returned and the ownership of the |value| stays |
44 // with the caller. | 45 // with the caller. |
(...skipping 18 matching lines...) Expand all Loading... |
63 // Detaches the Provider from all Profile-related objects like PrefService. | 64 // Detaches the Provider from all Profile-related objects like PrefService. |
64 // This methods needs to be called before destroying the Profile. | 65 // This methods needs to be called before destroying the Profile. |
65 // Afterwards, none of the methods above that should only be called on the UI | 66 // Afterwards, none of the methods above that should only be called on the UI |
66 // thread should be called anymore. | 67 // thread should be called anymore. |
67 virtual void ShutdownOnUIThread() = 0; | 68 virtual void ShutdownOnUIThread() = 0; |
68 }; | 69 }; |
69 | 70 |
70 } // namespace content_settings | 71 } // namespace content_settings |
71 | 72 |
72 #endif // COMPONENTS_CONTENT_SETTINGS_CORE_BROWSER_CONTENT_SETTINGS_PROVIDER_H_ | 73 #endif // COMPONENTS_CONTENT_SETTINGS_CORE_BROWSER_CONTENT_SETTINGS_PROVIDER_H_ |
OLD | NEW |