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

Side by Side Diff: chrome/browser/resources/pdf/elements/viewer-button/viewer-button.html

Issue 110723007: Add the viewer toolbar to the PDF extension (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Created 7 years 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 unified diff | Download patch | Annotate | Revision Log
OLDNEW
(Empty)
1 <polymer-element name="viewer-button" attributes="src latchable">
2 <template>
3 <link rel="stylesheet" href="viewer-button.css">
4 <div id="icon"></div>
5 </template>
6 <script>
7 (function() {
8 var dpi = '';
9
10 Polymer('viewer-button', {
11 src: '',
12 latchable: false,
13 ready: function() {
14 if (this.src) {
ganetsky1 2013/12/17 20:57:32 You might want a srcChanged watcher
raymes 2013/12/18 04:46:57 Done.
15 if (!dpi) {
16 var mql = window.matchMedia('(-webkit-min-device-pixel-ratio: 1.3');
17 if (mql.matches)
ganetsky1 2013/12/17 20:57:32 dpi = mql.matches ? 'hi' : 'low';
raymes 2013/12/18 04:46:57 Done.
18 dpi = 'hi';
19 else
20 dpi = 'low';
21 }
22 this.$.icon.style.backgroundImage =
23 'url(elements/viewer-button/img/' + dpi + 'DPI/' + this.src + ')';
24 }
25 if (this.latchable)
26 this.className += ' latchable';
ganetsky1 2013/12/17 20:57:32 You probably want a latchableChanged watcher inste
raymes 2013/12/18 04:46:57 Done.
27 },
28 });
29 })();
30 </script>
31 </polymer-element>
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698