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 26 matching lines...) Expand all Loading... |
37 | 37 |
38 // We implement some Pepper plug-ins using NaCl to take advantage of NaCl's | 38 // 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 | 39 // strong sandbox. Typically, these NaCl modules are stored in extensions |
40 // and registered here. Not all NaCl modules need to register for a MIME | 40 // 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 | 41 // 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 | 42 // type, like application/pdf. Note: We only register NaCl modules in the |
43 // browser process. | 43 // browser process. |
44 void RegisterNaClModule(const NaClModuleInfo& info); | 44 void RegisterNaClModule(const NaClModuleInfo& info); |
45 void UnregisterNaClModule(const NaClModuleInfo& info); | 45 void UnregisterNaClModule(const NaClModuleInfo& info); |
46 | 46 |
47 void RegisterMimeTypeHandler(const std::string& extension_id); | |
48 void UnregisterMimeTypeHandler(const std::string& extension_id); | |
49 | |
50 // Call UpdatePluginListWithNaClModules() after registering or unregistering | 47 // Call UpdatePluginListWithNaClModules() after registering or unregistering |
51 // a NaCl module to see those changes reflected in the PluginList. | 48 // a NaCl module to see those changes reflected in the PluginList. |
52 void UpdatePluginListWithNaClModules(); | 49 void UpdatePluginListWithNaClModules(); |
53 | 50 |
54 extensions::NaClModuleInfo::List::iterator FindNaClModule(const GURL& url); | 51 extensions::NaClModuleInfo::List::iterator FindNaClModule(const GURL& url); |
55 | 52 |
56 // ExtensionRegistryObserver implementation. | 53 // ExtensionRegistryObserver implementation. |
57 virtual void OnExtensionLoaded(content::BrowserContext* browser_context, | 54 virtual void OnExtensionLoaded(content::BrowserContext* browser_context, |
58 const Extension* extension) OVERRIDE; | 55 const Extension* extension) OVERRIDE; |
59 virtual void OnExtensionUnloaded( | 56 virtual void OnExtensionUnloaded( |
60 content::BrowserContext* browser_context, | 57 content::BrowserContext* browser_context, |
61 const Extension* extension, | 58 const Extension* extension, |
62 UnloadedExtensionInfo::Reason reason) OVERRIDE; | 59 UnloadedExtensionInfo::Reason reason) OVERRIDE; |
63 | 60 |
64 // BrowserContextKeyedAPI implementation. | 61 // BrowserContextKeyedAPI implementation. |
65 static const char* service_name() { return "PluginManager"; } | 62 static const char* service_name() { return "PluginManager"; } |
66 static const bool kServiceIsNULLWhileTesting = true; | 63 static const bool kServiceIsNULLWhileTesting = true; |
67 | 64 |
68 extensions::NaClModuleInfo::List nacl_module_list_; | 65 extensions::NaClModuleInfo::List nacl_module_list_; |
69 | 66 |
70 // The set of extensions that are registered as the handler for at least one | |
71 // MIME type. | |
72 std::set<std::string> mime_type_handler_extension_ids_; | |
73 | |
74 Profile* profile_; | 67 Profile* profile_; |
75 | 68 |
76 // Listen to extension load, unloaded notifications. | 69 // Listen to extension load, unloaded notifications. |
77 ScopedObserver<ExtensionRegistry, ExtensionRegistryObserver> | 70 ScopedObserver<ExtensionRegistry, ExtensionRegistryObserver> |
78 extension_registry_observer_; | 71 extension_registry_observer_; |
79 }; | 72 }; |
80 | 73 |
81 } // namespace extensions | 74 } // namespace extensions |
82 | 75 |
83 #endif // CHROME_BROWSER_EXTENSIONS_PLUGIN_MANAGER_H_ | 76 #endif // CHROME_BROWSER_EXTENSIONS_PLUGIN_MANAGER_H_ |
OLD | NEW |