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" |
11 #include "base/message_loop/message_loop.h" | 11 #include "base/message_loop/message_loop.h" |
12 #include "base/message_loop/message_loop_proxy.h" | 12 #include "base/message_loop/message_loop_proxy.h" |
13 #include "base/metrics/histogram.h" | 13 #include "base/metrics/histogram.h" |
14 #include "base/path_service.h" | 14 #include "base/path_service.h" |
15 #include "base/strings/string_util.h" | 15 #include "base/strings/string_util.h" |
16 #include "base/strings/utf_string_conversions.h" | 16 #include "base/strings/utf_string_conversions.h" |
17 #include "base/synchronization/waitable_event.h" | 17 #include "base/synchronization/waitable_event.h" |
18 #include "base/threading/thread.h" | 18 #include "base/threading/thread.h" |
19 #include "content/browser/ppapi_plugin_process_host.h" | 19 #include "content/browser/ppapi_plugin_process_host.h" |
20 #include "content/browser/renderer_host/render_process_host_impl.h" | 20 #include "content/browser/renderer_host/render_process_host_impl.h" |
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_list.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 "content/public/common/webplugininfo.h" |
32 #include "webkit/plugins/plugin_constants.h" | 32 #include "webkit/plugins/plugin_constants.h" |
(...skipping 610 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
643 | 643 |
644 PluginList::Singleton()->RefreshPlugins(); | 644 PluginList::Singleton()->RefreshPlugins(); |
645 PurgePluginListCache(NULL, false); | 645 PurgePluginListCache(NULL, false); |
646 #else | 646 #else |
647 // This event should only get signaled on a Windows machine. | 647 // This event should only get signaled on a Windows machine. |
648 NOTREACHED(); | 648 NOTREACHED(); |
649 #endif // defined(OS_WIN) | 649 #endif // defined(OS_WIN) |
650 } | 650 } |
651 | 651 |
652 void PluginServiceImpl::RegisterPepperPlugins() { | 652 void PluginServiceImpl::RegisterPepperPlugins() { |
653 // TODO(abarth): It seems like the PepperPluginRegistry should do this work. | 653 ComputePepperPluginList(&ppapi_plugins_); |
654 PepperPluginRegistry::ComputeList(&ppapi_plugins_); | |
655 for (size_t i = 0; i < ppapi_plugins_.size(); ++i) { | 654 for (size_t i = 0; i < ppapi_plugins_.size(); ++i) { |
656 RegisterInternalPlugin(ppapi_plugins_[i].ToWebPluginInfo(), true); | 655 RegisterInternalPlugin(ppapi_plugins_[i].ToWebPluginInfo(), true); |
657 } | 656 } |
658 } | 657 } |
659 | 658 |
660 // There should generally be very few plugins so a brute-force search is fine. | 659 // There should generally be very few plugins so a brute-force search is fine. |
661 PepperPluginInfo* PluginServiceImpl::GetRegisteredPpapiPluginInfo( | 660 PepperPluginInfo* PluginServiceImpl::GetRegisteredPpapiPluginInfo( |
662 const base::FilePath& plugin_path) { | 661 const base::FilePath& plugin_path) { |
663 PepperPluginInfo* info = NULL; | 662 PepperPluginInfo* info = NULL; |
664 for (size_t i = 0; i < ppapi_plugins_.size(); i++) { | 663 for (size_t i = 0; i < ppapi_plugins_.size(); i++) { |
(...skipping 173 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
838 window, kPluginVersionAtomProperty, plugin_version); | 837 window, kPluginVersionAtomProperty, plugin_version); |
839 return true; | 838 return true; |
840 } | 839 } |
841 | 840 |
842 bool PluginServiceImpl::IsPluginWindow(HWND window) { | 841 bool PluginServiceImpl::IsPluginWindow(HWND window) { |
843 return ui::GetClassName(window) == base::string16(kNativeWindowClassName); | 842 return ui::GetClassName(window) == base::string16(kNativeWindowClassName); |
844 } | 843 } |
845 #endif | 844 #endif |
846 | 845 |
847 } // namespace content | 846 } // namespace content |
OLD | NEW |