| OLD | NEW |
| 1 // Copyright (c) 2011 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2011 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.h" | 5 #include "content/browser/plugin_service.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/file_path.h" | 10 #include "base/file_path.h" |
| 11 #include "base/message_loop.h" | 11 #include "base/message_loop.h" |
| 12 #include "base/message_loop_proxy.h" | 12 #include "base/message_loop_proxy.h" |
| 13 #include "base/path_service.h" | 13 #include "base/path_service.h" |
| 14 #include "base/string_util.h" | 14 #include "base/string_util.h" |
| 15 #include "base/synchronization/waitable_event.h" | 15 #include "base/synchronization/waitable_event.h" |
| 16 #include "base/threading/thread.h" | 16 #include "base/threading/thread.h" |
| 17 #include "base/utf_string_conversions.h" | 17 #include "base/utf_string_conversions.h" |
| 18 #include "base/values.h" | 18 #include "base/values.h" |
| 19 #include "content/browser/plugin_loader_posix.h" | 19 #include "content/browser/plugin_loader_posix.h" |
| 20 #include "content/browser/plugin_service_filter.h" | 20 #include "content/browser/plugin_service_filter.h" |
| 21 #include "content/browser/ppapi_plugin_process_host.h" | 21 #include "content/browser/ppapi_plugin_process_host.h" |
| 22 #include "content/browser/renderer_host/render_process_host.h" | 22 #include "content/browser/renderer_host/render_process_host_impl.h" |
| 23 #include "content/browser/renderer_host/render_view_host.h" | 23 #include "content/browser/renderer_host/render_view_host.h" |
| 24 #include "content/browser/resource_context.h" | 24 #include "content/browser/resource_context.h" |
| 25 #include "content/browser/utility_process_host.h" | 25 #include "content/browser/utility_process_host.h" |
| 26 #include "content/common/pepper_plugin_registry.h" | 26 #include "content/common/pepper_plugin_registry.h" |
| 27 #include "content/common/plugin_messages.h" | 27 #include "content/common/plugin_messages.h" |
| 28 #include "content/common/utility_messages.h" | 28 #include "content/common/utility_messages.h" |
| 29 #include "content/common/view_messages.h" | 29 #include "content/common/view_messages.h" |
| 30 #include "content/public/browser/browser_thread.h" | 30 #include "content/public/browser/browser_thread.h" |
| 31 #include "content/public/browser/content_browser_client.h" | 31 #include "content/public/browser/content_browser_client.h" |
| 32 #include "content/public/browser/notification_service.h" | 32 #include "content/public/browser/notification_service.h" |
| (...skipping 533 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 566 NewRunnableFunction(&NotifyPluginsOfActivation)); | 566 NewRunnableFunction(&NotifyPluginsOfActivation)); |
| 567 return; | 567 return; |
| 568 } | 568 } |
| 569 #endif | 569 #endif |
| 570 NOTREACHED(); | 570 NOTREACHED(); |
| 571 } | 571 } |
| 572 | 572 |
| 573 void PluginService::PurgePluginListCache( | 573 void PluginService::PurgePluginListCache( |
| 574 content::BrowserContext* browser_context, | 574 content::BrowserContext* browser_context, |
| 575 bool reload_pages) { | 575 bool reload_pages) { |
| 576 for (RenderProcessHost::iterator it = RenderProcessHost::AllHostsIterator(); | 576 for (content::RenderProcessHost::iterator it = |
| 577 content::RenderProcessHost::AllHostsIterator(); |
| 577 !it.IsAtEnd(); it.Advance()) { | 578 !it.IsAtEnd(); it.Advance()) { |
| 578 RenderProcessHost* host = it.GetCurrentValue(); | 579 content::RenderProcessHost* host = it.GetCurrentValue(); |
| 579 if (!browser_context || host->browser_context() == browser_context) | 580 if (!browser_context || host->GetBrowserContext() == browser_context) |
| 580 host->Send(new ViewMsg_PurgePluginListCache(reload_pages)); | 581 host->Send(new ViewMsg_PurgePluginListCache(reload_pages)); |
| 581 } | 582 } |
| 582 } | 583 } |
| 583 | 584 |
| 584 void PluginService::RegisterPepperPlugins() { | 585 void PluginService::RegisterPepperPlugins() { |
| 585 // TODO(abarth): It seems like the PepperPluginRegistry should do this work. | 586 // TODO(abarth): It seems like the PepperPluginRegistry should do this work. |
| 586 PepperPluginRegistry::ComputeList(&ppapi_plugins_); | 587 PepperPluginRegistry::ComputeList(&ppapi_plugins_); |
| 587 for (size_t i = 0; i < ppapi_plugins_.size(); ++i) { | 588 for (size_t i = 0; i < ppapi_plugins_.size(); ++i) { |
| 588 RegisterInternalPlugin(ppapi_plugins_[i].ToWebPluginInfo()); | 589 RegisterInternalPlugin(ppapi_plugins_[i].ToWebPluginInfo()); |
| 589 } | 590 } |
| (...skipping 58 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 648 plugin_list_ = plugin_list; | 649 plugin_list_ = plugin_list; |
| 649 } | 650 } |
| 650 | 651 |
| 651 void PluginService::RegisterInternalPlugin(const webkit::WebPluginInfo& info) { | 652 void PluginService::RegisterInternalPlugin(const webkit::WebPluginInfo& info) { |
| 652 plugin_list()->RegisterInternalPlugin(info); | 653 plugin_list()->RegisterInternalPlugin(info); |
| 653 } | 654 } |
| 654 | 655 |
| 655 string16 PluginService::GetPluginGroupName(const std::string& plugin_name) { | 656 string16 PluginService::GetPluginGroupName(const std::string& plugin_name) { |
| 656 return plugin_list()->GetPluginGroupName(plugin_name); | 657 return plugin_list()->GetPluginGroupName(plugin_name); |
| 657 } | 658 } |
| OLD | NEW |