| OLD | NEW |
| 1 // Copyright 2016 The Chromium Authors. All rights reserved. | 1 // Copyright 2016 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 /** | 5 /** |
| 6 * @fileoverview A dialog prompting the user to encrypt a personal certificate | 6 * @fileoverview A dialog prompting the user to encrypt a personal certificate |
| 7 * before it is exported to disk. | 7 * before it is exported to disk. |
| 8 */ | 8 */ |
| 9 Polymer({ | 9 Polymer({ |
| 10 is: 'settings-certificate-password-encryption-dialog', | 10 is: 'settings-certificate-password-encryption-dialog', |
| (...skipping 28 matching lines...) Expand all Loading... |
| 39 /** @type {!CrDialogElement} */ (this.$.dialog).showModal(); | 39 /** @type {!CrDialogElement} */ (this.$.dialog).showModal(); |
| 40 }, | 40 }, |
| 41 | 41 |
| 42 /** @private */ | 42 /** @private */ |
| 43 onCancelTap_: function() { | 43 onCancelTap_: function() { |
| 44 /** @type {!CrDialogElement} */ (this.$.dialog).close(); | 44 /** @type {!CrDialogElement} */ (this.$.dialog).close(); |
| 45 }, | 45 }, |
| 46 | 46 |
| 47 /** @private */ | 47 /** @private */ |
| 48 onOkTap_: function() { | 48 onOkTap_: function() { |
| 49 this.browserProxy_.exportPersonalCertificatePasswordSelected( | 49 this.browserProxy_.exportPersonalCertificatePasswordSelected(this.password_) |
| 50 this.password_).then( | 50 .then( |
| 51 function() { | 51 function() { |
| 52 this.$.dialog.close(); | 52 this.$.dialog.close(); |
| 53 }.bind(this), | 53 }.bind(this), |
| 54 /** @param {!CertificatesError} error */ | 54 /** @param {!CertificatesError} error */ |
| 55 function(error) { | 55 function(error) { |
| 56 this.$.dialog.close(); | 56 this.$.dialog.close(); |
| 57 this.fire('certificates-error', {error: error, anchor: null}); | 57 this.fire('certificates-error', {error: error, anchor: null}); |
| 58 }.bind(this)); | 58 }.bind(this)); |
| 59 }, | 59 }, |
| 60 | 60 |
| 61 /** @private */ | 61 /** @private */ |
| 62 validate_: function() { | 62 validate_: function() { |
| 63 var isValid = this.password_ != '' && | 63 var isValid = |
| 64 this.password_ == this.confirmPassword_; | 64 this.password_ != '' && this.password_ == this.confirmPassword_; |
| 65 this.$.ok.disabled = !isValid; | 65 this.$.ok.disabled = !isValid; |
| 66 }, | 66 }, |
| 67 }); | 67 }); |
| OLD | NEW |