OLD | NEW |
1 // Copyright (c) 2010 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2010 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 #include "build/build_config.h" | 5 #include "build/build_config.h" |
6 | 6 |
7 #include "chrome/browser/plugin_service.h" | 7 #include "chrome/browser/plugin_service.h" |
8 | 8 |
9 #include "base/command_line.h" | 9 #include "base/command_line.h" |
10 #include "base/path_service.h" | 10 #include "base/path_service.h" |
(...skipping 16 matching lines...) Expand all Loading... |
27 #include "chrome/common/default_plugin.h" | 27 #include "chrome/common/default_plugin.h" |
28 #include "chrome/common/extensions/extension.h" | 28 #include "chrome/common/extensions/extension.h" |
29 #include "chrome/common/gpu_plugin.h" | 29 #include "chrome/common/gpu_plugin.h" |
30 #include "chrome/common/logging_chrome.h" | 30 #include "chrome/common/logging_chrome.h" |
31 #include "chrome/common/notification_type.h" | 31 #include "chrome/common/notification_type.h" |
32 #include "chrome/common/notification_service.h" | 32 #include "chrome/common/notification_service.h" |
33 #include "chrome/common/pepper_plugin_registry.h" | 33 #include "chrome/common/pepper_plugin_registry.h" |
34 #include "chrome/common/plugin_messages.h" | 34 #include "chrome/common/plugin_messages.h" |
35 #include "chrome/common/pref_names.h" | 35 #include "chrome/common/pref_names.h" |
36 #include "chrome/common/render_messages.h" | 36 #include "chrome/common/render_messages.h" |
| 37 #include "webkit/plugins/npapi/plugin_constants_win.h" |
| 38 #include "webkit/plugins/npapi/plugin_list.h" |
| 39 #include "webkit/plugins/npapi/webplugininfo.h" |
| 40 |
37 #ifndef DISABLE_NACL | 41 #ifndef DISABLE_NACL |
38 #include "native_client/src/trusted/plugin/nacl_entry_points.h" | 42 #include "native_client/src/trusted/plugin/nacl_entry_points.h" |
39 #endif | 43 #endif |
40 #include "webkit/glue/plugins/plugin_constants_win.h" | |
41 #include "webkit/glue/plugins/plugin_list.h" | |
42 #include "webkit/glue/plugins/webplugininfo.h" | |
43 | 44 |
44 #if defined(OS_CHROMEOS) | 45 #if defined(OS_CHROMEOS) |
45 #include "chrome/browser/chromeos/plugin_selection_policy.h" | 46 #include "chrome/browser/chromeos/plugin_selection_policy.h" |
46 #endif | 47 #endif |
47 | 48 |
48 #if defined(OS_MACOSX) | 49 #if defined(OS_MACOSX) |
49 static void NotifyPluginsOfActivation() { | 50 static void NotifyPluginsOfActivation() { |
50 DCHECK(BrowserThread::CurrentlyOn(BrowserThread::IO)); | 51 DCHECK(BrowserThread::CurrentlyOn(BrowserThread::IO)); |
51 | 52 |
52 for (BrowserChildProcessHost::Iterator iter(ChildProcessInfo::PLUGIN_PROCESS); | 53 for (BrowserChildProcessHost::Iterator iter(ChildProcessInfo::PLUGIN_PROCESS); |
(...skipping 34 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
87 ui_locale_(g_browser_process->GetApplicationLocale()) { | 88 ui_locale_(g_browser_process->GetApplicationLocale()) { |
88 RegisterPepperPlugins(); | 89 RegisterPepperPlugins(); |
89 | 90 |
90 // Have the NPAPI plugin list search for Chrome plugins as well. | 91 // Have the NPAPI plugin list search for Chrome plugins as well. |
91 ChromePluginLib::RegisterPluginsWithNPAPI(); | 92 ChromePluginLib::RegisterPluginsWithNPAPI(); |
92 | 93 |
93 // Load any specified on the command line as well. | 94 // Load any specified on the command line as well. |
94 const CommandLine* command_line = CommandLine::ForCurrentProcess(); | 95 const CommandLine* command_line = CommandLine::ForCurrentProcess(); |
95 FilePath path = command_line->GetSwitchValuePath(switches::kLoadPlugin); | 96 FilePath path = command_line->GetSwitchValuePath(switches::kLoadPlugin); |
96 if (!path.empty()) | 97 if (!path.empty()) |
97 NPAPI::PluginList::Singleton()->AddExtraPluginPath(path); | 98 webkit::npapi::PluginList::Singleton()->AddExtraPluginPath(path); |
98 path = command_line->GetSwitchValuePath(switches::kExtraPluginDir); | 99 path = command_line->GetSwitchValuePath(switches::kExtraPluginDir); |
99 if (!path.empty()) | 100 if (!path.empty()) |
100 NPAPI::PluginList::Singleton()->AddExtraPluginDir(path); | 101 webkit::npapi::PluginList::Singleton()->AddExtraPluginDir(path); |
101 | 102 |
102 chrome::RegisterInternalDefaultPlugin(); | 103 chrome::RegisterInternalDefaultPlugin(); |
103 | 104 |
104 // Register the internal Flash and PDF, if available. | 105 // Register the internal Flash and PDF, if available. |
105 if (!CommandLine::ForCurrentProcess()->HasSwitch( | 106 if (!CommandLine::ForCurrentProcess()->HasSwitch( |
106 switches::kDisableInternalFlash) && | 107 switches::kDisableInternalFlash) && |
107 PathService::Get(chrome::FILE_FLASH_PLUGIN, &path)) { | 108 PathService::Get(chrome::FILE_FLASH_PLUGIN, &path)) { |
108 NPAPI::PluginList::Singleton()->AddExtraPluginPath(path); | 109 webkit::npapi::PluginList::Singleton()->AddExtraPluginPath(path); |
109 } | 110 } |
110 | 111 |
111 #ifndef DISABLE_NACL | 112 #ifndef DISABLE_NACL |
112 if (command_line->HasSwitch(switches::kInternalNaCl)) { | 113 if (command_line->HasSwitch(switches::kInternalNaCl)) { |
113 RegisterInternalNaClPlugin(); | 114 RegisterInternalNaClPlugin(); |
114 } | 115 } |
115 #endif | 116 #endif |
116 | 117 |
117 #if defined(OS_CHROMEOS) | 118 #if defined(OS_CHROMEOS) |
118 plugin_selection_policy_ = new chromeos::PluginSelectionPolicy; | 119 plugin_selection_policy_ = new chromeos::PluginSelectionPolicy; |
119 plugin_selection_policy_->StartInit(); | 120 plugin_selection_policy_->StartInit(); |
120 #endif | 121 #endif |
121 | 122 |
122 chrome::RegisterInternalGPUPlugin(); | 123 chrome::RegisterInternalGPUPlugin(); |
123 | 124 |
124 #if defined(OS_WIN) | 125 #if defined(OS_WIN) |
125 hkcu_key_.Create( | 126 hkcu_key_.Create( |
126 HKEY_CURRENT_USER, kRegistryMozillaPlugins, KEY_NOTIFY); | 127 HKEY_CURRENT_USER, webkit::npapi::kRegistryMozillaPlugins, KEY_NOTIFY); |
127 hklm_key_.Create( | 128 hklm_key_.Create( |
128 HKEY_LOCAL_MACHINE, kRegistryMozillaPlugins, KEY_NOTIFY); | 129 HKEY_LOCAL_MACHINE, webkit::npapi::kRegistryMozillaPlugins, KEY_NOTIFY); |
129 if (hkcu_key_.StartWatching()) { | 130 if (hkcu_key_.StartWatching()) { |
130 hkcu_event_.reset(new base::WaitableEvent(hkcu_key_.watch_event())); | 131 hkcu_event_.reset(new base::WaitableEvent(hkcu_key_.watch_event())); |
131 hkcu_watcher_.StartWatching(hkcu_event_.get(), this); | 132 hkcu_watcher_.StartWatching(hkcu_event_.get(), this); |
132 } | 133 } |
133 | 134 |
134 if (hklm_key_.StartWatching()) { | 135 if (hklm_key_.StartWatching()) { |
135 hklm_event_.reset(new base::WaitableEvent(hklm_key_.watch_event())); | 136 hklm_event_.reset(new base::WaitableEvent(hklm_key_.watch_event())); |
136 hklm_watcher_.StartWatching(hklm_event_.get(), this); | 137 hklm_watcher_.StartWatching(hklm_event_.get(), this); |
137 } | 138 } |
138 #elif defined(OS_POSIX) && !defined(OS_MACOSX) | 139 #elif defined(OS_POSIX) && !defined(OS_MACOSX) |
139 // Also find plugins in a user-specific plugins dir, | 140 // Also find plugins in a user-specific plugins dir, |
140 // e.g. ~/.config/chromium/Plugins. | 141 // e.g. ~/.config/chromium/Plugins. |
141 FilePath user_data_dir; | 142 FilePath user_data_dir; |
142 if (PathService::Get(chrome::DIR_USER_DATA, &user_data_dir)) { | 143 if (PathService::Get(chrome::DIR_USER_DATA, &user_data_dir)) { |
143 NPAPI::PluginList::Singleton()->AddExtraPluginDir( | 144 webkit::npapi::PluginList::Singleton()->AddExtraPluginDir( |
144 user_data_dir.Append("Plugins")); | 145 user_data_dir.Append("Plugins")); |
145 } | 146 } |
146 #endif | 147 #endif |
147 | 148 |
148 registrar_.Add(this, NotificationType::EXTENSION_LOADED, | 149 registrar_.Add(this, NotificationType::EXTENSION_LOADED, |
149 NotificationService::AllSources()); | 150 NotificationService::AllSources()); |
150 registrar_.Add(this, NotificationType::EXTENSION_UNLOADED, | 151 registrar_.Add(this, NotificationType::EXTENSION_UNLOADED, |
151 NotificationService::AllSources()); | 152 NotificationService::AllSources()); |
152 #if defined(OS_MACOSX) | 153 #if defined(OS_MACOSX) |
153 // We need to know when the browser comes forward so we can bring modal plugin | 154 // We need to know when the browser comes forward so we can bring modal plugin |
(...skipping 51 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
205 } | 206 } |
206 | 207 |
207 PluginProcessHost* PluginService::FindOrStartPluginProcess( | 208 PluginProcessHost* PluginService::FindOrStartPluginProcess( |
208 const FilePath& plugin_path) { | 209 const FilePath& plugin_path) { |
209 DCHECK(BrowserThread::CurrentlyOn(BrowserThread::IO)); | 210 DCHECK(BrowserThread::CurrentlyOn(BrowserThread::IO)); |
210 | 211 |
211 PluginProcessHost* plugin_host = FindPluginProcess(plugin_path); | 212 PluginProcessHost* plugin_host = FindPluginProcess(plugin_path); |
212 if (plugin_host) | 213 if (plugin_host) |
213 return plugin_host; | 214 return plugin_host; |
214 | 215 |
215 WebPluginInfo info; | 216 webkit::npapi::WebPluginInfo info; |
216 if (!NPAPI::PluginList::Singleton()->GetPluginInfoByPath( | 217 if (!webkit::npapi::PluginList::Singleton()->GetPluginInfoByPath( |
217 plugin_path, &info)) { | 218 plugin_path, &info)) { |
218 return NULL; | 219 return NULL; |
219 } | 220 } |
220 | 221 |
221 // This plugin isn't loaded by any plugin process, so create a new process. | 222 // This plugin isn't loaded by any plugin process, so create a new process. |
222 scoped_ptr<PluginProcessHost> new_host(new PluginProcessHost()); | 223 scoped_ptr<PluginProcessHost> new_host(new PluginProcessHost()); |
223 if (!new_host->Init(info, ui_locale_)) { | 224 if (!new_host->Init(info, ui_locale_)) { |
224 NOTREACHED(); // Init is not expected to fail | 225 NOTREACHED(); // Init is not expected to fail |
225 return NULL; | 226 return NULL; |
226 } | 227 } |
227 | 228 |
(...skipping 11 matching lines...) Expand all Loading... |
239 NewRunnableMethod( | 240 NewRunnableMethod( |
240 this, &PluginService::GetAllowedPluginForOpenChannelToPlugin, | 241 this, &PluginService::GetAllowedPluginForOpenChannelToPlugin, |
241 url, mime_type, client)); | 242 url, mime_type, client)); |
242 } | 243 } |
243 | 244 |
244 void PluginService::GetAllowedPluginForOpenChannelToPlugin( | 245 void PluginService::GetAllowedPluginForOpenChannelToPlugin( |
245 const GURL& url, | 246 const GURL& url, |
246 const std::string& mime_type, | 247 const std::string& mime_type, |
247 PluginProcessHost::Client* client) { | 248 PluginProcessHost::Client* client) { |
248 DCHECK(BrowserThread::CurrentlyOn(BrowserThread::FILE)); | 249 DCHECK(BrowserThread::CurrentlyOn(BrowserThread::FILE)); |
249 WebPluginInfo info; | 250 webkit::npapi::WebPluginInfo info; |
250 bool found = GetFirstAllowedPluginInfo(url, mime_type, &info, NULL); | 251 bool found = GetFirstAllowedPluginInfo(url, mime_type, &info, NULL); |
251 FilePath plugin_path; | 252 FilePath plugin_path; |
252 if (found && info.enabled) | 253 if (found && info.enabled) |
253 plugin_path = FilePath(info.path); | 254 plugin_path = FilePath(info.path); |
254 | 255 |
255 // Now we jump back to the IO thread to finish opening the channel. | 256 // Now we jump back to the IO thread to finish opening the channel. |
256 BrowserThread::PostTask( | 257 BrowserThread::PostTask( |
257 BrowserThread::IO, FROM_HERE, | 258 BrowserThread::IO, FROM_HERE, |
258 NewRunnableMethod( | 259 NewRunnableMethod( |
259 this, &PluginService::FinishOpenChannelToPlugin, | 260 this, &PluginService::FinishOpenChannelToPlugin, |
260 plugin_path, client)); | 261 plugin_path, client)); |
261 } | 262 } |
262 | 263 |
263 void PluginService::FinishOpenChannelToPlugin( | 264 void PluginService::FinishOpenChannelToPlugin( |
264 const FilePath& plugin_path, | 265 const FilePath& plugin_path, |
265 PluginProcessHost::Client* client) { | 266 PluginProcessHost::Client* client) { |
266 DCHECK(BrowserThread::CurrentlyOn(BrowserThread::IO)); | 267 DCHECK(BrowserThread::CurrentlyOn(BrowserThread::IO)); |
267 | 268 |
268 PluginProcessHost* plugin_host = FindOrStartPluginProcess(plugin_path); | 269 PluginProcessHost* plugin_host = FindOrStartPluginProcess(plugin_path); |
269 if (plugin_host) | 270 if (plugin_host) |
270 plugin_host->OpenChannelToPlugin(client); | 271 plugin_host->OpenChannelToPlugin(client); |
271 else | 272 else |
272 client->OnError(); | 273 client->OnError(); |
273 } | 274 } |
274 | 275 |
275 bool PluginService::GetFirstAllowedPluginInfo( | 276 bool PluginService::GetFirstAllowedPluginInfo( |
276 const GURL& url, | 277 const GURL& url, |
277 const std::string& mime_type, | 278 const std::string& mime_type, |
278 WebPluginInfo* info, | 279 webkit::npapi::WebPluginInfo* info, |
279 std::string* actual_mime_type) { | 280 std::string* actual_mime_type) { |
280 // GetPluginInfoArray may need to load the plugins, so we need to be | 281 // GetPluginInfoArray may need to load the plugins, so we need to be |
281 // on the FILE thread. | 282 // on the FILE thread. |
282 DCHECK(BrowserThread::CurrentlyOn(BrowserThread::FILE)); | 283 DCHECK(BrowserThread::CurrentlyOn(BrowserThread::FILE)); |
283 bool allow_wildcard = true; | 284 bool allow_wildcard = true; |
284 #if defined(OS_CHROMEOS) | 285 #if defined(OS_CHROMEOS) |
285 std::vector<WebPluginInfo> info_array; | 286 std::vector<webkit::npapi::WebPluginInfo> info_array; |
286 std::vector<std::string> actual_mime_types; | 287 std::vector<std::string> actual_mime_types; |
287 NPAPI::PluginList::Singleton()->GetPluginInfoArray( | 288 webkit::npapi::PluginList::Singleton()->GetPluginInfoArray( |
288 url, mime_type, allow_wildcard, &info_array, &actual_mime_types); | 289 url, mime_type, allow_wildcard, &info_array, &actual_mime_types); |
289 | 290 |
290 // Now we filter by the plugin selection policy. | 291 // Now we filter by the plugin selection policy. |
291 int allowed_index = plugin_selection_policy_->FindFirstAllowed(url, | 292 int allowed_index = plugin_selection_policy_->FindFirstAllowed(url, |
292 info_array); | 293 info_array); |
293 if (!info_array.empty() && allowed_index >= 0) { | 294 if (!info_array.empty() && allowed_index >= 0) { |
294 *info = info_array[allowed_index]; | 295 *info = info_array[allowed_index]; |
295 if (actual_mime_type) | 296 if (actual_mime_type) |
296 *actual_mime_type = actual_mime_types[allowed_index]; | 297 *actual_mime_type = actual_mime_types[allowed_index]; |
297 return true; | 298 return true; |
298 } | 299 } |
299 return false; | 300 return false; |
300 #else | 301 #else |
301 return NPAPI::PluginList::Singleton()->GetPluginInfo( | 302 return webkit::npapi::PluginList::Singleton()->GetPluginInfo( |
302 url, mime_type, allow_wildcard, info, actual_mime_type); | 303 url, mime_type, allow_wildcard, info, actual_mime_type); |
303 #endif | 304 #endif |
304 } | 305 } |
305 | 306 |
306 static void PurgePluginListCache(bool reload_pages) { | 307 static void PurgePluginListCache(bool reload_pages) { |
307 for (RenderProcessHost::iterator it = RenderProcessHost::AllHostsIterator(); | 308 for (RenderProcessHost::iterator it = RenderProcessHost::AllHostsIterator(); |
308 !it.IsAtEnd(); it.Advance()) { | 309 !it.IsAtEnd(); it.Advance()) { |
309 it.GetCurrentValue()->Send(new ViewMsg_PurgePluginListCache(reload_pages)); | 310 it.GetCurrentValue()->Send(new ViewMsg_PurgePluginListCache(reload_pages)); |
310 } | 311 } |
311 } | 312 } |
312 | 313 |
313 void PluginService::OnWaitableEventSignaled( | 314 void PluginService::OnWaitableEventSignaled( |
314 base::WaitableEvent* waitable_event) { | 315 base::WaitableEvent* waitable_event) { |
315 #if defined(OS_WIN) | 316 #if defined(OS_WIN) |
316 if (waitable_event == hkcu_event_.get()) { | 317 if (waitable_event == hkcu_event_.get()) { |
317 hkcu_key_.StartWatching(); | 318 hkcu_key_.StartWatching(); |
318 } else { | 319 } else { |
319 hklm_key_.StartWatching(); | 320 hklm_key_.StartWatching(); |
320 } | 321 } |
321 | 322 |
322 NPAPI::PluginList::Singleton()->RefreshPlugins(); | 323 webkit::npapi::PluginList::Singleton()->RefreshPlugins(); |
323 PurgePluginListCache(true); | 324 PurgePluginListCache(true); |
324 #endif // defined(OS_WIN) | 325 #endif // defined(OS_WIN) |
325 } | 326 } |
326 | 327 |
327 static void ForceShutdownPlugin(const FilePath& plugin_path) { | 328 static void ForceShutdownPlugin(const FilePath& plugin_path) { |
328 PluginProcessHost* plugin = | 329 PluginProcessHost* plugin = |
329 PluginService::GetInstance()->FindPluginProcess(plugin_path); | 330 PluginService::GetInstance()->FindPluginProcess(plugin_path); |
330 if (plugin) | 331 if (plugin) |
331 plugin->ForceShutdown(); | 332 plugin->ForceShutdown(); |
332 } | 333 } |
333 | 334 |
334 void PluginService::Observe(NotificationType type, | 335 void PluginService::Observe(NotificationType type, |
335 const NotificationSource& source, | 336 const NotificationSource& source, |
336 const NotificationDetails& details) { | 337 const NotificationDetails& details) { |
337 switch (type.value) { | 338 switch (type.value) { |
338 case NotificationType::EXTENSION_LOADED: { | 339 case NotificationType::EXTENSION_LOADED: { |
339 const Extension* extension = Details<const Extension>(details).ptr(); | 340 const Extension* extension = Details<const Extension>(details).ptr(); |
340 bool plugins_changed = false; | 341 bool plugins_changed = false; |
341 for (size_t i = 0; i < extension->plugins().size(); ++i) { | 342 for (size_t i = 0; i < extension->plugins().size(); ++i) { |
342 const Extension::PluginInfo& plugin = extension->plugins()[i]; | 343 const Extension::PluginInfo& plugin = extension->plugins()[i]; |
343 NPAPI::PluginList::Singleton()->RefreshPlugins(); | 344 webkit::npapi::PluginList::Singleton()->RefreshPlugins(); |
344 NPAPI::PluginList::Singleton()->AddExtraPluginPath(plugin.path); | 345 webkit::npapi::PluginList::Singleton()->AddExtraPluginPath(plugin.path); |
345 plugins_changed = true; | 346 plugins_changed = true; |
346 if (!plugin.is_public) | 347 if (!plugin.is_public) |
347 private_plugins_[plugin.path] = extension->url(); | 348 private_plugins_[plugin.path] = extension->url(); |
348 } | 349 } |
349 if (plugins_changed) | 350 if (plugins_changed) |
350 PurgePluginListCache(false); | 351 PurgePluginListCache(false); |
351 break; | 352 break; |
352 } | 353 } |
353 | 354 |
354 case NotificationType::EXTENSION_UNLOADED: { | 355 case NotificationType::EXTENSION_UNLOADED: { |
355 const Extension* extension = Details<const Extension>(details).ptr(); | 356 const Extension* extension = Details<const Extension>(details).ptr(); |
356 bool plugins_changed = false; | 357 bool plugins_changed = false; |
357 for (size_t i = 0; i < extension->plugins().size(); ++i) { | 358 for (size_t i = 0; i < extension->plugins().size(); ++i) { |
358 const Extension::PluginInfo& plugin = extension->plugins()[i]; | 359 const Extension::PluginInfo& plugin = extension->plugins()[i]; |
359 BrowserThread::PostTask(BrowserThread::IO, FROM_HERE, | 360 BrowserThread::PostTask(BrowserThread::IO, FROM_HERE, |
360 NewRunnableFunction(&ForceShutdownPlugin, | 361 NewRunnableFunction(&ForceShutdownPlugin, |
361 plugin.path)); | 362 plugin.path)); |
362 NPAPI::PluginList::Singleton()->RefreshPlugins(); | 363 webkit::npapi::PluginList::Singleton()->RefreshPlugins(); |
363 NPAPI::PluginList::Singleton()->RemoveExtraPluginPath(plugin.path); | 364 webkit::npapi::PluginList::Singleton()->RemoveExtraPluginPath( |
| 365 plugin.path); |
364 plugins_changed = true; | 366 plugins_changed = true; |
365 if (!plugin.is_public) | 367 if (!plugin.is_public) |
366 private_plugins_.erase(plugin.path); | 368 private_plugins_.erase(plugin.path); |
367 } | 369 } |
368 if (plugins_changed) | 370 if (plugins_changed) |
369 PurgePluginListCache(false); | 371 PurgePluginListCache(false); |
370 break; | 372 break; |
371 } | 373 } |
372 | 374 |
373 #if defined(OS_MACOSX) | 375 #if defined(OS_MACOSX) |
(...skipping 26 matching lines...) Expand all Loading... |
400 // service, since we only care about this for extensions. | 402 // service, since we only care about this for extensions. |
401 const GURL& required_url = it->second; | 403 const GURL& required_url = it->second; |
402 return (url.scheme() == required_url.scheme() && | 404 return (url.scheme() == required_url.scheme() && |
403 url.host() == required_url.host()); | 405 url.host() == required_url.host()); |
404 } | 406 } |
405 | 407 |
406 void PluginService::RegisterPepperPlugins() { | 408 void PluginService::RegisterPepperPlugins() { |
407 std::vector<PepperPluginInfo> plugins; | 409 std::vector<PepperPluginInfo> plugins; |
408 PepperPluginRegistry::GetList(&plugins); | 410 PepperPluginRegistry::GetList(&plugins); |
409 for (size_t i = 0; i < plugins.size(); ++i) { | 411 for (size_t i = 0; i < plugins.size(); ++i) { |
410 NPAPI::PluginVersionInfo info; | 412 webkit::npapi::PluginVersionInfo info; |
411 info.path = plugins[i].path; | 413 info.path = plugins[i].path; |
412 info.product_name = plugins[i].name.empty() ? | 414 info.product_name = plugins[i].name.empty() ? |
413 plugins[i].path.BaseName().ToWStringHack() : | 415 plugins[i].path.BaseName().ToWStringHack() : |
414 ASCIIToWide(plugins[i].name); | 416 ASCIIToWide(plugins[i].name); |
415 info.file_description = ASCIIToWide(plugins[i].description); | 417 info.file_description = ASCIIToWide(plugins[i].description); |
416 info.file_extensions = ASCIIToWide(plugins[i].file_extensions); | 418 info.file_extensions = ASCIIToWide(plugins[i].file_extensions); |
417 info.file_description = ASCIIToWide(plugins[i].type_descriptions); | 419 info.file_description = ASCIIToWide(plugins[i].type_descriptions); |
418 info.mime_types = ASCIIToWide(JoinString(plugins[i].mime_types, '|')); | 420 info.mime_types = ASCIIToWide(JoinString(plugins[i].mime_types, '|')); |
419 | 421 |
420 // These NPAPI entry points will never be called. TODO(darin): Come up | 422 // These NPAPI entry points will never be called. TODO(darin): Come up |
421 // with a cleaner way to register pepper plugins with the NPAPI PluginList, | 423 // with a cleaner way to register pepper plugins with the NPAPI PluginList, |
422 // or perhaps refactor the PluginList to be less specific to NPAPI. | 424 // or perhaps refactor the PluginList to be less specific to NPAPI. |
423 memset(&info.entry_points, 0, sizeof(info.entry_points)); | 425 memset(&info.entry_points, 0, sizeof(info.entry_points)); |
424 | 426 |
425 NPAPI::PluginList::Singleton()->RegisterInternalPlugin(info); | 427 webkit::npapi::PluginList::Singleton()->RegisterInternalPlugin(info); |
426 } | 428 } |
427 } | 429 } |
OLD | NEW |