Index: content/browser/renderer_host/render_message_filter.cc |
diff --git a/content/browser/renderer_host/render_message_filter.cc b/content/browser/renderer_host/render_message_filter.cc |
index 0e076ca6174b3641e10fbb750be9f14e85f64aac..222899e9eeec769f2d158d8473094590e497b035 100644 |
--- a/content/browser/renderer_host/render_message_filter.cc |
+++ b/content/browser/renderer_host/render_message_filter.cc |
@@ -67,6 +67,7 @@ |
#endif |
using net::CookieStore; |
+using content::PluginServiceFilter; |
namespace { |
@@ -118,27 +119,34 @@ class OpenChannelToNpapiPluginCallback : public RenderMessageCompletionCallback, |
public PluginProcessHost::Client { |
public: |
OpenChannelToNpapiPluginCallback(RenderMessageFilter* filter, |
+ content::BrowserContext* context, |
IPC::Message* reply_msg) |
- : RenderMessageCompletionCallback(filter, reply_msg) { |
+ : RenderMessageCompletionCallback(filter, reply_msg), |
+ context_(context) { |
} |
- virtual int ID() { |
+ virtual int ID() OVERRIDE { |
return filter()->render_process_id(); |
} |
- virtual bool OffTheRecord() { |
+ virtual content::BrowserContext* GetBrowserContext() OVERRIDE { |
+ return context_; |
+ } |
+ |
+ virtual bool OffTheRecord() OVERRIDE { |
return filter()->OffTheRecord(); |
} |
- virtual void SetPluginInfo(const webkit::npapi::WebPluginInfo& info) { |
+ virtual void SetPluginInfo( |
+ const webkit::npapi::WebPluginInfo& info) OVERRIDE { |
info_ = info; |
} |
- virtual void OnChannelOpened(const IPC::ChannelHandle& handle) { |
+ virtual void OnChannelOpened(const IPC::ChannelHandle& handle) OVERRIDE { |
WriteReplyAndDeleteThis(handle); |
} |
- virtual void OnError() { |
+ virtual void OnError() OVERRIDE { |
WriteReplyAndDeleteThis(IPC::ChannelHandle()); |
} |
@@ -149,6 +157,7 @@ class OpenChannelToNpapiPluginCallback : public RenderMessageCompletionCallback, |
SendReplyAndDeleteThis(); |
} |
+ content::BrowserContext* context_; |
webkit::npapi::WebPluginInfo info_; |
}; |
@@ -532,38 +541,36 @@ void RenderMessageFilter::OnGetPlugins( |
} |
} |
- std::vector<webkit::npapi::WebPluginInfo> all_plugins; |
- webkit::npapi::PluginList::Singleton()->GetPlugins(&all_plugins); |
- for (size_t i = 0; i < all_plugins.size(); ++i) { |
- if (webkit::npapi::IsPluginEnabled(all_plugins[i])) |
- plugins->push_back(all_plugins[i]); |
- } |
+ PluginService::GetInstance()->GetPlugins(browser_context_, |
+ plugins); |
} |
void RenderMessageFilter::OnGetPluginInfo( |
int routing_id, |
const GURL& url, |
- const GURL& policy_url, |
+ const GURL& page_url, |
const std::string& mime_type, |
bool* found, |
webkit::npapi::WebPluginInfo* info, |
std::string* actual_mime_type) { |
+ bool allow_wildcard = true; |
*found = plugin_service_->GetPluginInfo( |
- render_process_id_, routing_id, url, mime_type, info, actual_mime_type); |
- |
- if (*found) { |
- if (!plugin_service_->PluginAllowedForURL(info->path, policy_url)) |
- info->enabled |= webkit::npapi::WebPluginInfo::POLICY_DISABLED; |
- } |
+ render_process_id_, routing_id, browser_context_, |
+ url, page_url, mime_type, allow_wildcard, |
+ NULL, info, actual_mime_type); |
} |
void RenderMessageFilter::OnOpenChannelToPlugin(int routing_id, |
const GURL& url, |
+ const GURL& policy_url, |
const std::string& mime_type, |
IPC::Message* reply_msg) { |
plugin_service_->OpenChannelToNpapiPlugin( |
- render_process_id_, routing_id, url, mime_type, |
- new OpenChannelToNpapiPluginCallback(this, reply_msg)); |
+ render_process_id_, routing_id, |
+ url, policy_url, mime_type, |
+ new OpenChannelToNpapiPluginCallback(this, |
+ browser_context_, |
+ reply_msg)); |
} |
void RenderMessageFilter::OnOpenChannelToPepperPlugin( |