Chromium Code Reviews| Index: content/browser/renderer_host/buffered_resource_handler.cc |
| diff --git a/content/browser/renderer_host/buffered_resource_handler.cc b/content/browser/renderer_host/buffered_resource_handler.cc |
| index 8626682130365910e95ff966f7a87c74ac9f180c..9cf055919d8e2761522eae170a28efa646b8d117 100644 |
| --- a/content/browser/renderer_host/buffered_resource_handler.cc |
| +++ b/content/browser/renderer_host/buffered_resource_handler.cc |
| @@ -12,6 +12,7 @@ |
| #include "chrome/browser/renderer_host/download_throttling_resource_handler.h" |
| #include "content/browser/browser_thread.h" |
| #include "content/browser/content_browser_client.h" |
| +#include "content/browser/plugin_service.h" |
| #include "content/browser/renderer_host/resource_dispatcher_host.h" |
| #include "content/browser/renderer_host/resource_dispatcher_host_delegate.h" |
| #include "content/browser/renderer_host/resource_dispatcher_host_request_info.h" |
| @@ -388,10 +389,16 @@ bool BufferedResourceHandler::ShouldDownload(bool* need_plugin_list) { |
| // Finally, check the plugin list. |
| bool allow_wildcard = false; |
| + ResourceDispatcherHostRequestInfo* info = |
| + ResourceDispatcherHost::InfoForRequest(request_); |
| + content::BrowserContext* browser_context = NULL; // XXX |
|
Bernhard Bauer
2011/08/03 14:47:33
This is the only problem; I don't have a BrowserCo
jam
2011/08/03 16:20:43
Why not use ResourceContext instead of BrowserCont
Bernhard Bauer
2011/08/03 16:45:36
Because a BrowserContext is a Profile, and we alre
|
| bool stale = false; |
| - std::vector<webkit::npapi::WebPluginInfo> plugins; |
| - webkit::npapi::PluginList::Singleton()->GetPluginInfoArray( |
| - request_->url(), type, allow_wildcard, &stale, &plugins, NULL); |
| + webkit::npapi::WebPluginInfo plugin; |
| + bool found = PluginService::GetInstance()->GetPluginInfo( |
| + info->child_id(), info->route_id(), browser_context, |
| + request_->url(), GURL(), type, allow_wildcard, |
| + &stale, &plugin, NULL); |
| + |
| if (need_plugin_list) { |
| if (stale) { |
| *need_plugin_list = true; |
| @@ -401,11 +408,7 @@ bool BufferedResourceHandler::ShouldDownload(bool* need_plugin_list) { |
| DCHECK(!stale); |
| } |
| - for (size_t i = 0; i < plugins.size(); ++i) { |
| - if (webkit::npapi::IsPluginEnabled(plugins[i])) |
| - return false; |
| - } |
| - return true; |
| + return !found; |
| } |
| void BufferedResourceHandler::UseAlternateResourceHandler( |