OLD | NEW |
1 // Copyright 2015 The Chromium Authors. All rights reserved. | 1 // Copyright 2015 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: 'saml-confirm-password', | 6 is: 'saml-confirm-password', |
7 | 7 |
8 properties: { | 8 properties: { |
9 email: String, | 9 email: String, |
10 | 10 |
(...skipping 12 matching lines...) Expand all Loading... |
23 var pages = this.$.animatedPages; | 23 var pages = this.$.animatedPages; |
24 delete pages._squelchNextFinishEvent; | 24 delete pages._squelchNextFinishEvent; |
25 Object.defineProperty(pages, '_squelchNextFinishEvent', { | 25 Object.defineProperty(pages, '_squelchNextFinishEvent', { |
26 get: function() { | 26 get: function() { |
27 return false; | 27 return false; |
28 } | 28 } |
29 }); | 29 }); |
30 }, | 30 }, |
31 | 31 |
32 reset: function() { | 32 reset: function() { |
33 this.$.cancelConfirmDlg.close(); | 33 if (this.$.cancelConfirmDlg.open) |
| 34 this.$.cancelConfirmDlg.close(); |
34 this.disabled = false; | 35 this.disabled = false; |
35 this.$.navigation.closeVisible = true; | 36 this.$.navigation.closeVisible = true; |
36 if (this.$.animatedPages.selected != 0) | 37 if (this.$.animatedPages.selected != 0) |
37 this.$.animatedPages.selected = 0; | 38 this.$.animatedPages.selected = 0; |
38 this.$.passwordInput.isInvalid = false; | 39 this.$.passwordInput.isInvalid = false; |
39 this.$.passwordInput.value = ''; | 40 this.$.passwordInput.value = ''; |
40 if (this.manualInput) { | 41 if (this.manualInput) { |
41 this.$$('#confirmPasswordInput').isInvalid = false; | 42 this.$$('#confirmPasswordInput').isInvalid = false; |
42 this.$$('#confirmPasswordInput').value = ''; | 43 this.$$('#confirmPasswordInput').value = ''; |
43 } | 44 } |
44 }, | 45 }, |
45 | 46 |
46 invalidate: function() { | 47 invalidate: function() { |
47 this.$.passwordInput.isInvalid = true; | 48 this.$.passwordInput.isInvalid = true; |
48 }, | 49 }, |
49 | 50 |
50 focus: function() { | 51 focus: function() { |
51 if (this.$.animatedPages.selected == 0) | 52 if (this.$.animatedPages.selected == 0) |
52 this.$.passwordInput.focus(); | 53 this.$.passwordInput.focus(); |
53 }, | 54 }, |
54 | 55 |
55 onClose_: function() { | 56 onClose_: function() { |
56 this.disabled = true; | 57 this.disabled = true; |
57 this.$.cancelConfirmDlg.fitInto = this; | 58 this.$.cancelConfirmDlg.showModal(); |
58 this.$.cancelConfirmDlg.open(); | |
59 }, | 59 }, |
60 | 60 |
61 onConfirmCancel_: function() { | 61 onCancelNo_: function() { |
| 62 this.$.cancelConfirmDlg.close(); |
| 63 }, |
| 64 |
| 65 onCancelYes_: function() { |
| 66 this.$.cancelConfirmDlg.close(); |
62 this.fire('cancel'); | 67 this.fire('cancel'); |
63 }, | 68 }, |
64 | 69 |
65 onPasswordSubmitted_: function() { | 70 onPasswordSubmitted_: function() { |
66 if (!this.$.passwordInput.checkValidity()) | 71 if (!this.$.passwordInput.checkValidity()) |
67 return; | 72 return; |
68 if (this.manualInput) { | 73 if (this.manualInput) { |
69 // When using manual password entry, both passwords must match. | 74 // When using manual password entry, both passwords must match. |
70 var confirmPasswordInput = this.$$('#confirmPasswordInput'); | 75 var confirmPasswordInput = this.$$('#confirmPasswordInput'); |
71 if (!confirmPasswordInput.checkValidity()) | 76 if (!confirmPasswordInput.checkValidity()) |
(...skipping 39 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
111 }, | 116 }, |
112 | 117 |
113 getConfirmPasswordInputLabel_: function() { | 118 getConfirmPasswordInputLabel_: function() { |
114 return loadTimeData.getString('confirmPasswordLabel'); | 119 return loadTimeData.getString('confirmPasswordLabel'); |
115 }, | 120 }, |
116 | 121 |
117 getConfirmPasswordInputError_: function() { | 122 getConfirmPasswordInputError_: function() { |
118 return loadTimeData.getString('manualPasswordMismatch'); | 123 return loadTimeData.getString('manualPasswordMismatch'); |
119 } | 124 } |
120 }); | 125 }); |
OLD | NEW |