Chromium Code Reviews| Index: chrome/browser/resources/settings/certificate_manager_page/certificate_password_encryption_dialog.js |
| diff --git a/chrome/browser/resources/settings/certificate_manager_page/certificate_password_encryption_dialog.js b/chrome/browser/resources/settings/certificate_manager_page/certificate_password_encryption_dialog.js |
| new file mode 100644 |
| index 0000000000000000000000000000000000000000..7e40f422f6c74db01049856a36243cd2534bacd9 |
| --- /dev/null |
| +++ b/chrome/browser/resources/settings/certificate_manager_page/certificate_password_encryption_dialog.js |
| @@ -0,0 +1,65 @@ |
| +// Copyright 2016 The Chromium Authors. All rights reserved. |
| +// Use of this source code is governed by a BSD-style license that can be |
| +// found in the LICENSE file. |
| + |
| +/** |
| + * @fileoverview A dialog prompting the user to encrypt a personal certificate |
| + * before it is exported to disk. |
| + */ |
| +Polymer({ |
| + is: 'settings-certificate-password-encryption-dialog', |
| + |
| + properties: { |
| + /** @private {!settings.CertificatesBrowserProxy} */ |
| + browserProxy_: Object, |
| + |
| + /** @type {!CertificateSubnode} */ |
| + model: Object, |
| + |
| + /** @private {string} */ |
|
dschuyler
2016/03/11 21:18:15
The {string} entry is redundant with type: String
dpapad
2016/03/14 19:34:50
Done.
|
| + password_: { |
| + type: String, |
| + value: '', |
| + }, |
| + |
| + /** @private {string} */ |
|
dschuyler
2016/03/11 21:18:15
{string} unneeded
dpapad
2016/03/14 19:34:49
Done.
|
| + confirmPassword_: { |
| + type: String, |
| + value: '', |
| + }, |
| + }, |
| + |
| + /** @override */ |
| + ready: function() { |
| + this.browserProxy_ = settings.CertificatesBrowserProxyImpl.getInstance(); |
| + }, |
| + |
| + /** @override */ |
| + attached: function() { |
| + this.$.dialog.open(); |
| + }, |
| + |
| + /** @private */ |
| + onCancelTap_: function() { |
| + this.$.dialog.close(); |
| + }, |
| + |
| + /** @private */ |
| + onOkTap_: function() { |
| + this.browserProxy_.exportPersonalCertificatePasswordSelected( |
| + this.password_).then(function() { |
| + this.$.dialog.close(); |
| + }.bind(this), |
| + /** @param {!CertificatesError} error */ |
| + function(error) { |
| + // TODO(dpapad): Display error here. |
| + }); |
| + }, |
| + |
| + /** @private */ |
| + validate_: function() { |
| + var isValid = this.password_ != '' && |
| + this.password_ == this.confirmPassword_; |
| + this.$.ok.disabled = !isValid; |
| + }, |
| +}); |