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 90 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
101 virtual void RefreshPlugins() override; | 101 virtual void RefreshPlugins() override; |
102 virtual void AddExtraPluginPath(const base::FilePath& path) override; | 102 virtual void AddExtraPluginPath(const base::FilePath& path) override; |
103 virtual void RemoveExtraPluginPath(const base::FilePath& path) override; | 103 virtual void RemoveExtraPluginPath(const base::FilePath& path) override; |
104 virtual void AddExtraPluginDir(const base::FilePath& path) override; | 104 virtual void AddExtraPluginDir(const base::FilePath& path) override; |
105 virtual void RegisterInternalPlugin( | 105 virtual void RegisterInternalPlugin( |
106 const WebPluginInfo& info, bool add_at_beginning) override; | 106 const WebPluginInfo& info, bool add_at_beginning) override; |
107 virtual void UnregisterInternalPlugin(const base::FilePath& path) override; | 107 virtual void UnregisterInternalPlugin(const base::FilePath& path) override; |
108 virtual void GetInternalPlugins( | 108 virtual void GetInternalPlugins( |
109 std::vector<WebPluginInfo>* plugins) override; | 109 std::vector<WebPluginInfo>* plugins) override; |
110 virtual bool NPAPIPluginsSupported() override; | 110 virtual bool NPAPIPluginsSupported() override; |
| 111 virtual void EnableNpapiPluginsForTesting() override; |
111 virtual void DisablePluginsDiscoveryForTesting() override; | 112 virtual void DisablePluginsDiscoveryForTesting() override; |
112 #if defined(OS_MACOSX) | 113 #if defined(OS_MACOSX) |
113 virtual void AppActivated() override; | 114 virtual void AppActivated() override; |
114 #elif defined(OS_WIN) | 115 #elif defined(OS_WIN) |
115 virtual bool GetPluginInfoFromWindow(HWND window, | 116 virtual bool GetPluginInfoFromWindow(HWND window, |
116 base::string16* plugin_name, | 117 base::string16* plugin_name, |
117 base::string16* plugin_version) override; | 118 base::string16* plugin_version) override; |
118 | 119 |
119 // Returns true iff the given HWND is a plugin. | 120 // Returns true iff the given HWND is a plugin. |
120 bool IsPluginWindow(HWND window); | 121 bool IsPluginWindow(HWND window); |
(...skipping 100 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
221 static void RegisterFilePathWatcher(base::FilePathWatcher* watcher, | 222 static void RegisterFilePathWatcher(base::FilePathWatcher* watcher, |
222 const base::FilePath& path); | 223 const base::FilePath& path); |
223 #endif | 224 #endif |
224 | 225 |
225 #if defined(OS_WIN) | 226 #if defined(OS_WIN) |
226 // Registry keys for getting notifications when new plugins are installed. | 227 // Registry keys for getting notifications when new plugins are installed. |
227 base::win::RegKey hkcu_key_; | 228 base::win::RegKey hkcu_key_; |
228 base::win::RegKey hklm_key_; | 229 base::win::RegKey hklm_key_; |
229 #endif | 230 #endif |
230 | 231 |
| 232 bool npapi_plugins_enabled_; |
| 233 |
231 #if defined(OS_POSIX) && !defined(OS_OPENBSD) && !defined(OS_ANDROID) | 234 #if defined(OS_POSIX) && !defined(OS_OPENBSD) && !defined(OS_ANDROID) |
232 ScopedVector<base::FilePathWatcher> file_watchers_; | 235 ScopedVector<base::FilePathWatcher> file_watchers_; |
233 #endif | 236 #endif |
234 | 237 |
235 std::vector<PepperPluginInfo> ppapi_plugins_; | 238 std::vector<PepperPluginInfo> ppapi_plugins_; |
236 | 239 |
237 // Weak pointer; outlives us. | 240 // Weak pointer; outlives us. |
238 PluginServiceFilter* filter_; | 241 PluginServiceFilter* filter_; |
239 | 242 |
240 std::set<PluginProcessHost::Client*> pending_plugin_clients_; | 243 std::set<PluginProcessHost::Client*> pending_plugin_clients_; |
241 | 244 |
242 // Used to sequentialize loading plug-ins from disk. | 245 // Used to sequentialize loading plug-ins from disk. |
243 base::SequencedWorkerPool::SequenceToken plugin_list_token_; | 246 base::SequencedWorkerPool::SequenceToken plugin_list_token_; |
244 | 247 |
245 #if defined(OS_POSIX) | 248 #if defined(OS_POSIX) |
246 scoped_refptr<PluginLoaderPosix> plugin_loader_; | 249 scoped_refptr<PluginLoaderPosix> plugin_loader_; |
247 #endif | 250 #endif |
248 | 251 |
249 // Used to detect if a given plug-in is crashing over and over. | 252 // Used to detect if a given plug-in is crashing over and over. |
250 std::map<base::FilePath, std::vector<base::Time> > crash_times_; | 253 std::map<base::FilePath, std::vector<base::Time> > crash_times_; |
251 | 254 |
252 DISALLOW_COPY_AND_ASSIGN(PluginServiceImpl); | 255 DISALLOW_COPY_AND_ASSIGN(PluginServiceImpl); |
253 }; | 256 }; |
254 | 257 |
255 } // namespace content | 258 } // namespace content |
256 | 259 |
257 #endif // CONTENT_BROWSER_PLUGIN_SERVICE_IMPL_H_ | 260 #endif // CONTENT_BROWSER_PLUGIN_SERVICE_IMPL_H_ |
OLD | NEW |