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

Unified Diff: chrome/renderer/plugins/chrome_plugin_placeholder.cc

Issue 981623003: Plugin Power Saver: Implement srcset syntax for posters. (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
Index: chrome/renderer/plugins/chrome_plugin_placeholder.cc
diff --git a/chrome/renderer/plugins/chrome_plugin_placeholder.cc b/chrome/renderer/plugins/chrome_plugin_placeholder.cc
index 375c3da5e934246d9157761de07e99cb7c93cd51..6bb6bd2e7366a0febe5f8fbfea6faa04bee8a272 100644
--- a/chrome/renderer/plugins/chrome_plugin_placeholder.cc
+++ b/chrome/renderer/plugins/chrome_plugin_placeholder.cc
@@ -153,14 +153,17 @@ ChromePluginPlaceholder* ChromePluginPlaceholder::CreateBlockedPlugin(
const base::string16& name,
int template_id,
const base::string16& message,
- const GURL& poster_url) {
+ const std::string& poster_attribute,
+ const GURL& base_url) {
base::DictionaryValue values;
values.SetString("message", message);
values.SetString("name", name);
values.SetString("hide", l10n_util::GetStringUTF8(IDS_PLUGIN_HIDE));
- if (poster_url.is_valid())
- values.SetString("background", "url('" + poster_url.spec() + "')");
+ if (!poster_attribute.empty()) {
+ values.SetString("poster", poster_attribute);
+ values.SetString("baseurl", base_url.spec());
+ }
const base::StringPiece template_html(
ResourceBundle::GetSharedInstance().GetRawDataResource(template_id));
@@ -174,7 +177,7 @@ ChromePluginPlaceholder* ChromePluginPlaceholder::CreateBlockedPlugin(
render_frame, frame, params, html_data, name);
#if defined(ENABLE_PLUGINS)
- if (poster_url.is_valid())
+ if (!poster_attribute.empty())
blocked_plugin->BlockForPowerSaverPoster();
#endif
blocked_plugin->SetPluginInfo(info);

Powered by Google App Engine
This is Rietveld 408576698