OLD | NEW |
1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2012 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 // This class responds to requests from renderers for the list of plugins, and | 5 // This class responds to requests from renderers for the list of plugins, and |
6 // also a proxy object for plugin instances. | 6 // also a proxy object for plugin instances. |
7 | 7 |
8 #ifndef CONTENT_BROWSER_PLUGIN_SERVICE_IMPL_H_ | 8 #ifndef CONTENT_BROWSER_PLUGIN_SERVICE_IMPL_H_ |
9 #define CONTENT_BROWSER_PLUGIN_SERVICE_IMPL_H_ | 9 #define CONTENT_BROWSER_PLUGIN_SERVICE_IMPL_H_ |
10 | 10 |
(...skipping 83 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
94 const base::FilePath& path) OVERRIDE; | 94 const base::FilePath& path) OVERRIDE; |
95 virtual void GetPlugins(const GetPluginsCallback& callback) OVERRIDE; | 95 virtual void GetPlugins(const GetPluginsCallback& callback) OVERRIDE; |
96 virtual PepperPluginInfo* GetRegisteredPpapiPluginInfo( | 96 virtual PepperPluginInfo* GetRegisteredPpapiPluginInfo( |
97 const base::FilePath& plugin_path) OVERRIDE; | 97 const base::FilePath& plugin_path) OVERRIDE; |
98 virtual void SetFilter(PluginServiceFilter* filter) OVERRIDE; | 98 virtual void SetFilter(PluginServiceFilter* filter) OVERRIDE; |
99 virtual PluginServiceFilter* GetFilter() OVERRIDE; | 99 virtual PluginServiceFilter* GetFilter() OVERRIDE; |
100 virtual void ForcePluginShutdown(const base::FilePath& plugin_path) OVERRIDE; | 100 virtual void ForcePluginShutdown(const base::FilePath& plugin_path) OVERRIDE; |
101 virtual bool IsPluginUnstable(const base::FilePath& plugin_path) OVERRIDE; | 101 virtual bool IsPluginUnstable(const base::FilePath& plugin_path) OVERRIDE; |
102 virtual void RefreshPlugins() OVERRIDE; | 102 virtual void RefreshPlugins() OVERRIDE; |
103 virtual void AddExtraPluginPath(const base::FilePath& path) OVERRIDE; | 103 virtual void AddExtraPluginPath(const base::FilePath& path) OVERRIDE; |
| 104 virtual void RemoveExtraPluginPath(const base::FilePath& path) OVERRIDE; |
104 virtual void AddExtraPluginDir(const base::FilePath& path) OVERRIDE; | 105 virtual void AddExtraPluginDir(const base::FilePath& path) OVERRIDE; |
105 virtual void RemoveExtraPluginPath(const base::FilePath& path) OVERRIDE; | |
106 virtual void UnregisterInternalPlugin(const base::FilePath& path) OVERRIDE; | |
107 virtual void RegisterInternalPlugin( | 106 virtual void RegisterInternalPlugin( |
108 const webkit::WebPluginInfo& info, bool add_at_beginning) OVERRIDE; | 107 const webkit::WebPluginInfo& info, bool add_at_beginning) OVERRIDE; |
| 108 virtual void UnregisterInternalPlugin(const base::FilePath& path) OVERRIDE; |
109 virtual void GetInternalPlugins( | 109 virtual void GetInternalPlugins( |
110 std::vector<webkit::WebPluginInfo>* plugins) OVERRIDE; | 110 std::vector<webkit::WebPluginInfo>* plugins) OVERRIDE; |
111 virtual void SetPluginListForTesting( | 111 virtual void DisablePluginsDiscoveryForTesting() OVERRIDE; |
112 webkit::npapi::PluginList* plugin_list) OVERRIDE; | |
113 #if defined(OS_MACOSX) | 112 #if defined(OS_MACOSX) |
114 virtual void AppActivated() OVERRIDE; | 113 virtual void AppActivated() OVERRIDE; |
115 #endif | 114 #endif |
116 | 115 |
117 // Returns the plugin process host corresponding to the plugin process that | 116 // Returns the plugin process host corresponding to the plugin process that |
118 // has been started by this service. This will start a process to host the | 117 // has been started by this service. This will start a process to host the |
119 // 'plugin_path' if needed. If the process fails to start, the return value | 118 // 'plugin_path' if needed. If the process fails to start, the return value |
120 // is NULL. Must be called on the IO thread. | 119 // is NULL. Must be called on the IO thread. |
121 PluginProcessHost* FindOrStartNpapiPluginProcess( | 120 PluginProcessHost* FindOrStartNpapiPluginProcess( |
122 int render_process_id, const base::FilePath& plugin_path); | 121 int render_process_id, const base::FilePath& plugin_path); |
(...skipping 77 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
200 void FinishOpenChannelToPlugin(int render_process_id, | 199 void FinishOpenChannelToPlugin(int render_process_id, |
201 const base::FilePath& plugin_path, | 200 const base::FilePath& plugin_path, |
202 PluginProcessHost::Client* client); | 201 PluginProcessHost::Client* client); |
203 | 202 |
204 #if defined(OS_POSIX) && !defined(OS_OPENBSD) && !defined(OS_ANDROID) | 203 #if defined(OS_POSIX) && !defined(OS_OPENBSD) && !defined(OS_ANDROID) |
205 // Registers a new FilePathWatcher for a given path. | 204 // Registers a new FilePathWatcher for a given path. |
206 static void RegisterFilePathWatcher(base::FilePathWatcher* watcher, | 205 static void RegisterFilePathWatcher(base::FilePathWatcher* watcher, |
207 const base::FilePath& path); | 206 const base::FilePath& path); |
208 #endif | 207 #endif |
209 | 208 |
210 // The plugin list instance. | |
211 webkit::npapi::PluginList* plugin_list_; | |
212 | |
213 #if defined(OS_WIN) | 209 #if defined(OS_WIN) |
214 // Registry keys for getting notifications when new plugins are installed. | 210 // Registry keys for getting notifications when new plugins are installed. |
215 base::win::RegKey hkcu_key_; | 211 base::win::RegKey hkcu_key_; |
216 base::win::RegKey hklm_key_; | 212 base::win::RegKey hklm_key_; |
217 scoped_ptr<base::WaitableEvent> hkcu_event_; | 213 scoped_ptr<base::WaitableEvent> hkcu_event_; |
218 scoped_ptr<base::WaitableEvent> hklm_event_; | 214 scoped_ptr<base::WaitableEvent> hklm_event_; |
219 base::WaitableEventWatcher hkcu_watcher_; | 215 base::WaitableEventWatcher hkcu_watcher_; |
220 base::WaitableEventWatcher hklm_watcher_; | 216 base::WaitableEventWatcher hklm_watcher_; |
221 #endif | 217 #endif |
222 | 218 |
(...skipping 17 matching lines...) Expand all Loading... |
240 | 236 |
241 // Used to detect if a given plug-in is crashing over and over. | 237 // Used to detect if a given plug-in is crashing over and over. |
242 std::map<base::FilePath, std::vector<base::Time> > crash_times_; | 238 std::map<base::FilePath, std::vector<base::Time> > crash_times_; |
243 | 239 |
244 DISALLOW_COPY_AND_ASSIGN(PluginServiceImpl); | 240 DISALLOW_COPY_AND_ASSIGN(PluginServiceImpl); |
245 }; | 241 }; |
246 | 242 |
247 } // namespace content | 243 } // namespace content |
248 | 244 |
249 #endif // CONTENT_BROWSER_PLUGIN_SERVICE_IMPL_H_ | 245 #endif // CONTENT_BROWSER_PLUGIN_SERVICE_IMPL_H_ |
OLD | NEW |