OLD | NEW |
1 // Copyright 2013 The Chromium Authors. All rights reserved. | 1 // Copyright 2013 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_PLUGIN_MANAGER_H_ | 5 #ifndef CHROME_BROWSER_EXTENSIONS_PLUGIN_MANAGER_H_ |
6 #define CHROME_BROWSER_EXTENSIONS_PLUGIN_MANAGER_H_ | 6 #define CHROME_BROWSER_EXTENSIONS_PLUGIN_MANAGER_H_ |
7 | 7 |
8 #include <set> | 8 #include <set> |
9 #include <string> | 9 #include <string> |
10 | 10 |
(...skipping 17 matching lines...) Expand all Loading... |
28 public: | 28 public: |
29 explicit PluginManager(content::BrowserContext* context); | 29 explicit PluginManager(content::BrowserContext* context); |
30 virtual ~PluginManager(); | 30 virtual ~PluginManager(); |
31 | 31 |
32 // BrowserContextKeyedAPI implementation. | 32 // BrowserContextKeyedAPI implementation. |
33 static BrowserContextKeyedAPIFactory<PluginManager>* GetFactoryInstance(); | 33 static BrowserContextKeyedAPIFactory<PluginManager>* GetFactoryInstance(); |
34 | 34 |
35 private: | 35 private: |
36 friend class BrowserContextKeyedAPIFactory<PluginManager>; | 36 friend class BrowserContextKeyedAPIFactory<PluginManager>; |
37 | 37 |
| 38 #if !defined(DISABLE_NACL) |
| 39 |
38 // We implement some Pepper plug-ins using NaCl to take advantage of NaCl's | 40 // We implement some Pepper plug-ins using NaCl to take advantage of NaCl's |
39 // strong sandbox. Typically, these NaCl modules are stored in extensions | 41 // strong sandbox. Typically, these NaCl modules are stored in extensions |
40 // and registered here. Not all NaCl modules need to register for a MIME | 42 // and registered here. Not all NaCl modules need to register for a MIME |
41 // type, just the ones that are responsible for rendering a particular MIME | 43 // type, just the ones that are responsible for rendering a particular MIME |
42 // type, like application/pdf. Note: We only register NaCl modules in the | 44 // type, like application/pdf. Note: We only register NaCl modules in the |
43 // browser process. | 45 // browser process. |
44 void RegisterNaClModule(const NaClModuleInfo& info); | 46 void RegisterNaClModule(const NaClModuleInfo& info); |
45 void UnregisterNaClModule(const NaClModuleInfo& info); | 47 void UnregisterNaClModule(const NaClModuleInfo& info); |
46 | 48 |
47 // Call UpdatePluginListWithNaClModules() after registering or unregistering | 49 // Call UpdatePluginListWithNaClModules() after registering or unregistering |
48 // a NaCl module to see those changes reflected in the PluginList. | 50 // a NaCl module to see those changes reflected in the PluginList. |
49 void UpdatePluginListWithNaClModules(); | 51 void UpdatePluginListWithNaClModules(); |
50 | 52 |
51 extensions::NaClModuleInfo::List::iterator FindNaClModule(const GURL& url); | 53 extensions::NaClModuleInfo::List::iterator FindNaClModule(const GURL& url); |
52 | 54 |
| 55 #endif // !defined(DISABLE_NACL) |
| 56 |
53 // ExtensionRegistryObserver implementation. | 57 // ExtensionRegistryObserver implementation. |
54 virtual void OnExtensionLoaded(content::BrowserContext* browser_context, | 58 virtual void OnExtensionLoaded(content::BrowserContext* browser_context, |
55 const Extension* extension) OVERRIDE; | 59 const Extension* extension) OVERRIDE; |
56 virtual void OnExtensionUnloaded( | 60 virtual void OnExtensionUnloaded( |
57 content::BrowserContext* browser_context, | 61 content::BrowserContext* browser_context, |
58 const Extension* extension, | 62 const Extension* extension, |
59 UnloadedExtensionInfo::Reason reason) OVERRIDE; | 63 UnloadedExtensionInfo::Reason reason) OVERRIDE; |
60 | 64 |
61 // BrowserContextKeyedAPI implementation. | 65 // BrowserContextKeyedAPI implementation. |
62 static const char* service_name() { return "PluginManager"; } | 66 static const char* service_name() { return "PluginManager"; } |
63 static const bool kServiceIsNULLWhileTesting = true; | 67 static const bool kServiceIsNULLWhileTesting = true; |
64 | 68 |
65 extensions::NaClModuleInfo::List nacl_module_list_; | 69 extensions::NaClModuleInfo::List nacl_module_list_; |
66 | 70 |
67 Profile* profile_; | 71 Profile* profile_; |
68 | 72 |
69 // Listen to extension load, unloaded notifications. | 73 // Listen to extension load, unloaded notifications. |
70 ScopedObserver<ExtensionRegistry, ExtensionRegistryObserver> | 74 ScopedObserver<ExtensionRegistry, ExtensionRegistryObserver> |
71 extension_registry_observer_; | 75 extension_registry_observer_; |
72 }; | 76 }; |
73 | 77 |
74 } // namespace extensions | 78 } // namespace extensions |
75 | 79 |
76 #endif // CHROME_BROWSER_EXTENSIONS_PLUGIN_MANAGER_H_ | 80 #endif // CHROME_BROWSER_EXTENSIONS_PLUGIN_MANAGER_H_ |
OLD | NEW |