OLD | NEW |
1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2012 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 #ifndef CHROME_BROWSER_EXTENSIONS_API_CONTENT_SETTINGS_CONTENT_SETTINGS_API_H_ | 5 #ifndef CHROME_BROWSER_EXTENSIONS_API_CONTENT_SETTINGS_CONTENT_SETTINGS_API_H_ |
6 #define CHROME_BROWSER_EXTENSIONS_API_CONTENT_SETTINGS_CONTENT_SETTINGS_API_H_ | 6 #define CHROME_BROWSER_EXTENSIONS_API_CONTENT_SETTINGS_CONTENT_SETTINGS_API_H_ |
7 | 7 |
8 #include "chrome/browser/extensions/extension_function.h" | 8 #include "chrome/browser/extensions/extension_function.h" |
9 | 9 |
10 class PluginFinder; | 10 class PluginFinder; |
11 | 11 |
12 namespace webkit { | 12 namespace webkit { |
13 struct WebPluginInfo; | 13 struct WebPluginInfo; |
14 } | 14 } |
15 | 15 |
16 namespace extensions { | 16 namespace extensions { |
17 | 17 |
18 class ContentSettingsClearFunction : public SyncExtensionFunction { | 18 class ContentSettingsContentSettingClearFunction |
| 19 : public SyncExtensionFunction { |
19 public: | 20 public: |
20 DECLARE_EXTENSION_FUNCTION("contentSettings.clear", CONTENTSETTINGS_CLEAR) | 21 DECLARE_EXTENSION_FUNCTION("contentSettings.clear", CONTENTSETTINGS_CLEAR) |
21 | 22 |
22 protected: | 23 protected: |
23 virtual ~ContentSettingsClearFunction() {} | 24 virtual ~ContentSettingsContentSettingClearFunction() {} |
24 | 25 |
25 // ExtensionFunction: | 26 // ExtensionFunction: |
26 virtual bool RunImpl() OVERRIDE; | 27 virtual bool RunImpl() OVERRIDE; |
27 }; | 28 }; |
28 | 29 |
29 class ContentSettingsGetFunction : public SyncExtensionFunction { | 30 class ContentSettingsContentSettingGetFunction : public SyncExtensionFunction { |
30 public: | 31 public: |
31 DECLARE_EXTENSION_FUNCTION("contentSettings.get", CONTENTSETTINGS_GET) | 32 DECLARE_EXTENSION_FUNCTION("contentSettings.get", CONTENTSETTINGS_GET) |
32 | 33 |
33 protected: | 34 protected: |
34 virtual ~ContentSettingsGetFunction() {} | 35 virtual ~ContentSettingsContentSettingGetFunction() {} |
35 | 36 |
36 // ExtensionFunction: | 37 // ExtensionFunction: |
37 virtual bool RunImpl() OVERRIDE; | 38 virtual bool RunImpl() OVERRIDE; |
38 }; | 39 }; |
39 | 40 |
40 class ContentSettingsSetFunction : public SyncExtensionFunction { | 41 class ContentSettingsContentSettingSetFunction : public SyncExtensionFunction { |
41 public: | 42 public: |
42 DECLARE_EXTENSION_FUNCTION("contentSettings.set", CONTENTSETTINGS_SET) | 43 DECLARE_EXTENSION_FUNCTION("contentSettings.set", CONTENTSETTINGS_SET) |
43 | 44 |
44 protected: | 45 protected: |
45 virtual ~ContentSettingsSetFunction() {} | 46 virtual ~ContentSettingsContentSettingSetFunction() {} |
46 | 47 |
47 // ExtensionFunction: | 48 // ExtensionFunction: |
48 virtual bool RunImpl() OVERRIDE; | 49 virtual bool RunImpl() OVERRIDE; |
49 }; | 50 }; |
50 | 51 |
51 class ContentSettingsGetResourceIdentifiersFunction | 52 class ContentSettingsContentSettingGetResourceIdentifiersFunction |
52 : public AsyncExtensionFunction { | 53 : public AsyncExtensionFunction { |
53 public: | 54 public: |
54 DECLARE_EXTENSION_FUNCTION("contentSettings.getResourceIdentifiers", | 55 DECLARE_EXTENSION_FUNCTION("contentSettings.getResourceIdentifiers", |
55 CONTENTSETTINGS_GETRESOURCEIDENTIFIERS) | 56 CONTENTSETTINGS_GETRESOURCEIDENTIFIERS) |
56 | 57 |
57 protected: | 58 protected: |
58 virtual ~ContentSettingsGetResourceIdentifiersFunction() {} | 59 virtual ~ContentSettingsContentSettingGetResourceIdentifiersFunction() {} |
59 | 60 |
60 // ExtensionFunction: | 61 // ExtensionFunction: |
61 virtual bool RunImpl() OVERRIDE; | 62 virtual bool RunImpl() OVERRIDE; |
62 | 63 |
63 private: | 64 private: |
64 FRIEND_TEST_ALL_PREFIXES(ExtensionApiTest, | 65 FRIEND_TEST_ALL_PREFIXES(ExtensionApiTest, |
65 ContentSettingsGetResourceIdentifiers); | 66 ContentSettingsGetResourceIdentifiers); |
66 | 67 |
67 // Callback method that gets executed when |plugins| | 68 // Callback method that gets executed when |plugins| |
68 // are asynchronously fetched. | 69 // are asynchronously fetched. |
69 void OnGotPlugins(const std::vector<webkit::WebPluginInfo>& plugins); | 70 void OnGotPlugins(const std::vector<webkit::WebPluginInfo>& plugins); |
70 | 71 |
71 // Used to override the global plugin list in tests. | 72 // Used to override the global plugin list in tests. |
72 static void SetPluginsForTesting( | 73 static void SetPluginsForTesting( |
73 const std::vector<webkit::WebPluginInfo>* plugins); | 74 const std::vector<webkit::WebPluginInfo>* plugins); |
74 }; | 75 }; |
75 | 76 |
76 } // namespace extensions | 77 } // namespace extensions |
77 | 78 |
78 #endif // CHROME_BROWSER_EXTENSIONS_API_CONTENT_SETTINGS_CONTENT_SETTINGS_API_H
_ | 79 #endif // CHROME_BROWSER_EXTENSIONS_API_CONTENT_SETTINGS_CONTENT_SETTINGS_API_H
_ |
OLD | NEW |