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 #include "content/browser/plugin_service_impl.h" | 5 #include "content/browser/plugin_service_impl.h" |
6 | 6 |
7 #include "base/bind.h" | 7 #include "base/bind.h" |
8 #include "base/command_line.h" | 8 #include "base/command_line.h" |
9 #include "base/compiler_specific.h" | 9 #include "base/compiler_specific.h" |
10 #include "base/files/file_path.h" | 10 #include "base/files/file_path.h" |
(...skipping 10 matching lines...) Expand all Loading... |
21 #include "content/browser/renderer_host/render_view_host_impl.h" | 21 #include "content/browser/renderer_host/render_view_host_impl.h" |
22 #include "content/common/pepper_plugin_registry.h" | 22 #include "content/common/pepper_plugin_registry.h" |
23 #include "content/common/plugin_list.h" | 23 #include "content/common/plugin_list.h" |
24 #include "content/common/view_messages.h" | 24 #include "content/common/view_messages.h" |
25 #include "content/public/browser/browser_thread.h" | 25 #include "content/public/browser/browser_thread.h" |
26 #include "content/public/browser/content_browser_client.h" | 26 #include "content/public/browser/content_browser_client.h" |
27 #include "content/public/browser/plugin_service_filter.h" | 27 #include "content/public/browser/plugin_service_filter.h" |
28 #include "content/public/browser/resource_context.h" | 28 #include "content/public/browser/resource_context.h" |
29 #include "content/public/common/content_switches.h" | 29 #include "content/public/common/content_switches.h" |
30 #include "content/public/common/process_type.h" | 30 #include "content/public/common/process_type.h" |
| 31 #include "content/public/common/webplugininfo.h" |
31 #include "webkit/plugins/plugin_constants.h" | 32 #include "webkit/plugins/plugin_constants.h" |
32 #include "webkit/plugins/webplugininfo.h" | |
33 | 33 |
34 #if defined(OS_WIN) | 34 #if defined(OS_WIN) |
35 #include "content/common/plugin_constants_win.h" | 35 #include "content/common/plugin_constants_win.h" |
36 #include "ui/base/win/hwnd_util.h" | 36 #include "ui/base/win/hwnd_util.h" |
37 #endif | 37 #endif |
38 | 38 |
39 #if defined(OS_POSIX) | 39 #if defined(OS_POSIX) |
40 #include "content/browser/plugin_loader_posix.h" | 40 #include "content/browser/plugin_loader_posix.h" |
41 #endif | 41 #endif |
42 | 42 |
(...skipping 126 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
169 PluginList::Singleton()->set_will_load_plugins_callback( | 169 PluginList::Singleton()->set_will_load_plugins_callback( |
170 base::Bind(&WillLoadPluginsCallback, plugin_list_token_)); | 170 base::Bind(&WillLoadPluginsCallback, plugin_list_token_)); |
171 | 171 |
172 RegisterPepperPlugins(); | 172 RegisterPepperPlugins(); |
173 | 173 |
174 // The --site-per-process flag enables an out-of-process iframes | 174 // The --site-per-process flag enables an out-of-process iframes |
175 // prototype, which uses WebView for rendering. We need to register the MIME | 175 // prototype, which uses WebView for rendering. We need to register the MIME |
176 // type we use with the plugin, so the renderer can instantiate it. | 176 // type we use with the plugin, so the renderer can instantiate it. |
177 const CommandLine* command_line = CommandLine::ForCurrentProcess(); | 177 const CommandLine* command_line = CommandLine::ForCurrentProcess(); |
178 if (command_line->HasSwitch(switches::kSitePerProcess)) { | 178 if (command_line->HasSwitch(switches::kSitePerProcess)) { |
179 webkit::WebPluginInfo webview_plugin( | 179 WebPluginInfo webview_plugin( |
180 ASCIIToUTF16("WebView Tag"), | 180 ASCIIToUTF16("WebView Tag"), |
181 base::FilePath(), | 181 base::FilePath(), |
182 ASCIIToUTF16("1.2.3.4"), | 182 ASCIIToUTF16("1.2.3.4"), |
183 ASCIIToUTF16("Browser Plugin.")); | 183 ASCIIToUTF16("Browser Plugin.")); |
184 webview_plugin.type = webkit::WebPluginInfo::PLUGIN_TYPE_NPAPI; | 184 webview_plugin.type = WebPluginInfo::PLUGIN_TYPE_NPAPI; |
185 webkit::WebPluginMimeType webview_plugin_mime_type; | 185 WebPluginMimeType webview_plugin_mime_type; |
186 webview_plugin_mime_type.mime_type = "application/browser-plugin"; | 186 webview_plugin_mime_type.mime_type = "application/browser-plugin"; |
187 webview_plugin_mime_type.file_extensions.push_back("*"); | 187 webview_plugin_mime_type.file_extensions.push_back("*"); |
188 webview_plugin.mime_types.push_back(webview_plugin_mime_type); | 188 webview_plugin.mime_types.push_back(webview_plugin_mime_type); |
189 RegisterInternalPlugin(webview_plugin, true); | 189 RegisterInternalPlugin(webview_plugin, true); |
190 } | 190 } |
191 | 191 |
192 // Load any specified on the command line as well. | 192 // Load any specified on the command line as well. |
193 base::FilePath path = | 193 base::FilePath path = |
194 command_line->GetSwitchValuePath(switches::kLoadPlugin); | 194 command_line->GetSwitchValuePath(switches::kLoadPlugin); |
195 if (!path.empty()) | 195 if (!path.empty()) |
(...skipping 99 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
295 const base::FilePath& plugin_path) { | 295 const base::FilePath& plugin_path) { |
296 DCHECK(BrowserThread::CurrentlyOn(BrowserThread::IO)); | 296 DCHECK(BrowserThread::CurrentlyOn(BrowserThread::IO)); |
297 | 297 |
298 if (filter_ && !filter_->CanLoadPlugin(render_process_id, plugin_path)) | 298 if (filter_ && !filter_->CanLoadPlugin(render_process_id, plugin_path)) |
299 return NULL; | 299 return NULL; |
300 | 300 |
301 PluginProcessHost* plugin_host = FindNpapiPluginProcess(plugin_path); | 301 PluginProcessHost* plugin_host = FindNpapiPluginProcess(plugin_path); |
302 if (plugin_host) | 302 if (plugin_host) |
303 return plugin_host; | 303 return plugin_host; |
304 | 304 |
305 webkit::WebPluginInfo info; | 305 WebPluginInfo info; |
306 if (!GetPluginInfoByPath(plugin_path, &info)) { | 306 if (!GetPluginInfoByPath(plugin_path, &info)) { |
307 return NULL; | 307 return NULL; |
308 } | 308 } |
309 | 309 |
310 // Record when NPAPI Flash process is started for the first time. | 310 // Record when NPAPI Flash process is started for the first time. |
311 static bool counted = false; | 311 static bool counted = false; |
312 if (!counted && UTF16ToUTF8(info.name) == kFlashPluginName) { | 312 if (!counted && UTF16ToUTF8(info.name) == kFlashPluginName) { |
313 counted = true; | 313 counted = true; |
314 UMA_HISTOGRAM_ENUMERATION("Plugin.FlashUsage", | 314 UMA_HISTOGRAM_ENUMERATION("Plugin.FlashUsage", |
315 START_NPAPI_FLASH_AT_LEAST_ONCE, | 315 START_NPAPI_FLASH_AT_LEAST_ONCE, |
(...skipping 125 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
441 DCHECK(BrowserThread::CurrentlyOn(BrowserThread::IO)); | 441 DCHECK(BrowserThread::CurrentlyOn(BrowserThread::IO)); |
442 DCHECK(ContainsKey(pending_plugin_clients_, client)); | 442 DCHECK(ContainsKey(pending_plugin_clients_, client)); |
443 pending_plugin_clients_.erase(client); | 443 pending_plugin_clients_.erase(client); |
444 } | 444 } |
445 | 445 |
446 void PluginServiceImpl::ForwardGetAllowedPluginForOpenChannelToPlugin( | 446 void PluginServiceImpl::ForwardGetAllowedPluginForOpenChannelToPlugin( |
447 const PluginServiceFilterParams& params, | 447 const PluginServiceFilterParams& params, |
448 const GURL& url, | 448 const GURL& url, |
449 const std::string& mime_type, | 449 const std::string& mime_type, |
450 PluginProcessHost::Client* client, | 450 PluginProcessHost::Client* client, |
451 const std::vector<webkit::WebPluginInfo>&) { | 451 const std::vector<WebPluginInfo>&) { |
452 GetAllowedPluginForOpenChannelToPlugin(params.render_process_id, | 452 GetAllowedPluginForOpenChannelToPlugin(params.render_process_id, |
453 params.render_view_id, url, params.page_url, mime_type, client, | 453 params.render_view_id, url, params.page_url, mime_type, client, |
454 params.resource_context); | 454 params.resource_context); |
455 } | 455 } |
456 | 456 |
457 void PluginServiceImpl::GetAllowedPluginForOpenChannelToPlugin( | 457 void PluginServiceImpl::GetAllowedPluginForOpenChannelToPlugin( |
458 int render_process_id, | 458 int render_process_id, |
459 int render_view_id, | 459 int render_view_id, |
460 const GURL& url, | 460 const GURL& url, |
461 const GURL& page_url, | 461 const GURL& page_url, |
462 const std::string& mime_type, | 462 const std::string& mime_type, |
463 PluginProcessHost::Client* client, | 463 PluginProcessHost::Client* client, |
464 ResourceContext* resource_context) { | 464 ResourceContext* resource_context) { |
465 webkit::WebPluginInfo info; | 465 WebPluginInfo info; |
466 bool allow_wildcard = true; | 466 bool allow_wildcard = true; |
467 bool found = GetPluginInfo( | 467 bool found = GetPluginInfo( |
468 render_process_id, render_view_id, resource_context, | 468 render_process_id, render_view_id, resource_context, |
469 url, page_url, mime_type, allow_wildcard, | 469 url, page_url, mime_type, allow_wildcard, |
470 NULL, &info, NULL); | 470 NULL, &info, NULL); |
471 base::FilePath plugin_path; | 471 base::FilePath plugin_path; |
472 if (found) | 472 if (found) |
473 plugin_path = info.path; | 473 plugin_path = info.path; |
474 | 474 |
475 // Now we jump back to the IO thread to finish opening the channel. | 475 // Now we jump back to the IO thread to finish opening the channel. |
(...skipping 24 matching lines...) Expand all Loading... |
500 plugin_host->OpenChannelToPlugin(client); | 500 plugin_host->OpenChannelToPlugin(client); |
501 } else { | 501 } else { |
502 client->OnError(); | 502 client->OnError(); |
503 } | 503 } |
504 } | 504 } |
505 | 505 |
506 bool PluginServiceImpl::GetPluginInfoArray( | 506 bool PluginServiceImpl::GetPluginInfoArray( |
507 const GURL& url, | 507 const GURL& url, |
508 const std::string& mime_type, | 508 const std::string& mime_type, |
509 bool allow_wildcard, | 509 bool allow_wildcard, |
510 std::vector<webkit::WebPluginInfo>* plugins, | 510 std::vector<WebPluginInfo>* plugins, |
511 std::vector<std::string>* actual_mime_types) { | 511 std::vector<std::string>* actual_mime_types) { |
512 bool use_stale = false; | 512 bool use_stale = false; |
513 PluginList::Singleton()->GetPluginInfoArray( | 513 PluginList::Singleton()->GetPluginInfoArray( |
514 url, mime_type, allow_wildcard, &use_stale, NPAPIPluginsSupported(), | 514 url, mime_type, allow_wildcard, &use_stale, NPAPIPluginsSupported(), |
515 plugins, actual_mime_types); | 515 plugins, actual_mime_types); |
516 return use_stale; | 516 return use_stale; |
517 } | 517 } |
518 | 518 |
519 bool PluginServiceImpl::GetPluginInfo(int render_process_id, | 519 bool PluginServiceImpl::GetPluginInfo(int render_process_id, |
520 int render_view_id, | 520 int render_view_id, |
521 ResourceContext* context, | 521 ResourceContext* context, |
522 const GURL& url, | 522 const GURL& url, |
523 const GURL& page_url, | 523 const GURL& page_url, |
524 const std::string& mime_type, | 524 const std::string& mime_type, |
525 bool allow_wildcard, | 525 bool allow_wildcard, |
526 bool* is_stale, | 526 bool* is_stale, |
527 webkit::WebPluginInfo* info, | 527 WebPluginInfo* info, |
528 std::string* actual_mime_type) { | 528 std::string* actual_mime_type) { |
529 std::vector<webkit::WebPluginInfo> plugins; | 529 std::vector<WebPluginInfo> plugins; |
530 std::vector<std::string> mime_types; | 530 std::vector<std::string> mime_types; |
531 bool stale = GetPluginInfoArray( | 531 bool stale = GetPluginInfoArray( |
532 url, mime_type, allow_wildcard, &plugins, &mime_types); | 532 url, mime_type, allow_wildcard, &plugins, &mime_types); |
533 if (is_stale) | 533 if (is_stale) |
534 *is_stale = stale; | 534 *is_stale = stale; |
535 | 535 |
536 for (size_t i = 0; i < plugins.size(); ++i) { | 536 for (size_t i = 0; i < plugins.size(); ++i) { |
537 if (!filter_ || filter_->IsPluginAvailable(render_process_id, | 537 if (!filter_ || filter_->IsPluginAvailable(render_process_id, |
538 render_view_id, | 538 render_view_id, |
539 context, | 539 context, |
540 url, | 540 url, |
541 page_url, | 541 page_url, |
542 &plugins[i])) { | 542 &plugins[i])) { |
543 *info = plugins[i]; | 543 *info = plugins[i]; |
544 if (actual_mime_type) | 544 if (actual_mime_type) |
545 *actual_mime_type = mime_types[i]; | 545 *actual_mime_type = mime_types[i]; |
546 return true; | 546 return true; |
547 } | 547 } |
548 } | 548 } |
549 return false; | 549 return false; |
550 } | 550 } |
551 | 551 |
552 bool PluginServiceImpl::GetPluginInfoByPath(const base::FilePath& plugin_path, | 552 bool PluginServiceImpl::GetPluginInfoByPath(const base::FilePath& plugin_path, |
553 webkit::WebPluginInfo* info) { | 553 WebPluginInfo* info) { |
554 std::vector<webkit::WebPluginInfo> plugins; | 554 std::vector<WebPluginInfo> plugins; |
555 PluginList::Singleton()->GetPluginsNoRefresh(&plugins); | 555 PluginList::Singleton()->GetPluginsNoRefresh(&plugins); |
556 | 556 |
557 for (std::vector<webkit::WebPluginInfo>::iterator it = plugins.begin(); | 557 for (std::vector<WebPluginInfo>::iterator it = plugins.begin(); |
558 it != plugins.end(); | 558 it != plugins.end(); |
559 ++it) { | 559 ++it) { |
560 if (it->path == plugin_path) { | 560 if (it->path == plugin_path) { |
561 *info = *it; | 561 *info = *it; |
562 return true; | 562 return true; |
563 } | 563 } |
564 } | 564 } |
565 | 565 |
566 return false; | 566 return false; |
567 } | 567 } |
568 | 568 |
569 string16 PluginServiceImpl::GetPluginDisplayNameByPath( | 569 string16 PluginServiceImpl::GetPluginDisplayNameByPath( |
570 const base::FilePath& path) { | 570 const base::FilePath& path) { |
571 string16 plugin_name = path.LossyDisplayName(); | 571 string16 plugin_name = path.LossyDisplayName(); |
572 webkit::WebPluginInfo info; | 572 WebPluginInfo info; |
573 if (PluginService::GetInstance()->GetPluginInfoByPath(path, &info) && | 573 if (PluginService::GetInstance()->GetPluginInfoByPath(path, &info) && |
574 !info.name.empty()) { | 574 !info.name.empty()) { |
575 plugin_name = info.name; | 575 plugin_name = info.name; |
576 #if defined(OS_MACOSX) | 576 #if defined(OS_MACOSX) |
577 // Many plugins on the Mac have .plugin in the actual name, which looks | 577 // Many plugins on the Mac have .plugin in the actual name, which looks |
578 // terrible, so look for that and strip it off if present. | 578 // terrible, so look for that and strip it off if present. |
579 const std::string kPluginExtension = ".plugin"; | 579 const std::string kPluginExtension = ".plugin"; |
580 if (EndsWith(plugin_name, ASCIIToUTF16(kPluginExtension), true)) | 580 if (EndsWith(plugin_name, ASCIIToUTF16(kPluginExtension), true)) |
581 plugin_name.erase(plugin_name.length() - kPluginExtension.length()); | 581 plugin_name.erase(plugin_name.length() - kPluginExtension.length()); |
582 #endif // OS_MACOSX | 582 #endif // OS_MACOSX |
(...skipping 10 matching lines...) Expand all Loading... |
593 PostSequencedWorkerTaskWithShutdownBehavior( | 593 PostSequencedWorkerTaskWithShutdownBehavior( |
594 plugin_list_token_, | 594 plugin_list_token_, |
595 FROM_HERE, | 595 FROM_HERE, |
596 base::Bind(&PluginServiceImpl::GetPluginsInternal, | 596 base::Bind(&PluginServiceImpl::GetPluginsInternal, |
597 base::Unretained(this), | 597 base::Unretained(this), |
598 target_loop, callback), | 598 target_loop, callback), |
599 base::SequencedWorkerPool::SKIP_ON_SHUTDOWN); | 599 base::SequencedWorkerPool::SKIP_ON_SHUTDOWN); |
600 return; | 600 return; |
601 } | 601 } |
602 #if defined(OS_POSIX) | 602 #if defined(OS_POSIX) |
603 std::vector<webkit::WebPluginInfo> cached_plugins; | 603 std::vector<WebPluginInfo> cached_plugins; |
604 if (PluginList::Singleton()->GetPluginsNoRefresh(&cached_plugins)) { | 604 if (PluginList::Singleton()->GetPluginsNoRefresh(&cached_plugins)) { |
605 // Can't assume the caller is reentrant. | 605 // Can't assume the caller is reentrant. |
606 target_loop->PostTask(FROM_HERE, | 606 target_loop->PostTask(FROM_HERE, |
607 base::Bind(callback, cached_plugins)); | 607 base::Bind(callback, cached_plugins)); |
608 } else { | 608 } else { |
609 // If we switch back to loading plugins in process, then we need to make | 609 // If we switch back to loading plugins in process, then we need to make |
610 // sure g_thread_init() gets called since plugins may call glib at load. | 610 // sure g_thread_init() gets called since plugins may call glib at load. |
611 if (!plugin_loader_.get()) | 611 if (!plugin_loader_.get()) |
612 plugin_loader_ = new PluginLoaderPosix; | 612 plugin_loader_ = new PluginLoaderPosix; |
613 BrowserThread::PostTask(BrowserThread::IO, FROM_HERE, | 613 BrowserThread::PostTask(BrowserThread::IO, FROM_HERE, |
614 base::Bind(&PluginLoaderPosix::LoadPlugins, plugin_loader_, | 614 base::Bind(&PluginLoaderPosix::LoadPlugins, plugin_loader_, |
615 target_loop, callback)); | 615 target_loop, callback)); |
616 } | 616 } |
617 #else | 617 #else |
618 NOTREACHED(); | 618 NOTREACHED(); |
619 #endif | 619 #endif |
620 } | 620 } |
621 | 621 |
622 void PluginServiceImpl::GetPluginsInternal( | 622 void PluginServiceImpl::GetPluginsInternal( |
623 base::MessageLoopProxy* target_loop, | 623 base::MessageLoopProxy* target_loop, |
624 const PluginService::GetPluginsCallback& callback) { | 624 const PluginService::GetPluginsCallback& callback) { |
625 DCHECK(BrowserThread::GetBlockingPool()->IsRunningSequenceOnCurrentThread( | 625 DCHECK(BrowserThread::GetBlockingPool()->IsRunningSequenceOnCurrentThread( |
626 plugin_list_token_)); | 626 plugin_list_token_)); |
627 | 627 |
628 std::vector<webkit::WebPluginInfo> plugins; | 628 std::vector<WebPluginInfo> plugins; |
629 PluginList::Singleton()->GetPlugins(&plugins, NPAPIPluginsSupported()); | 629 PluginList::Singleton()->GetPlugins(&plugins, NPAPIPluginsSupported()); |
630 | 630 |
631 target_loop->PostTask(FROM_HERE, | 631 target_loop->PostTask(FROM_HERE, |
632 base::Bind(callback, plugins)); | 632 base::Bind(callback, plugins)); |
633 } | 633 } |
634 | 634 |
635 void PluginServiceImpl::OnWaitableEventSignaled( | 635 void PluginServiceImpl::OnWaitableEventSignaled( |
636 base::WaitableEvent* waitable_event) { | 636 base::WaitableEvent* waitable_event) { |
637 #if defined(OS_WIN) | 637 #if defined(OS_WIN) |
638 if (waitable_event == hkcu_event_) { | 638 if (waitable_event == hkcu_event_) { |
(...skipping 28 matching lines...) Expand all Loading... |
667 break; | 667 break; |
668 } | 668 } |
669 } | 669 } |
670 if (info) | 670 if (info) |
671 return info; | 671 return info; |
672 // We did not find the plugin in our list. But wait! the plugin can also | 672 // We did not find the plugin in our list. But wait! the plugin can also |
673 // be a latecomer, as it happens with pepper flash. This information | 673 // be a latecomer, as it happens with pepper flash. This information |
674 // can be obtained from the PluginList singleton and we can use it to | 674 // can be obtained from the PluginList singleton and we can use it to |
675 // construct it and add it to the list. This same deal needs to be done | 675 // construct it and add it to the list. This same deal needs to be done |
676 // in the renderer side in PepperPluginRegistry. | 676 // in the renderer side in PepperPluginRegistry. |
677 webkit::WebPluginInfo webplugin_info; | 677 WebPluginInfo webplugin_info; |
678 if (!GetPluginInfoByPath(plugin_path, &webplugin_info)) | 678 if (!GetPluginInfoByPath(plugin_path, &webplugin_info)) |
679 return NULL; | 679 return NULL; |
680 PepperPluginInfo new_pepper_info; | 680 PepperPluginInfo new_pepper_info; |
681 if (!MakePepperPluginInfo(webplugin_info, &new_pepper_info)) | 681 if (!MakePepperPluginInfo(webplugin_info, &new_pepper_info)) |
682 return NULL; | 682 return NULL; |
683 ppapi_plugins_.push_back(new_pepper_info); | 683 ppapi_plugins_.push_back(new_pepper_info); |
684 return &ppapi_plugins_[ppapi_plugins_.size() - 1]; | 684 return &ppapi_plugins_[ppapi_plugins_.size() - 1]; |
685 } | 685 } |
686 | 686 |
687 #if defined(OS_POSIX) && !defined(OS_OPENBSD) && !defined(OS_ANDROID) | 687 #if defined(OS_POSIX) && !defined(OS_OPENBSD) && !defined(OS_ANDROID) |
(...skipping 76 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
764 | 764 |
765 void PluginServiceImpl::RemoveExtraPluginPath(const base::FilePath& path) { | 765 void PluginServiceImpl::RemoveExtraPluginPath(const base::FilePath& path) { |
766 PluginList::Singleton()->RemoveExtraPluginPath(path); | 766 PluginList::Singleton()->RemoveExtraPluginPath(path); |
767 } | 767 } |
768 | 768 |
769 void PluginServiceImpl::AddExtraPluginDir(const base::FilePath& path) { | 769 void PluginServiceImpl::AddExtraPluginDir(const base::FilePath& path) { |
770 PluginList::Singleton()->AddExtraPluginDir(path); | 770 PluginList::Singleton()->AddExtraPluginDir(path); |
771 } | 771 } |
772 | 772 |
773 void PluginServiceImpl::RegisterInternalPlugin( | 773 void PluginServiceImpl::RegisterInternalPlugin( |
774 const webkit::WebPluginInfo& info, | 774 const WebPluginInfo& info, |
775 bool add_at_beginning) { | 775 bool add_at_beginning) { |
776 if (!NPAPIPluginsSupported() && | 776 if (!NPAPIPluginsSupported() && |
777 info.type == webkit::WebPluginInfo::PLUGIN_TYPE_NPAPI) { | 777 info.type == WebPluginInfo::PLUGIN_TYPE_NPAPI) { |
778 DLOG(INFO) << "Don't register NPAPI plugins when they're not supported"; | 778 DLOG(INFO) << "Don't register NPAPI plugins when they're not supported"; |
779 return; | 779 return; |
780 } | 780 } |
781 PluginList::Singleton()->RegisterInternalPlugin(info, add_at_beginning); | 781 PluginList::Singleton()->RegisterInternalPlugin(info, add_at_beginning); |
782 } | 782 } |
783 | 783 |
784 void PluginServiceImpl::UnregisterInternalPlugin(const base::FilePath& path) { | 784 void PluginServiceImpl::UnregisterInternalPlugin(const base::FilePath& path) { |
785 PluginList::Singleton()->UnregisterInternalPlugin(path); | 785 PluginList::Singleton()->UnregisterInternalPlugin(path); |
786 } | 786 } |
787 | 787 |
788 void PluginServiceImpl::GetInternalPlugins( | 788 void PluginServiceImpl::GetInternalPlugins( |
789 std::vector<webkit::WebPluginInfo>* plugins) { | 789 std::vector<WebPluginInfo>* plugins) { |
790 PluginList::Singleton()->GetInternalPlugins(plugins); | 790 PluginList::Singleton()->GetInternalPlugins(plugins); |
791 } | 791 } |
792 | 792 |
793 bool PluginServiceImpl::NPAPIPluginsSupported() { | 793 bool PluginServiceImpl::NPAPIPluginsSupported() { |
794 #if defined(OS_WIN) || defined(OS_MACOSX) || (defined(OS_LINUX) && !defined(USE_
AURA)) | 794 #if defined(OS_WIN) || defined(OS_MACOSX) || (defined(OS_LINUX) && !defined(USE_
AURA)) |
795 return true; | 795 return true; |
796 #else | 796 #else |
797 return false; | 797 return false; |
798 #endif | 798 #endif |
799 } | 799 } |
(...skipping 38 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
838 window, kPluginVersionAtomProperty, plugin_version); | 838 window, kPluginVersionAtomProperty, plugin_version); |
839 return true; | 839 return true; |
840 } | 840 } |
841 | 841 |
842 bool PluginServiceImpl::IsPluginWindow(HWND window) { | 842 bool PluginServiceImpl::IsPluginWindow(HWND window) { |
843 return ui::GetClassName(window) == base::string16(kNativeWindowClassName); | 843 return ui::GetClassName(window) == base::string16(kNativeWindowClassName); |
844 } | 844 } |
845 #endif | 845 #endif |
846 | 846 |
847 } // namespace content | 847 } // namespace content |
OLD | NEW |