| 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 ClearContentSettingsFunction : public SyncExtensionFunction { | 18 class ContentSettingsClearFunction : public SyncExtensionFunction { |
| 19 public: | 19 public: |
| 20 DECLARE_EXTENSION_FUNCTION_NAME("contentSettings.clear") | 20 DECLARE_EXTENSION_FUNCTION_NAME("contentSettings.clear") |
| 21 | 21 |
| 22 protected: | 22 protected: |
| 23 virtual ~ClearContentSettingsFunction() {} | 23 virtual ~ContentSettingsClearFunction() {} |
| 24 | 24 |
| 25 // ExtensionFunction: | 25 // ExtensionFunction: |
| 26 virtual bool RunImpl() OVERRIDE; | 26 virtual bool RunImpl() OVERRIDE; |
| 27 }; | 27 }; |
| 28 | 28 |
| 29 class GetContentSettingFunction : public SyncExtensionFunction { | 29 class ContentSettingsGetFunction : public SyncExtensionFunction { |
| 30 public: | 30 public: |
| 31 DECLARE_EXTENSION_FUNCTION_NAME("contentSettings.get") | 31 DECLARE_EXTENSION_FUNCTION_NAME("contentSettings.get") |
| 32 | 32 |
| 33 protected: | 33 protected: |
| 34 virtual ~GetContentSettingFunction() {} | 34 virtual ~ContentSettingsGetFunction() {} |
| 35 | 35 |
| 36 // ExtensionFunction: | 36 // ExtensionFunction: |
| 37 virtual bool RunImpl() OVERRIDE; | 37 virtual bool RunImpl() OVERRIDE; |
| 38 }; | 38 }; |
| 39 | 39 |
| 40 class SetContentSettingFunction : public SyncExtensionFunction { | 40 class ContentSettingsSetFunction : public SyncExtensionFunction { |
| 41 public: | 41 public: |
| 42 DECLARE_EXTENSION_FUNCTION_NAME("contentSettings.set") | 42 DECLARE_EXTENSION_FUNCTION_NAME("contentSettings.set") |
| 43 | 43 |
| 44 protected: | 44 protected: |
| 45 virtual ~SetContentSettingFunction() {} | 45 virtual ~ContentSettingsSetFunction() {} |
| 46 | 46 |
| 47 // ExtensionFunction: | 47 // ExtensionFunction: |
| 48 virtual bool RunImpl() OVERRIDE; | 48 virtual bool RunImpl() OVERRIDE; |
| 49 }; | 49 }; |
| 50 | 50 |
| 51 class GetResourceIdentifiersFunction : public AsyncExtensionFunction { | 51 class ContentSettingsGetResourceIdentifiersFunction |
| 52 : public AsyncExtensionFunction { |
| 52 public: | 53 public: |
| 53 DECLARE_EXTENSION_FUNCTION_NAME("contentSettings.getResourceIdentifiers") | 54 DECLARE_EXTENSION_FUNCTION_NAME("contentSettings.getResourceIdentifiers") |
| 54 | 55 |
| 55 protected: | 56 protected: |
| 56 virtual ~GetResourceIdentifiersFunction() {} | 57 virtual ~ContentSettingsGetResourceIdentifiersFunction() {} |
| 57 | 58 |
| 58 // ExtensionFunction: | 59 // ExtensionFunction: |
| 59 virtual bool RunImpl() OVERRIDE; | 60 virtual bool RunImpl() OVERRIDE; |
| 60 | 61 |
| 61 private: | 62 private: |
| 62 FRIEND_TEST_ALL_PREFIXES(ExtensionApiTest, | 63 FRIEND_TEST_ALL_PREFIXES(ExtensionApiTest, |
| 63 ContentSettingsGetResourceIdentifiers); | 64 ContentSettingsGetResourceIdentifiers); |
| 64 | 65 |
| 65 // Callback method that gets executed when |plugins| | 66 // Callback method that gets executed when |plugins| |
| 66 // are asynchronously fetched. | 67 // are asynchronously fetched. |
| 67 void OnGotPlugins(const std::vector<webkit::WebPluginInfo>& plugins); | 68 void OnGotPlugins(const std::vector<webkit::WebPluginInfo>& plugins); |
| 68 | 69 |
| 69 // Used to override the global plugin list in tests. | 70 // Used to override the global plugin list in tests. |
| 70 static void SetPluginsForTesting( | 71 static void SetPluginsForTesting( |
| 71 const std::vector<webkit::WebPluginInfo>* plugins); | 72 const std::vector<webkit::WebPluginInfo>* plugins); |
| 72 }; | 73 }; |
| 73 | 74 |
| 74 } // namespace extensions | 75 } // namespace extensions |
| 75 | 76 |
| 76 #endif // CHROME_BROWSER_EXTENSIONS_API_CONTENT_SETTINGS_CONTENT_SETTINGS_API_H
__ | 77 #endif // CHROME_BROWSER_EXTENSIONS_API_CONTENT_SETTINGS_CONTENT_SETTINGS_API_H
_ |
| OLD | NEW |