cygprofile: increase timeouts to allow showing web contents
[chromium-blink-merge.git] / chrome / browser / resources / pdf / elements / viewer-password-screen / viewer-password-screen.js
blobcdf0d04caf54f532ef251eba247293cceee262e0
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
3 // found in the LICENSE file.
5 Polymer({
6 is: 'viewer-password-screen',
8 properties: {
9 text: {
10 type: String,
11 value: 'This document is password protected. Please enter a password.',
14 active: {
15 type: Boolean,
16 value: false,
17 observer: 'activeChanged'
21 ready: function() {
22 this.activeChanged();
25 accept: function() {
26 this.active = false;
29 deny: function() {
30 this.$.password.disabled = false;
31 this.$.submit.disabled = false;
32 this.$['password-container'].invalid = true;
33 this.$.password.focus();
34 this.$.password.select();
37 handleKey: function(e) {
38 if (e.keyCode == 13)
39 this.submit();
42 submit: function() {
43 if (this.$.password.value.length == 0)
44 return;
45 this.$.password.disabled = true;
46 this.$.submit.disabled = true;
47 this.fire('password-submitted', {password: this.$.password.value});
50 activeChanged: function() {
51 if (this.active) {
52 this.$.dialog.open();
53 this.$.password.focus();
54 } else {
55 this.$.dialog.close();
58 });