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

Unified Diff: chrome/renderer/chrome_content_renderer_client.cc

Issue 23606022: Move renderer plugin code into a new component. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Move renderer plugin code into a new component - put back wrongly deleted DEPS file Created 7 years, 3 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 7f4bfe242cfb23406a98e1f18063aad9f4542d68..ebaf631db8a12f67c5bde54003e41867cfa26d4a 100644
--- a/chrome/renderer/chrome_content_renderer_client.cc
+++ b/chrome/renderer/chrome_content_renderer_client.cc
@@ -49,8 +49,7 @@
#include "chrome/renderer/pepper/ppb_nacl_private_impl.h"
#include "chrome/renderer/pepper/ppb_pdf_impl.h"
#include "chrome/renderer/playback_extension.h"
-#include "chrome/renderer/plugins/plugin_placeholder.h"
-#include "chrome/renderer/plugins/plugin_uma.h"
+#include "chrome/renderer/plugins/chrome_plugin_placeholder.h"
#include "chrome/renderer/prerender/prerender_dispatcher.h"
#include "chrome/renderer/prerender/prerender_helper.h"
#include "chrome/renderer/prerender/prerender_media_load_deferrer.h"
@@ -65,6 +64,7 @@
#include "components/autofill/content/renderer/autofill_agent.h"
#include "components/autofill/content/renderer/password_autofill_agent.h"
#include "components/autofill/content/renderer/password_generation_manager.h"
+#include "components/plugins/renderer/plugin_uma.h"
#include "components/visitedlink/renderer/visitedlink_slave.h"
#include "content/public/common/content_constants.h"
#include "content/public/renderer/render_thread.h"
@@ -461,8 +461,8 @@ bool ChromeContentRendererClient::OverrideCreatePlugin(
WebPlugin* ChromeContentRendererClient::CreatePluginReplacement(
content::RenderView* render_view,
const base::FilePath& plugin_path) {
- PluginPlaceholder* placeholder =
- PluginPlaceholder::CreateErrorPlugin(render_view, plugin_path);
+ ChromePluginPlaceholder* placeholder =
+ ChromePluginPlaceholder::CreateErrorPlugin(render_view, plugin_path);
return placeholder->plugin();
}
@@ -497,7 +497,7 @@ WebPlugin* ChromeContentRendererClient::CreatePlugin(
ChromeViewHostMsg_GetPluginInfo_Status::Value status_value = status.value;
GURL url(original_params.url);
std::string orig_mime_type = original_params.mimeType.utf8();
- PluginPlaceholder* placeholder = NULL;
+ ChromePluginPlaceholder* placeholder = NULL;
// If the browser plugin is to be enabled, this should be handled by the
// renderer, so the code won't reach here due to the early exit in
@@ -505,12 +505,12 @@ WebPlugin* ChromeContentRendererClient::CreatePlugin(
if (status_value == ChromeViewHostMsg_GetPluginInfo_Status::kNotFound ||
orig_mime_type == content::kBrowserPluginMimeType) {
#if defined(ENABLE_MOBILE_YOUTUBE_PLUGIN)
- if (PluginPlaceholder::IsYouTubeURL(url, orig_mime_type))
- return PluginPlaceholder::CreateMobileYoutubePlugin(render_view, frame,
- original_params)->plugin();
+ if (ChromePluginPlaceholder::IsYouTubeURL(url, orig_mime_type))
+ return ChromePluginPlaceholder::CreateMobileYoutubePlugin(
+ render_view, frame, original_params)->plugin();
#endif
PluginUMAReporter::GetInstance()->ReportPluginMissing(orig_mime_type, url);
- placeholder = PluginPlaceholder::CreateMissingPlugin(
+ placeholder = ChromePluginPlaceholder::CreateMissingPlugin(
render_view, frame, original_params);
} else {
// TODO(bauerb): This should be in content/.
@@ -582,8 +582,13 @@ WebPlugin* ChromeContentRendererClient::CreatePlugin(
WebConsoleMessage::LevelError,
"Portable Native Client must not be disabled in"
" about:flags."));
- placeholder = PluginPlaceholder::CreateBlockedPlugin(
- render_view, frame, params, plugin, identifier, group_name,
+ placeholder = ChromePluginPlaceholder::CreateBlockedPlugin(
+ render_view,
+ frame,
+ params,
+ plugin,
+ identifier,
+ group_name,
IDR_BLOCKED_PLUGIN_HTML,
#if defined(OS_CHROMEOS)
l10n_util::GetStringUTF16(IDS_NACL_PLUGIN_BLOCKED));
@@ -634,8 +639,13 @@ WebPlugin* ChromeContentRendererClient::CreatePlugin(
"Only unpacked extensions and apps installed from the "
"Chrome Web Store can load NaCl modules without enabling "
"Native Client in about:flags."));
- placeholder = PluginPlaceholder::CreateBlockedPlugin(
- render_view, frame, params, plugin, identifier, group_name,
+ placeholder = ChromePluginPlaceholder::CreateBlockedPlugin(
+ render_view,
+ frame,
+ params,
+ plugin,
+ identifier,
+ group_name,
IDR_BLOCKED_PLUGIN_HTML,
#if defined(OS_CHROMEOS)
l10n_util::GetStringUTF16(IDS_NACL_PLUGIN_BLOCKED));
@@ -652,8 +662,13 @@ WebPlugin* ChromeContentRendererClient::CreatePlugin(
// ChromeContentRendererClient::CreatePlugin instead, to
// reduce the chance of future regressions.
if (prerender::PrerenderHelper::IsPrerendering(render_view)) {
- placeholder = PluginPlaceholder::CreateBlockedPlugin(
- render_view, frame, params, plugin, identifier, group_name,
+ placeholder = ChromePluginPlaceholder::CreateBlockedPlugin(
+ render_view,
+ frame,
+ params,
+ plugin,
+ identifier,
+ group_name,
IDR_CLICK_TO_PLAY_PLUGIN_HTML,
l10n_util::GetStringFUTF16(IDS_PLUGIN_LOAD, group_name));
placeholder->set_blocked_for_prerendering(true);
@@ -665,8 +680,13 @@ WebPlugin* ChromeContentRendererClient::CreatePlugin(
}
case ChromeViewHostMsg_GetPluginInfo_Status::kNPAPINotSupported: {
RenderThread::Get()->RecordUserMetrics("Plugin_NPAPINotSupported");
- placeholder = PluginPlaceholder::CreateBlockedPlugin(
- render_view, frame, params, plugin, identifier, group_name,
+ placeholder = ChromePluginPlaceholder::CreateBlockedPlugin(
+ render_view,
+ frame,
+ params,
+ plugin,
+ identifier,
+ group_name,
IDR_BLOCKED_PLUGIN_HTML,
l10n_util::GetStringUTF16(IDS_PLUGIN_NOT_SUPPORTED_METRO));
render_view->Send(new ChromeViewHostMsg_NPAPINotSupported(
@@ -676,16 +696,26 @@ WebPlugin* ChromeContentRendererClient::CreatePlugin(
case ChromeViewHostMsg_GetPluginInfo_Status::kDisabled: {
PluginUMAReporter::GetInstance()->ReportPluginDisabled(orig_mime_type,
url);
- placeholder = PluginPlaceholder::CreateBlockedPlugin(
- render_view, frame, params, plugin, identifier, group_name,
+ placeholder = ChromePluginPlaceholder::CreateBlockedPlugin(
+ render_view,
+ frame,
+ params,
+ plugin,
+ identifier,
+ group_name,
IDR_DISABLED_PLUGIN_HTML,
l10n_util::GetStringFUTF16(IDS_PLUGIN_DISABLED, group_name));
break;
}
case ChromeViewHostMsg_GetPluginInfo_Status::kOutdatedBlocked: {
#if defined(ENABLE_PLUGIN_INSTALLATION)
- placeholder = PluginPlaceholder::CreateBlockedPlugin(
- render_view, frame, params, plugin, identifier, group_name,
+ placeholder = ChromePluginPlaceholder::CreateBlockedPlugin(
+ render_view,
+ frame,
+ params,
+ plugin,
+ identifier,
+ group_name,
IDR_BLOCKED_PLUGIN_HTML,
l10n_util::GetStringFUTF16(IDS_PLUGIN_OUTDATED, group_name));
placeholder->set_allow_loading(true);
@@ -698,15 +728,25 @@ WebPlugin* ChromeContentRendererClient::CreatePlugin(
break;
}
case ChromeViewHostMsg_GetPluginInfo_Status::kOutdatedDisallowed: {
- placeholder = PluginPlaceholder::CreateBlockedPlugin(
- render_view, frame, params, plugin, identifier, group_name,
+ placeholder = ChromePluginPlaceholder::CreateBlockedPlugin(
+ render_view,
+ frame,
+ params,
+ plugin,
+ identifier,
+ group_name,
IDR_BLOCKED_PLUGIN_HTML,
l10n_util::GetStringFUTF16(IDS_PLUGIN_OUTDATED, group_name));
break;
}
case ChromeViewHostMsg_GetPluginInfo_Status::kUnauthorized: {
- placeholder = PluginPlaceholder::CreateBlockedPlugin(
- render_view, frame, params, plugin, identifier, group_name,
+ placeholder = ChromePluginPlaceholder::CreateBlockedPlugin(
+ render_view,
+ frame,
+ params,
+ plugin,
+ identifier,
+ group_name,
IDR_BLOCKED_PLUGIN_HTML,
l10n_util::GetStringFUTF16(IDS_PLUGIN_NOT_AUTHORIZED, group_name));
placeholder->set_allow_loading(true);
@@ -717,8 +757,13 @@ WebPlugin* ChromeContentRendererClient::CreatePlugin(
break;
}
case ChromeViewHostMsg_GetPluginInfo_Status::kClickToPlay: {
- placeholder = PluginPlaceholder::CreateBlockedPlugin(
- render_view, frame, params, plugin, identifier, group_name,
+ placeholder = ChromePluginPlaceholder::CreateBlockedPlugin(
+ render_view,
+ frame,
+ params,
+ plugin,
+ identifier,
+ group_name,
IDR_CLICK_TO_PLAY_PLUGIN_HTML,
l10n_util::GetStringFUTF16(IDS_PLUGIN_LOAD, group_name));
placeholder->set_allow_loading(true);
@@ -727,8 +772,13 @@ WebPlugin* ChromeContentRendererClient::CreatePlugin(
break;
}
case ChromeViewHostMsg_GetPluginInfo_Status::kBlocked: {
- placeholder = PluginPlaceholder::CreateBlockedPlugin(
- render_view, frame, params, plugin, identifier, group_name,
+ placeholder = ChromePluginPlaceholder::CreateBlockedPlugin(
+ render_view,
+ frame,
+ params,
+ plugin,
+ identifier,
+ group_name,
IDR_BLOCKED_PLUGIN_HTML,
l10n_util::GetStringFUTF16(IDS_PLUGIN_BLOCKED, group_name));
placeholder->set_allow_loading(true);

Powered by Google App Engine
This is Rietveld 408576698