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

Side by Side Diff: chrome/browser/resources/pdf/elements/viewer-password-screen/viewer-password-screen.js

Issue 2915773003: PDF Plugin: Add compile targets for a few more files. (Closed)
Patch Set: Addressing comments. Created 3 years, 6 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 unified diff | Download patch
« no previous file with comments | « chrome/browser/resources/pdf/elements/viewer-password-screen/compiled_resources2.gyp ('k') | no next file » | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 // Copyright 2014 The Chromium Authors. All rights reserved. 1 // Copyright 2014 The Chromium Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be 2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file. 3 // found in the LICENSE file.
4 4
5 Polymer({ 5 Polymer({
6 is: 'viewer-password-screen', 6 is: 'viewer-password-screen',
7 7
8 properties: { 8 properties: {
9 invalid: Boolean, 9 invalid: Boolean,
10 10
11 strings: Object, 11 strings: Object,
12 }, 12 },
13 13
14 get active() { 14 get active() {
15 return this.$.dialog.open; 15 return this.$.dialog.open;
16 }, 16 },
17 17
18 show: function() { 18 show: function() {
19 this.$.dialog.showModal(); 19 this.$.dialog.showModal();
20 }, 20 },
21 21
22 close: function() { 22 close: function() {
23 if (this.active) 23 if (this.active)
24 this.$.dialog.close(); 24 this.$.dialog.close();
25 }, 25 },
26 26
27 deny: function() { 27 deny: function() {
28 this.$.password.disabled = false; 28 var password = /** @type {!PaperInputElement} */ (this.$.password);
29 password.disabled = false;
29 this.$.submit.disabled = false; 30 this.$.submit.disabled = false;
30 this.invalid = true; 31 this.invalid = true;
31 this.$.password.focus(); 32 password.focus();
32 this.$.password.inputElement.select(); 33 password.inputElement.select();
33 }, 34 },
34 35
35 submit: function() { 36 submit: function() {
36 if (this.$.password.value.length == 0) 37 var password = /** @type {!PaperInputElement} */ (this.$.password);
38 if (password.value.length == 0)
37 return; 39 return;
38 this.$.password.disabled = true; 40 password.disabled = true;
39 this.$.submit.disabled = true; 41 this.$.submit.disabled = true;
40 this.fire('password-submitted', {password: this.$.password.value}); 42 this.fire('password-submitted', {password: password.value});
41 }, 43 },
42 }); 44 });
OLDNEW
« no previous file with comments | « chrome/browser/resources/pdf/elements/viewer-password-screen/compiled_resources2.gyp ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698