| 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 3fe50be93c015538cd3949f6a85bcd635facabf1..8921bd62f5e22965284a728c8282b046d414bd43 100644
|
| --- a/chrome/renderer/chrome_content_renderer_client.cc
|
| +++ b/chrome/renderer/chrome_content_renderer_client.cc
|
| @@ -684,19 +684,18 @@ WebPlugin* ChromeContentRendererClient::CreatePlugin(
|
|
|
| if ((status_value ==
|
| ChromeViewHostMsg_GetPluginInfo_Status::kUnauthorized ||
|
| - status_value == ChromeViewHostMsg_GetPluginInfo_Status::kClickToPlay ||
|
| status_value == ChromeViewHostMsg_GetPluginInfo_Status::kBlocked) &&
|
| observer->IsPluginTemporarilyAllowed(identifier)) {
|
| status_value = ChromeViewHostMsg_GetPluginInfo_Status::kAllowed;
|
| }
|
|
|
| - // Allow full-page plug-ins for click-to-play.
|
| - if (status_value == ChromeViewHostMsg_GetPluginInfo_Status::kClickToPlay &&
|
| - !frame->parent() &&
|
| - !frame->opener() &&
|
| - frame->document().isPluginDocument()) {
|
| - status_value = ChromeViewHostMsg_GetPluginInfo_Status::kAllowed;
|
| +#if defined(ENABLE_PLUGINS)
|
| + if (base::CommandLine::ForCurrentProcess()->HasSwitch(
|
| + switches::kEnablePluginPowerSaver)) {
|
| + status_value =
|
| + ChromeViewHostMsg_GetPluginInfo_Status::kPlayImportantContent;
|
| }
|
| +#endif
|
|
|
| #if defined(OS_WIN)
|
| // In Windows we need to check if we can load NPAPI plugins.
|
| @@ -722,7 +721,8 @@ WebPlugin* ChromeContentRendererClient::CreatePlugin(
|
| NOTREACHED();
|
| break;
|
| }
|
| - case ChromeViewHostMsg_GetPluginInfo_Status::kAllowed: {
|
| + case ChromeViewHostMsg_GetPluginInfo_Status::kAllowed:
|
| + case ChromeViewHostMsg_GetPluginInfo_Status::kPlayImportantContent: {
|
| #if !defined(DISABLE_NACL) && defined(ENABLE_EXTENSIONS)
|
| const bool is_nacl_plugin =
|
| plugin.name == ASCIIToUTF16(nacl::kNaClPluginName);
|
| @@ -794,8 +794,8 @@ WebPlugin* ChromeContentRendererClient::CreatePlugin(
|
| if (render_frame->ShouldThrottleContent(params, frame->document().url(),
|
| &poster_url,
|
| &cross_origin_main_content)) {
|
| - if (base::CommandLine::ForCurrentProcess()->HasSwitch(
|
| - switches::kEnablePluginPowerSaver)) {
|
| + if (status_value ==
|
| + ChromeViewHostMsg_GetPluginInfo_Status::kPlayImportantContent) {
|
| power_saver_mode =
|
| RenderFrame::POWER_SAVER_MODE_PERIPHERAL_THROTTLED;
|
| show_poster = poster_url.is_valid();
|
| @@ -813,9 +813,8 @@ WebPlugin* ChromeContentRendererClient::CreatePlugin(
|
| prerender::PrerenderHelper::IsPrerendering(render_frame);
|
| if (is_prerendering || show_poster) {
|
| placeholder = create_blocked_plugin(
|
| - show_poster ? IDR_PLUGIN_POSTER_HTML
|
| - : IDR_CLICK_TO_PLAY_PLUGIN_HTML,
|
| - l10n_util::GetStringFUTF16(IDS_PLUGIN_LOAD, group_name),
|
| + show_poster ? IDR_PLUGIN_POSTER_HTML : IDR_BLOCKED_PLUGIN_HTML,
|
| + l10n_util::GetStringFUTF16(IDS_PLUGIN_BLOCKED, group_name),
|
| poster_url);
|
| placeholder->set_blocked_for_prerendering(is_prerendering);
|
| placeholder->set_power_saver_mode(power_saver_mode);
|
| @@ -892,16 +891,6 @@ WebPlugin* ChromeContentRendererClient::CreatePlugin(
|
| }
|
| break;
|
| }
|
| - case ChromeViewHostMsg_GetPluginInfo_Status::kClickToPlay: {
|
| - placeholder = create_blocked_plugin(
|
| - IDR_CLICK_TO_PLAY_PLUGIN_HTML,
|
| - l10n_util::GetStringFUTF16(IDS_PLUGIN_LOAD, group_name), GURL());
|
| - placeholder->set_allow_loading(true);
|
| - RenderThread::Get()->RecordAction(
|
| - UserMetricsAction("Plugin_ClickToPlay"));
|
| - observer->DidBlockContentType(content_type, group_name);
|
| - break;
|
| - }
|
| case ChromeViewHostMsg_GetPluginInfo_Status::kBlocked: {
|
| placeholder = create_blocked_plugin(
|
| IDR_BLOCKED_PLUGIN_HTML,
|
|
|