Enable Enterprise enrollment on desktop builds.
[chromium-blink-merge.git] / chrome / common / extensions / api / plugins / plugins_handler.h
blob8b7ed3bcc6fb23299cd79605c9c21fcc7bc2fc1f
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.
5 #ifndef CHROME_COMMON_EXTENSIONS_API_PLUGINS_PLUGINS_HANDLER_H_
6 #define CHROME_COMMON_EXTENSIONS_API_PLUGINS_PLUGINS_HANDLER_H_
8 #include <string>
10 #include "base/memory/scoped_ptr.h"
11 #include "extensions/common/extension.h"
12 #include "extensions/common/manifest_handler.h"
14 namespace extensions {
16 // An NPAPI plugin included in the extension.
17 struct PluginInfo {
18 typedef std::vector<PluginInfo> PluginVector;
20 PluginInfo(const base::FilePath& plugin_path, bool plugin_is_public);
21 ~PluginInfo();
23 base::FilePath path; // Path to the plugin.
24 bool is_public; // False if only this extension can load this plugin.
26 // Return the plugins for a given |extensions|, or NULL if none exist.
27 static const PluginVector* GetPlugins(const Extension* extension);
29 // Return true if the given |extension| has plugins, and false otherwise.
30 static bool HasPlugins(const Extension* extension);
33 // Parses the "plugins" manifest key.
34 class PluginsHandler : public ManifestHandler {
35 public:
36 PluginsHandler();
37 virtual ~PluginsHandler();
39 virtual bool Parse(Extension* extension, base::string16* error) OVERRIDE;
40 virtual bool Validate(const Extension* extension,
41 std::string* error,
42 std::vector<InstallWarning>* warnings) const OVERRIDE;
44 private:
45 virtual const std::vector<std::string> Keys() const OVERRIDE;
47 DISALLOW_COPY_AND_ASSIGN(PluginsHandler);
50 } // namespace extensions
52 #endif // CHROME_COMMON_EXTENSIONS_API_PLUGINS_PLUGINS_HANDLER_H_