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

Unified Diff: chrome/renderer/chrome_content_renderer_client.cc

Issue 1015023002: Plugin Power Saver: Throttle 'large' plugins that appear small. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 5 years, 9 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
« no previous file with comments | « no previous file | chrome/renderer/plugins/chrome_plugin_placeholder.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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 f2ee4057cca6f1a9849789ca12519aa9c0747c42..be284869e1bb9b8a54ec562635dbdd943d678387 100644
--- a/chrome/renderer/chrome_content_renderer_client.cc
+++ b/chrome/renderer/chrome_content_renderer_client.cc
@@ -778,7 +778,7 @@ WebPlugin* ChromeContentRendererClient::CreatePlugin(
int template_id, const base::string16& message) {
return ChromePluginPlaceholder::CreateBlockedPlugin(
render_frame, frame, params, info, identifier, group_name,
- template_id, message, std::string(), GURL());
+ template_id, message, PlaceholderPosterInfo());
};
switch (status_value) {
case ChromeViewHostMsg_GetPluginInfo_Status::kNotFound: {
@@ -858,9 +858,12 @@ WebPlugin* ChromeContentRendererClient::CreatePlugin(
if (info.name == ASCIIToUTF16(content::kFlashPluginName))
TrackPosterParamPresence(params, power_saver_enabled);
- std::string poster_attribute;
- if (power_saver_enabled)
- poster_attribute = GetPluginInstancePosterAttribute(params);
+ PlaceholderPosterInfo poster_info;
+ if (power_saver_enabled) {
+ poster_info.poster_attribute =
+ GetPluginInstancePosterAttribute(params);
+ poster_info.base_url = frame->document().url();
+ }
// Delay loading plugins if prerendering.
// TODO(mmenke): In the case of prerendering, feed into
@@ -869,13 +872,13 @@ WebPlugin* ChromeContentRendererClient::CreatePlugin(
bool is_prerendering =
prerender::PrerenderHelper::IsPrerendering(render_frame);
if (blocked_for_background_tab || is_prerendering ||
- !poster_attribute.empty()) {
+ !poster_info.poster_attribute.empty()) {
placeholder = ChromePluginPlaceholder::CreateBlockedPlugin(
render_frame, frame, params, info, identifier, group_name,
- poster_attribute.empty() ? IDR_BLOCKED_PLUGIN_HTML
- : IDR_PLUGIN_POSTER_HTML,
+ poster_info.poster_attribute.empty() ? IDR_BLOCKED_PLUGIN_HTML
+ : IDR_PLUGIN_POSTER_HTML,
l10n_util::GetStringFUTF16(IDS_PLUGIN_BLOCKED, group_name),
- poster_attribute, frame->document().url());
+ poster_info);
placeholder->set_blocked_for_background_tab(
blocked_for_background_tab);
placeholder->set_blocked_for_prerendering(is_prerendering);
« no previous file with comments | « no previous file | chrome/renderer/plugins/chrome_plugin_placeholder.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698