summaryrefslogtreecommitdiffstats
path: root/chrome/renderer
diff options
context:
space:
mode:
authoribraaaa@google.com <ibraaaa@google.com@0039d316-1c4b-4281-b951-d872f2087c98>2012-09-21 12:53:04 +0000
committeribraaaa@google.com <ibraaaa@google.com@0039d316-1c4b-4281-b951-d872f2087c98>2012-09-21 12:53:04 +0000
commitcd33d288fb0817bd3b563f6df51e163f12bba816 (patch)
tree231d9824a647219e88146b99870053afd9bc3dcf /chrome/renderer
parent38a1c18941e670cd18ac5aa719e942f5037f6b05 (diff)
downloadchromium_src-cd33d288fb0817bd3b563f6df51e163f12bba816.zip
chromium_src-cd33d288fb0817bd3b563f6df51e163f12bba816.tar.gz
chromium_src-cd33d288fb0817bd3b563f6df51e163f12bba816.tar.bz2
Removes PluginInfoMessageFilter dependency on PluginGroup.
BUG=124396 Review URL: https://chromiumcodereview.appspot.com/10951029 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@157966 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'chrome/renderer')
-rw-r--r--chrome/renderer/chrome_content_renderer_client.cc52
-rw-r--r--chrome/renderer/chrome_content_renderer_client.h6
-rw-r--r--chrome/renderer/plugins/plugin_placeholder.cc12
3 files changed, 30 insertions, 40 deletions
diff --git a/chrome/renderer/chrome_content_renderer_client.cc b/chrome/renderer/chrome_content_renderer_client.cc
index c692fa2..76a34dd 100644
--- a/chrome/renderer/chrome_content_renderer_client.cc
+++ b/chrome/renderer/chrome_content_renderer_client.cc
@@ -311,11 +311,7 @@ bool ChromeContentRendererClient::OverrideCreatePlugin(
WebFrame* frame,
const WebPluginParams& params,
WebPlugin** plugin) {
- ChromeViewHostMsg_GetPluginInfo_Status status;
- webkit::WebPluginInfo plugin_info;
- std::string actual_mime_type;
std::string orig_mime_type = params.mimeType.utf8();
-
if (orig_mime_type == content::kBrowserPluginNewMimeType ||
((orig_mime_type == content::kBrowserPluginMimeType) &&
extensions::ExtensionHelper::Get(render_view)->view_type() ==
@@ -323,12 +319,11 @@ bool ChromeContentRendererClient::OverrideCreatePlugin(
return false;
}
+ ChromeViewHostMsg_GetPluginInfo_Output output;
render_view->Send(new ChromeViewHostMsg_GetPluginInfo(
render_view->GetRoutingID(), GURL(params.url),
- frame->top()->document().url(), orig_mime_type,
- &status, &plugin_info, &actual_mime_type));
- *plugin = CreatePlugin(render_view, frame, params,
- status, plugin_info, actual_mime_type);
+ frame->top()->document().url(), orig_mime_type, &output));
+ *plugin = CreatePlugin(render_view, frame, params, output);
return true;
}
@@ -369,9 +364,12 @@ WebPlugin* ChromeContentRendererClient::CreatePlugin(
content::RenderView* render_view,
WebFrame* frame,
const WebPluginParams& original_params,
- const ChromeViewHostMsg_GetPluginInfo_Status& status,
- const webkit::WebPluginInfo& plugin,
- const std::string& actual_mime_type) {
+ const ChromeViewHostMsg_GetPluginInfo_Output& output) {
+ const ChromeViewHostMsg_GetPluginInfo_Status& status = output.status;
+ const webkit::WebPluginInfo& plugin = output.plugin;
+ const std::string& actual_mime_type = output.actual_mime_type;
+ const string16& group_name = output.group_name;
+ const std::string& identifier = output.group_identifier;
ChromeViewHostMsg_GetPluginInfo_Status::Value status_value = status.value;
GURL url(original_params.url);
std::string orig_mime_type = original_params.mimeType.utf8();
@@ -392,10 +390,6 @@ WebPlugin* ChromeContentRendererClient::CreatePlugin(
placeholder = PluginPlaceholder::CreateMissingPlugin(
render_view, frame, original_params);
} else {
- scoped_ptr<webkit::npapi::PluginGroup> group(
- webkit::npapi::PluginList::Singleton()->GetPluginGroup(plugin));
- string16 name = group->GetGroupName();
-
// TODO(bauerb): This should be in content/.
WebPluginParams params(original_params);
for (size_t i = 0; i < plugin.mime_types.size(); ++i) {
@@ -429,7 +423,7 @@ WebPlugin* ChromeContentRendererClient::CreatePlugin(
ChromeViewHostMsg_GetPluginInfo_Status::kUnauthorized ||
status_value == ChromeViewHostMsg_GetPluginInfo_Status::kClickToPlay ||
status_value == ChromeViewHostMsg_GetPluginInfo_Status::kBlocked) &&
- observer->IsPluginTemporarilyAllowed(group->identifier())) {
+ observer->IsPluginTemporarilyAllowed(identifier)) {
status_value = ChromeViewHostMsg_GetPluginInfo_Status::kAllowed;
}
@@ -484,7 +478,7 @@ WebPlugin* ChromeContentRendererClient::CreatePlugin(
"Chrome Web Store can load NaCl modules without enabling "
"Native Client in about:flags."));
placeholder = PluginPlaceholder::CreateBlockedPlugin(
- render_view, frame, params, plugin, group->identifier(), name,
+ render_view, frame, params, plugin, identifier, group_name,
IDR_BLOCKED_PLUGIN_HTML, IDS_PLUGIN_BLOCKED);
break;
}
@@ -496,7 +490,7 @@ WebPlugin* ChromeContentRendererClient::CreatePlugin(
// reduce the chance of future regressions.
if (prerender::PrerenderHelper::IsPrerendering(render_view)) {
placeholder = PluginPlaceholder::CreateBlockedPlugin(
- render_view, frame, params, plugin, group->identifier(), name,
+ render_view, frame, params, plugin, identifier, group_name,
IDR_CLICK_TO_PLAY_PLUGIN_HTML, IDS_PLUGIN_LOAD);
placeholder->set_blocked_for_prerendering(true);
placeholder->set_allow_loading(true);
@@ -507,19 +501,19 @@ WebPlugin* ChromeContentRendererClient::CreatePlugin(
}
case ChromeViewHostMsg_GetPluginInfo_Status::kDisabled: {
placeholder = PluginPlaceholder::CreateBlockedPlugin(
- render_view, frame, params, plugin, group->identifier(), name,
+ render_view, frame, params, plugin, identifier, group_name,
IDR_DISABLED_PLUGIN_HTML, IDS_PLUGIN_DISABLED);
break;
}
case ChromeViewHostMsg_GetPluginInfo_Status::kOutdatedBlocked: {
#if defined(ENABLE_PLUGIN_INSTALLATION)
placeholder = PluginPlaceholder::CreateBlockedPlugin(
- render_view, frame, params, plugin, group->identifier(), name,
+ render_view, frame, params, plugin, identifier, group_name,
IDR_BLOCKED_PLUGIN_HTML, IDS_PLUGIN_OUTDATED);
placeholder->set_allow_loading(true);
render_view->Send(new ChromeViewHostMsg_BlockedOutdatedPlugin(
render_view->GetRoutingID(), placeholder->CreateRoutingId(),
- group->identifier()));
+ identifier));
#else
NOTREACHED();
#endif
@@ -527,37 +521,37 @@ WebPlugin* ChromeContentRendererClient::CreatePlugin(
}
case ChromeViewHostMsg_GetPluginInfo_Status::kOutdatedDisallowed: {
placeholder = PluginPlaceholder::CreateBlockedPlugin(
- render_view, frame, params, plugin, group->identifier(), name,
+ render_view, frame, params, plugin, identifier, group_name,
IDR_BLOCKED_PLUGIN_HTML, IDS_PLUGIN_OUTDATED);
break;
}
case ChromeViewHostMsg_GetPluginInfo_Status::kUnauthorized: {
placeholder = PluginPlaceholder::CreateBlockedPlugin(
- render_view, frame, params, plugin, group->identifier(), name,
+ render_view, frame, params, plugin, identifier, group_name,
IDR_BLOCKED_PLUGIN_HTML, IDS_PLUGIN_NOT_AUTHORIZED);
placeholder->set_allow_loading(true);
render_view->Send(new ChromeViewHostMsg_BlockedUnauthorizedPlugin(
render_view->GetRoutingID(),
- group->GetGroupName(),
- group->identifier()));
+ group_name,
+ identifier));
break;
}
case ChromeViewHostMsg_GetPluginInfo_Status::kClickToPlay: {
placeholder = PluginPlaceholder::CreateBlockedPlugin(
- render_view, frame, params, plugin, group->identifier(), name,
+ render_view, frame, params, plugin, identifier, group_name,
IDR_CLICK_TO_PLAY_PLUGIN_HTML, IDS_PLUGIN_LOAD);
placeholder->set_allow_loading(true);
RenderThread::Get()->RecordUserMetrics("Plugin_ClickToPlay");
- observer->DidBlockContentType(content_type, group->identifier());
+ observer->DidBlockContentType(content_type, identifier);
break;
}
case ChromeViewHostMsg_GetPluginInfo_Status::kBlocked: {
placeholder = PluginPlaceholder::CreateBlockedPlugin(
- render_view, frame, params, plugin, group->identifier(), name,
+ render_view, frame, params, plugin, identifier, group_name,
IDR_BLOCKED_PLUGIN_HTML, IDS_PLUGIN_BLOCKED);
placeholder->set_allow_loading(true);
RenderThread::Get()->RecordUserMetrics("Plugin_Blocked");
- observer->DidBlockContentType(content_type, group->identifier());
+ observer->DidBlockContentType(content_type, identifier);
break;
}
}
diff --git a/chrome/renderer/chrome_content_renderer_client.h b/chrome/renderer/chrome_content_renderer_client.h
index c1abf0f..018f561 100644
--- a/chrome/renderer/chrome_content_renderer_client.h
+++ b/chrome/renderer/chrome_content_renderer_client.h
@@ -20,7 +20,7 @@ class SpellCheck;
class SpellCheckProvider;
class VisitedLinkSlave;
-struct ChromeViewHostMsg_GetPluginInfo_Status;
+struct ChromeViewHostMsg_GetPluginInfo_Output;
namespace extensions {
class Dispatcher;
@@ -141,9 +141,7 @@ class ChromeContentRendererClient : public content::ContentRendererClient {
content::RenderView* render_view,
WebKit::WebFrame* frame,
const WebKit::WebPluginParams& params,
- const ChromeViewHostMsg_GetPluginInfo_Status& status,
- const webkit::WebPluginInfo& plugin,
- const std::string& actual_mime_type);
+ const ChromeViewHostMsg_GetPluginInfo_Output& output);
private:
FRIEND_TEST_ALL_PREFIXES(ChromeContentRendererClientTest, NaClRestriction);
diff --git a/chrome/renderer/plugins/plugin_placeholder.cc b/chrome/renderer/plugins/plugin_placeholder.cc
index af0041b..c1b3158 100644
--- a/chrome/renderer/plugins/plugin_placeholder.cc
+++ b/chrome/renderer/plugins/plugin_placeholder.cc
@@ -433,21 +433,19 @@ void PluginPlaceholder::PluginListChanged() {
if (document.isNull())
return;
- ChromeViewHostMsg_GetPluginInfo_Status status;
- webkit::WebPluginInfo plugin_info;
+ ChromeViewHostMsg_GetPluginInfo_Output output;
std::string mime_type(plugin_params_.mimeType.utf8());
- std::string actual_mime_type;
render_view()->Send(new ChromeViewHostMsg_GetPluginInfo(
routing_id(), GURL(plugin_params_.url), document.url(),
- mime_type, &status, &plugin_info, &actual_mime_type));
- if (status.value == status_->value)
+ mime_type, &output));
+
+ if (output.status.value == status_->value)
return;
chrome::ChromeContentRendererClient* client =
static_cast<chrome::ChromeContentRendererClient*>(
content::GetContentClient()->renderer());
WebPlugin* new_plugin =
- client->CreatePlugin(render_view(), frame_, plugin_params_,
- status, plugin_info, actual_mime_type);
+ client->CreatePlugin(render_view(), frame_, plugin_params_, output);
ReplacePlugin(new_plugin);
}