| 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', |
| 11 | 11 |
| 12 properties: { | 12 properties: { |
| 13 /** @type {!Array<!Certificate>} */ | 13 /** @type {!Array<!Certificate>} */ |
| 14 certificates: { | 14 certificates: { |
| 15 type: Array, | 15 type: Array, |
| 16 value: function() { return []; }, | 16 value: function() { return []; }, |
| 17 }, | 17 }, |
| 18 | 18 |
| 19 /** @type {!settings.CertificateType} */ | 19 /** @type {!settings.CertificateType} */ |
| 20 certificateType: String, | 20 certificateType: String, |
| 21 }, | 21 }, |
| 22 | 22 |
| 23 behaviors: [I18nBehavior], | 23 behaviors: [I18nBehavior], |
| 24 | 24 |
| 25 /** | 25 /** |
| 26 * @return {string} | 26 * @return {string} |
| 27 * @private | 27 * @private |
| 28 */ | 28 */ |
| 29 getDescription_: function() { | 29 getDescription_: function() { |
| 30 if (this.certificates.length == 0) |
| 31 return this.i18n('certificateManagerNoCertificates'); |
| 32 |
| 30 switch (this.certificateType) { | 33 switch (this.certificateType) { |
| 31 case settings.CertificateType.PERSONAL: | 34 case settings.CertificateType.PERSONAL: |
| 32 return this.i18n('certificateManagerYourCertificatesDescription'); | 35 return this.i18n('certificateManagerYourCertificatesDescription'); |
| 33 case settings.CertificateType.SERVER: | 36 case settings.CertificateType.SERVER: |
| 34 return this.i18n('certificateManagerServersDescription'); | 37 return this.i18n('certificateManagerServersDescription'); |
| 35 case settings.CertificateType.CA: | 38 case settings.CertificateType.CA: |
| 36 return this.i18n('certificateManagerAuthoritiesDescription'); | 39 return this.i18n('certificateManagerAuthoritiesDescription'); |
| 37 case settings.CertificateType.OTHER: | 40 case settings.CertificateType.OTHER: |
| 38 return this.i18n('certificateManagerOthersDescription'); | 41 return this.i18n('certificateManagerOthersDescription'); |
| 39 } | 42 } |
| (...skipping 55 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 95 }.bind(this), | 98 }.bind(this), |
| 96 this.onRejected_.bind(this)); | 99 this.onRejected_.bind(this)); |
| 97 } else if (this.certificateType == settings.CertificateType.SERVER) { | 100 } else if (this.certificateType == settings.CertificateType.SERVER) { |
| 98 browserProxy.importServerCertificate().catch( | 101 browserProxy.importServerCertificate().catch( |
| 99 this.onRejected_.bind(this)); | 102 this.onRejected_.bind(this)); |
| 100 } else { | 103 } else { |
| 101 assertNotReached(); | 104 assertNotReached(); |
| 102 } | 105 } |
| 103 }, | 106 }, |
| 104 }); | 107 }); |
| OLD | NEW |