| Index: chrome/browser/plugins/chrome_plugin_service_filter.cc
|
| ===================================================================
|
| --- chrome/browser/plugins/chrome_plugin_service_filter.cc (revision 240362)
|
| +++ chrome/browser/plugins/chrome_plugin_service_filter.cc (working copy)
|
| @@ -4,21 +4,34 @@
|
|
|
| #include "chrome/browser/plugins/chrome_plugin_service_filter.h"
|
|
|
| +#include "base/bind.h"
|
| #include "base/logging.h"
|
| #include "base/strings/utf_string_conversions.h"
|
| #include "chrome/browser/chrome_notification_types.h"
|
| #include "chrome/browser/plugins/plugin_metadata.h"
|
| #include "chrome/browser/plugins/plugin_prefs.h"
|
| #include "chrome/browser/profiles/profile.h"
|
| +#include "chrome/common/render_messages.h"
|
| #include "content/public/browser/browser_thread.h"
|
| #include "content/public/browser/notification_service.h"
|
| #include "content/public/browser/plugin_service.h"
|
| +#include "content/public/browser/render_frame_host.h"
|
| #include "content/public/browser/render_process_host.h"
|
| #include "content/public/browser/resource_context.h"
|
| +#include "content/public/browser/web_contents.h"
|
|
|
| using content::BrowserThread;
|
| using content::PluginService;
|
|
|
| +namespace {
|
| +
|
| +void AuthorizeRenderer(content::RenderFrameHost* render_frame_host) {
|
| + ChromePluginServiceFilter::GetInstance()->AuthorizePlugin(
|
| + render_frame_host->GetProcess()->GetID(), base::FilePath());
|
| +}
|
| +
|
| +}
|
| +
|
| // static
|
| ChromePluginServiceFilter* ChromePluginServiceFilter::GetInstance() {
|
| return Singleton<ChromePluginServiceFilter>::get();
|
| @@ -156,8 +169,16 @@
|
| details->authorized_plugins.insert(plugin_path);
|
| }
|
|
|
| -void ChromePluginServiceFilter::AuthorizeAllPlugins(int render_process_id) {
|
| - AuthorizePlugin(render_process_id, base::FilePath());
|
| +void ChromePluginServiceFilter::AuthorizeAllPlugins(
|
| + content::WebContents* web_contents,
|
| + bool load_blocked,
|
| + const std::string& identifier) {
|
| + DCHECK(BrowserThread::CurrentlyOn(BrowserThread::UI));
|
| + web_contents->ForEachFrame(base::Bind(&AuthorizeRenderer));
|
| + if (load_blocked) {
|
| + web_contents->SendToAllFrames(new ChromeViewMsg_LoadBlockedPlugins(
|
| + MSG_ROUTING_NONE, identifier));
|
| + }
|
| }
|
|
|
| ChromePluginServiceFilter::ChromePluginServiceFilter() {
|
|
|