OLD | NEW |
1 // Copyright (c) 2010 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2010 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_COMMON_PEPPER_PLUGIN_REGISTRY_H_ | 5 #ifndef CHROME_COMMON_PEPPER_PLUGIN_REGISTRY_H_ |
6 #define CHROME_COMMON_PEPPER_PLUGIN_REGISTRY_H_ | 6 #define CHROME_COMMON_PEPPER_PLUGIN_REGISTRY_H_ |
7 | 7 |
8 #include <string> | 8 #include <string> |
9 #include <map> | 9 #include <map> |
| 10 #include <vector> |
10 | 11 |
11 #include "webkit/glue/plugins/pepper_plugin_module.h" | 12 #include "webkit/glue/plugins/pepper_plugin_module.h" |
12 | 13 |
13 struct PepperPluginInfo { | 14 struct PepperPluginInfo { |
14 FilePath path; | 15 FilePath path; // Internal plugins are of the form "internal-[name]". |
15 std::vector<std::string> mime_types; | 16 std::vector<std::string> mime_types; |
16 }; | 17 }; |
17 | 18 |
18 // This class holds references to all of the known pepper plugin modules. | 19 // This class holds references to all of the known pepper plugin modules. |
19 class PepperPluginRegistry { | 20 class PepperPluginRegistry { |
20 public: | 21 public: |
21 static PepperPluginRegistry* GetInstance(); | 22 static PepperPluginRegistry* GetInstance(); |
22 | 23 |
23 // Returns the list of known pepper plugins. This method is static so that | 24 // Returns the list of known pepper plugins. This method is static so that |
24 // it can be used by the browser process, which has no need to load the | 25 // it can be used by the browser process, which has no need to load the |
25 // pepper plugin modules. | 26 // pepper plugin modules. |
26 static void GetList(std::vector<PepperPluginInfo>* plugins); | 27 static void GetList(std::vector<PepperPluginInfo>* plugins); |
27 | 28 |
28 pepper::PluginModule* GetModule(const FilePath& path) const; | 29 pepper::PluginModule* GetModule(const FilePath& path) const; |
29 | 30 |
30 private: | 31 private: |
| 32 static void GetPluginInfoFromSwitch(std::vector<PepperPluginInfo>* plugins); |
| 33 |
| 34 struct InternalPluginInfo : public PepperPluginInfo { |
| 35 pepper::PluginModule::EntryPoints entry_points; |
| 36 }; |
| 37 typedef std::vector<InternalPluginInfo> InternalPluginInfoList; |
| 38 static void GetInternalPluginInfo(InternalPluginInfoList* plugin_info); |
| 39 |
31 PepperPluginRegistry(); | 40 PepperPluginRegistry(); |
32 | 41 |
33 typedef scoped_refptr<pepper::PluginModule> ModuleHandle; | 42 typedef scoped_refptr<pepper::PluginModule> ModuleHandle; |
34 typedef std::map<FilePath, ModuleHandle> ModuleMap; | 43 typedef std::map<FilePath, ModuleHandle> ModuleMap; |
35 ModuleMap modules_; | 44 ModuleMap modules_; |
36 }; | 45 }; |
37 | 46 |
38 #endif // CHROME_COMMON_PEPPER_PLUGIN_REGISTRY_H_ | 47 #endif // CHROME_COMMON_PEPPER_PLUGIN_REGISTRY_H_ |
OLD | NEW |