| OLD | NEW |
| 1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2012 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 cr.define('options', function() { | 5 cr.define('options', function() { |
| 6 var OptionsPage = options.OptionsPage; | 6 var OptionsPage = options.OptionsPage; |
| 7 | 7 |
| 8 ///////////////////////////////////////////////////////////////////////////// | 8 ///////////////////////////////////////////////////////////////////////////// |
| 9 // CertificateManagerTab class: | 9 // CertificateManagerTab class: |
| 10 | 10 |
| (...skipping 96 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 107 } | 107 } |
| 108 | 108 |
| 109 CertificateManagerTab.prototype = { | 109 CertificateManagerTab.prototype = { |
| 110 | 110 |
| 111 /** | 111 /** |
| 112 * Update button state. | 112 * Update button state. |
| 113 * @private | 113 * @private |
| 114 * @param {!Object} data The data of the selected item. | 114 * @param {!Object} data The data of the selected item. |
| 115 */ | 115 */ |
| 116 updateButtonState: function(data) { | 116 updateButtonState: function(data) { |
| 117 var isCert = !!data && data.id.substr(0, 5) == 'cert-'; | 117 var isCert = !!data && data.isCert; |
| 118 var readOnly = !!data && data.readonly; | 118 var readOnly = !!data && data.readonly; |
| 119 var extractable = !!data && data.extractable; | 119 var extractable = !!data && data.extractable; |
| 120 var hasChildren = this.tree.items.length > 0; | 120 var hasChildren = this.tree.items.length > 0; |
| 121 this.viewButton.disabled = !isCert; | 121 this.viewButton.disabled = !isCert; |
| 122 if (this.editButton !== null) | 122 if (this.editButton !== null) |
| 123 this.editButton.disabled = !isCert; | 123 this.editButton.disabled = !isCert; |
| 124 if (this.backupButton !== null) | 124 if (this.backupButton !== null) |
| 125 this.backupButton.disabled = !isCert || !extractable; | 125 this.backupButton.disabled = !isCert || !extractable; |
| 126 if (this.backupAllButton !== null) | 126 if (this.backupAllButton !== null) |
| 127 this.backupAllButton.disabled = !hasChildren; | 127 this.backupAllButton.disabled = !hasChildren; |
| (...skipping 118 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 246 tpmPollingTimer = window.setTimeout(checkTpmToken, 5000); | 246 tpmPollingTimer = window.setTimeout(checkTpmToken, 5000); |
| 247 } | 247 } |
| 248 }; | 248 }; |
| 249 | 249 |
| 250 // Export | 250 // Export |
| 251 return { | 251 return { |
| 252 CertificateManagerTab: CertificateManagerTab, | 252 CertificateManagerTab: CertificateManagerTab, |
| 253 CertificateManager: CertificateManager | 253 CertificateManager: CertificateManager |
| 254 }; | 254 }; |
| 255 }); | 255 }); |
| OLD | NEW |