Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(219)

Unified Diff: chrome/renderer/chrome_content_renderer_client.cc

Issue 10823434: [6] Moves CreateVersionFromString to plugin_utils and updates the callers. (Closed) Base URL: http://git.chromium.org/chromium/src.git@master
Patch Set: 2nd CL in series to delete PluginGroup. Created 8 years, 4 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
Index: chrome/renderer/chrome_content_renderer_client.cc
diff --git a/chrome/renderer/chrome_content_renderer_client.cc b/chrome/renderer/chrome_content_renderer_client.cc
index 168a585aa14394aa6a8224d3795d4567f92bebda..5c2de7097fab9055c8c068ee06d2c86d829de48b 100644
--- a/chrome/renderer/chrome_content_renderer_client.cc
+++ b/chrome/renderer/chrome_content_renderer_client.cc
@@ -14,6 +14,7 @@
#include "base/string_tokenizer.h"
#include "base/utf_string_conversions.h"
#include "base/values.h"
+#include "chrome/browser/plugin_installer.h"
ibraaaa 2012/08/21 17:27:12 Presubmit checks won't pass because of this includ
Bernhard Bauer 2012/08/21 19:14:52 The issue isn't chrome, it's that you're depending
#include "chrome/common/child_process_logging.h"
#include "chrome/common/chrome_content_client.h"
#include "chrome/common/chrome_paths.h"
@@ -390,9 +391,7 @@ 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();
+ string16 name = PluginInstaller::GetGroupName(plugin);
// TODO(bauerb): This should be in content/.
WebPluginParams params(original_params);
@@ -423,11 +422,12 @@ WebPlugin* ChromeContentRendererClient::CreatePlugin(
is_nacl_plugin ? CONTENT_SETTINGS_TYPE_JAVASCRIPT :
CONTENT_SETTINGS_TYPE_PLUGINS;
+ std::string identifier = PluginInstaller::GetIdentifier(plugin);
if ((status_value ==
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;
}
@@ -482,7 +482,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, name,
IDR_BLOCKED_PLUGIN_HTML, IDS_PLUGIN_BLOCKED);
break;
}
@@ -494,7 +494,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, name,
IDR_CLICK_TO_PLAY_PLUGIN_HTML, IDS_PLUGIN_LOAD);
placeholder->set_blocked_for_prerendering(true);
placeholder->set_allow_loading(true);
@@ -505,19 +505,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, 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, 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
@@ -525,37 +525,35 @@ 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, 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, 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()));
+ render_view->GetRoutingID(), 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, 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, 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;
}
}

Powered by Google App Engine
This is Rietveld 408576698