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 // normal mode. Otherwise, it returns the content settings for the normal | 35 // normal mode. Otherwise, it returns the content settings for the normal |
36 // mode. The caller takes the ownership of the returned |RuleIterator|. It is | 36 // mode. The caller takes the ownership of the returned |RuleIterator|. It is |
37 // not allowed to call other |ProviderInterface| functions (including | 37 // not allowed to call other |ProviderInterface| functions (including |
38 // |GetRuleIterator|) for the same provider until the |RuleIterator| is | 38 // |GetRuleIterator|) for the same provider until the |RuleIterator| is |
39 // destroyed. | 39 // destroyed. |
40 virtual RuleIterator* GetRuleIterator( | 40 virtual RuleIterator* GetRuleIterator( |
41 ContentSettingsType content_type, | 41 ContentSettingsType content_type, |
42 const ResourceIdentifier& resource_identifier, | 42 const ResourceIdentifier& resource_identifier, |
43 bool incognito) const = 0; | 43 bool incognito) const = 0; |
44 | 44 |
45 // Askes the provider to set the website setting for a particular | 45 // Asks the provider to set the website setting for a particular |
46 // |primary_pattern|, |secondary_pattern|, |content_type| tuple. If the | 46 // |primary_pattern|, |secondary_pattern|, |content_type| tuple. If the |
47 // provider accepts the setting it returns true and takes the ownership of the | 47 // provider accepts the setting it returns true and takes the ownership of the |
48 // |value|. Otherwise false is returned and the ownership of the |value| stays | 48 // |value|. Otherwise false is returned and the ownership of the |value| stays |
49 // with the caller. | 49 // with the caller. |
50 // | 50 // |
51 // This should only be called on the UI thread, and not after | 51 // This should only be called on the UI thread, and not after |
52 // ShutdownOnUIThread has been called. | 52 // ShutdownOnUIThread has been called. |
53 virtual bool SetWebsiteSetting( | 53 virtual bool SetWebsiteSetting( |
54 const ContentSettingsPattern& primary_pattern, | 54 const ContentSettingsPattern& primary_pattern, |
55 const ContentSettingsPattern& secondary_pattern, | 55 const ContentSettingsPattern& secondary_pattern, |
(...skipping 12 matching lines...) Expand all Loading... |
68 // Detaches the Provider from all Profile-related objects like PrefService. | 68 // Detaches the Provider from all Profile-related objects like PrefService. |
69 // This methods needs to be called before destroying the Profile. | 69 // 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 | 70 // Afterwards, none of the methods above that should only be called on the UI |
71 // thread should be called anymore. | 71 // thread should be called anymore. |
72 virtual void ShutdownOnUIThread() = 0; | 72 virtual void ShutdownOnUIThread() = 0; |
73 }; | 73 }; |
74 | 74 |
75 } // namespace content_settings | 75 } // namespace content_settings |
76 | 76 |
77 #endif // CHROME_BROWSER_CONTENT_SETTINGS_CONTENT_SETTINGS_PROVIDER_H_ | 77 #endif // CHROME_BROWSER_CONTENT_SETTINGS_CONTENT_SETTINGS_PROVIDER_H_ |
OLD | NEW |