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 98 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
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.id.substr(0, 5) == 'cert-'; |
118 var readOnly = !!data && data.readonly; | 118 var readOnly = !!data && data.readonly; |
119 var hardwareBacked = !!data && data.hardware_backed; | |
Evan Stade
2012/05/21 21:14:58
you don't need the !! as far as I'm aware (here or
hshi1
2012/05/21 21:17:44
I'm not really familiar with this JS and would pre
| |
119 var hasChildren = this.tree.items.length > 0; | 120 var hasChildren = this.tree.items.length > 0; |
120 this.viewButton.disabled = !isCert; | 121 this.viewButton.disabled = !isCert; |
121 if (this.editButton !== null) | 122 if (this.editButton !== null) |
122 this.editButton.disabled = !isCert; | 123 this.editButton.disabled = !isCert; |
123 if (this.backupButton !== null) | 124 if (this.backupButton !== null) |
124 this.backupButton.disabled = !isCert; | 125 this.backupButton.disabled = !isCert || hardwareBacked; |
125 if (this.backupAllButton !== null) | 126 if (this.backupAllButton !== null) |
126 this.backupAllButton.disabled = !hasChildren; | 127 this.backupAllButton.disabled = !hasChildren; |
127 if (this.exportButton !== null) | 128 if (this.exportButton !== null) |
128 this.exportButton.disabled = !isCert; | 129 this.exportButton.disabled = !isCert; |
129 this.deleteButton.disabled = !isCert || readOnly; | 130 this.deleteButton.disabled = !isCert || readOnly; |
130 }, | 131 }, |
131 | 132 |
132 /** | 133 /** |
133 * Handles certificate tree selection change. | 134 * Handles certificate tree selection change. |
134 * @private | 135 * @private |
(...skipping 110 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
245 tpmPollingTimer = window.setTimeout(checkTpmToken, 5000); | 246 tpmPollingTimer = window.setTimeout(checkTpmToken, 5000); |
246 } | 247 } |
247 }; | 248 }; |
248 | 249 |
249 // Export | 250 // Export |
250 return { | 251 return { |
251 CertificateManagerTab: CertificateManagerTab, | 252 CertificateManagerTab: CertificateManagerTab, |
252 CertificateManager: CertificateManager | 253 CertificateManager: CertificateManager |
253 }; | 254 }; |
254 }); | 255 }); |
OLD | NEW |