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

Unified Diff: chrome/renderer/resources/plugin_poster.html

Issue 1085993003: Plugin Power Saver: Make posters work right when image is 404 Not Found. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@0263-plugin-power-saver-heuristic-tests
Patch Set: Created 5 years, 8 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 | « chrome/renderer/resources/plugin_placeholders.css ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: chrome/renderer/resources/plugin_poster.html
diff --git a/chrome/renderer/resources/plugin_poster.html b/chrome/renderer/resources/plugin_poster.html
index 0a3742a6f92cbc460058ab157445b6d0e95a5a81..08eba0099d930e17a61a3afefe19c6919fda4d29 100644
--- a/chrome/renderer/resources/plugin_poster.html
+++ b/chrome/renderer/resources/plugin_poster.html
@@ -4,32 +4,32 @@
<meta charset="utf-8">
<meta name="viewport" content="width=device-width, user-scalable=no">
<script>
-function notifyDidFinishLoading() {
- if (plugin.didFinishLoading)
- plugin.didFinishLoading();
-}
+ window.onload = function() {
+ if (plugin.didFinishLoading)
+ plugin.didFinishLoading();
+ };
-document.onkeydown = function(e) {
- if (e.keyIdentifier == 'Enter' || e.keyIdentifier == 'U+0020') {
- plugin.load();
- e.preventDefault();
- }
-};
+ window.onkeydown = function(e) {
+ if (e.keyIdentifier == 'Enter' || e.keyIdentifier == 'U+0020') {
+ plugin.load();
+ e.preventDefault();
+ }
+ };
</script>
<link rel="stylesheet" href="plugin_placeholders.css"></link>
<style>
#outer {
- position: relative;
border: none;
cursor: pointer;
+ position: relative;
}
#shielding {
background-color: rgba(0, 0, 0, 0.5);
+ height: 100%;
+ left: 0px;
position: absolute;
top: 0px;
- left: 0px;
- height: 100%;
width: 100%;
z-index: 2;
}
@@ -44,14 +44,15 @@ document.onkeydown = function(e) {
#poster {
height: 100%;
+ object-fit: contain;
width: 100%;
z-index: 1;
}
#inner_container {
height: 100%;
- width: 100%;
position: relative;
+ width: 100%;
}
#inner {
@@ -61,8 +62,8 @@ document.onkeydown = function(e) {
<base i18n-values="href:baseurl">
</head>
-<body onload="notifyDidFinishLoading();">
- <div i18n-values="title:name" id="outer" onclick="plugin.load()">
+<body>
+ <div i18n-values="title:name" id="outer">
<img id="poster" i18n-values="srcset:poster">
<div id="shielding">
<div id="inner_container"
@@ -73,5 +74,14 @@ document.onkeydown = function(e) {
</div>
</div>
</div>
+ <script>
+ document.getElementById('poster').onerror = function() {
+ this.hidden = true;
+ };
+
+ document.getElementById('outer').onclick = function() {
+ plugin.load();
+ };
+ </script>
</body>
</html>
« no previous file with comments | « chrome/renderer/resources/plugin_placeholders.css ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698