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