| 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 4a76b19e8546e08744740d2c55b745c33ccf0013..5edc87413b49a802700c7664786f4df942efa059 100644
|
| --- a/chrome/renderer/chrome_content_renderer_client.cc
|
| +++ b/chrome/renderer/chrome_content_renderer_client.cc
|
| @@ -50,7 +50,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/chrome_plugin_placeholder.h"
|
| #include "chrome/renderer/plugins/plugin_uma.h"
|
| #include "chrome/renderer/prerender/prerender_dispatcher.h"
|
| #include "chrome/renderer/prerender/prerender_helper.h"
|
| @@ -66,6 +66,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/mobile_youtube_plugin.h"
|
| #include "components/visitedlink/renderer/visitedlink_slave.h"
|
| #include "content/public/common/content_constants.h"
|
| #include "content/public/renderer/render_thread.h"
|
| @@ -81,6 +82,9 @@
|
| #include "ppapi/c/private/ppb_nacl_private.h"
|
| #include "ppapi/c/private/ppb_pdf.h"
|
| #include "ppapi/shared_impl/ppapi_switches.h"
|
| +#include "third_party/WebKit/public/platform/WebURL.h"
|
| +#include "third_party/WebKit/public/platform/WebURLError.h"
|
| +#include "third_party/WebKit/public/platform/WebURLRequest.h"
|
| #include "third_party/WebKit/public/web/WebCache.h"
|
| #include "third_party/WebKit/public/web/WebDataSource.h"
|
| #include "third_party/WebKit/public/web/WebDocument.h"
|
| @@ -90,9 +94,6 @@
|
| #include "third_party/WebKit/public/web/WebPluginParams.h"
|
| #include "third_party/WebKit/public/web/WebSecurityOrigin.h"
|
| #include "third_party/WebKit/public/web/WebSecurityPolicy.h"
|
| -#include "third_party/WebKit/public/platform/WebURL.h"
|
| -#include "third_party/WebKit/public/platform/WebURLError.h"
|
| -#include "third_party/WebKit/public/platform/WebURLRequest.h"
|
| #include "ui/base/l10n/l10n_util.h"
|
| #include "ui/base/layout.h"
|
| #include "ui/base/resource/resource_bundle.h"
|
| @@ -463,8 +464,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();
|
| }
|
|
|
| @@ -499,20 +500,29 @@ 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
|
| // OverrideCreatePlugin.
|
| 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 defined(OS_ANDROID)
|
| + if (plugins::MobileYouTubePlugin::IsYouTubeURL(url, orig_mime_type)) {
|
| + base::StringPiece template_html(
|
| + ResourceBundle::GetSharedInstance().GetRawDataResource(
|
| + IDR_MOBILE_YOUTUBE_PLUGIN_HTML));
|
| + return (new plugins::MobileYouTubePlugin(
|
| + render_view,
|
| + frame,
|
| + original_params,
|
| + template_html,
|
| + GURL(ChromePluginPlaceholder::kPluginPlaceholderDataURL)))
|
| + ->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/.
|
| @@ -584,8 +594,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));
|
| @@ -636,8 +651,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));
|
| @@ -654,8 +674,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);
|
| @@ -667,8 +692,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(
|
| @@ -678,16 +708,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);
|
| @@ -700,15 +740,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);
|
| @@ -719,8 +769,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);
|
| @@ -729,8 +784,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);
|
|
|