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 'settings-certificate-list' is an element that displays a list | 6 * @fileoverview 'settings-certificate-list' is an element that displays a list |
7 * of certificates. | 7 * of certificates. |
8 */ | 8 */ |
9 Polymer({ | 9 Polymer({ |
10 is: 'settings-certificate-list', | 10 is: 'settings-certificate-list', |
(...skipping 120 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
131 | 131 |
132 /** | 132 /** |
133 * @param {boolean} useHardwareBacked | 133 * @param {boolean} useHardwareBacked |
134 * @param {!HTMLElement} anchor | 134 * @param {!HTMLElement} anchor |
135 * @private | 135 * @private |
136 */ | 136 */ |
137 handleImport_: function(useHardwareBacked, anchor) { | 137 handleImport_: function(useHardwareBacked, anchor) { |
138 var browserProxy = settings.CertificatesBrowserProxyImpl.getInstance(); | 138 var browserProxy = settings.CertificatesBrowserProxyImpl.getInstance(); |
139 if (this.certificateType == CertificateType.PERSONAL) { | 139 if (this.certificateType == CertificateType.PERSONAL) { |
140 browserProxy.importPersonalCertificate(useHardwareBacked) | 140 browserProxy.importPersonalCertificate(useHardwareBacked) |
141 .then(function(showPasswordPrompt) { | 141 .then(showPasswordPrompt => { |
142 if (showPasswordPrompt) | 142 if (showPasswordPrompt) |
143 this.dispatchImportActionEvent_(null, anchor); | 143 this.dispatchImportActionEvent_(null, anchor); |
144 }.bind(this), this.onRejected_.bind(this, anchor)); | 144 }, this.onRejected_.bind(this, anchor)); |
145 } else if (this.certificateType == CertificateType.CA) { | 145 } else if (this.certificateType == CertificateType.CA) { |
146 browserProxy.importCaCertificate().then(function(certificateName) { | 146 browserProxy.importCaCertificate().then(certificateName => { |
147 this.dispatchImportActionEvent_({name: certificateName}, anchor); | 147 this.dispatchImportActionEvent_({name: certificateName}, anchor); |
148 }.bind(this), this.onRejected_.bind(this, anchor)); | 148 }, this.onRejected_.bind(this, anchor)); |
149 } else if (this.certificateType == CertificateType.SERVER) { | 149 } else if (this.certificateType == CertificateType.SERVER) { |
150 browserProxy.importServerCertificate().catch( | 150 browserProxy.importServerCertificate().catch( |
151 this.onRejected_.bind(this, anchor)); | 151 this.onRejected_.bind(this, anchor)); |
152 } else { | 152 } else { |
153 assertNotReached(); | 153 assertNotReached(); |
154 } | 154 } |
155 }, | 155 }, |
156 }); | 156 }); |
OLD | NEW |