| OLD | NEW |
| (Empty) |
| 1 // Copyright (c) 2013 The Chromium Authors. All rights reserved. | |
| 2 // Use of this source code is governed by a BSD-style license that can be | |
| 3 // found in the LICENSE file. | |
| 4 | |
| 5 #ifndef CHROME_COMMON_EXTENSIONS_API_PLUGINS_PLUGINS_HANDLER_H_ | |
| 6 #define CHROME_COMMON_EXTENSIONS_API_PLUGINS_PLUGINS_HANDLER_H_ | |
| 7 | |
| 8 #include <memory> | |
| 9 #include <string> | |
| 10 | |
| 11 #include "base/macros.h" | |
| 12 #include "extensions/common/extension.h" | |
| 13 #include "extensions/common/manifest_handler.h" | |
| 14 | |
| 15 namespace extensions { | |
| 16 | |
| 17 // An NPAPI plugin included in the extension. | |
| 18 struct PluginInfo { | |
| 19 typedef std::vector<PluginInfo> PluginVector; | |
| 20 | |
| 21 PluginInfo(const base::FilePath& plugin_path, bool plugin_is_public); | |
| 22 ~PluginInfo(); | |
| 23 | |
| 24 base::FilePath path; // Path to the plugin. | |
| 25 bool is_public; // False if only this extension can load this plugin. | |
| 26 | |
| 27 // Return the plugins for a given |extensions|, or NULL if none exist. | |
| 28 static const PluginVector* GetPlugins(const Extension* extension); | |
| 29 | |
| 30 // Return true if the given |extension| has plugins, and false otherwise. | |
| 31 static bool HasPlugins(const Extension* extension); | |
| 32 }; | |
| 33 | |
| 34 // Parses the "plugins" manifest key. | |
| 35 class PluginsHandler : public ManifestHandler { | |
| 36 public: | |
| 37 PluginsHandler(); | |
| 38 ~PluginsHandler() override; | |
| 39 | |
| 40 bool Parse(Extension* extension, base::string16* error) override; | |
| 41 bool Validate(const Extension* extension, | |
| 42 std::string* error, | |
| 43 std::vector<InstallWarning>* warnings) const override; | |
| 44 | |
| 45 private: | |
| 46 const std::vector<std::string> Keys() const override; | |
| 47 | |
| 48 DISALLOW_COPY_AND_ASSIGN(PluginsHandler); | |
| 49 }; | |
| 50 | |
| 51 } // namespace extensions | |
| 52 | |
| 53 #endif // CHROME_COMMON_EXTENSIONS_API_PLUGINS_PLUGINS_HANDLER_H_ | |
| OLD | NEW |