| 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 var Page = cr.ui.pageManager.Page; |
| 8 var PageManager = cr.ui.pageManager.PageManager; |
| 7 | 9 |
| 8 ///////////////////////////////////////////////////////////////////////////// | 10 ///////////////////////////////////////////////////////////////////////////// |
| 9 // CertificateManagerTab class: | 11 // CertificateManagerTab class: |
| 10 | 12 |
| 11 /** | 13 /** |
| 12 * blah | 14 * blah |
| 13 * @param {!string} id The id of this tab. | 15 * @param {!string} id The id of this tab. |
| 14 * @param {boolean} isKiosk True if dialog is shown during CrOS kiosk launch. | 16 * @param {boolean} isKiosk True if dialog is shown during CrOS kiosk launch. |
| 15 */ | 17 */ |
| 16 function CertificateManagerTab(id, isKiosk) { | 18 function CertificateManagerTab(id, isKiosk) { |
| (...skipping 145 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 162 }; | 164 }; |
| 163 | 165 |
| 164 ///////////////////////////////////////////////////////////////////////////// | 166 ///////////////////////////////////////////////////////////////////////////// |
| 165 // CertificateManager class: | 167 // CertificateManager class: |
| 166 | 168 |
| 167 /** | 169 /** |
| 168 * Encapsulated handling of ChromeOS accounts options page. | 170 * Encapsulated handling of ChromeOS accounts options page. |
| 169 * @constructor | 171 * @constructor |
| 170 */ | 172 */ |
| 171 function CertificateManager(model) { | 173 function CertificateManager(model) { |
| 172 OptionsPage.call(this, 'certificates', | 174 Page.call(this, 'certificates', |
| 173 loadTimeData.getString('certificateManagerPageTabTitle'), | 175 loadTimeData.getString('certificateManagerPageTabTitle'), |
| 174 'certificateManagerPage'); | 176 'certificateManagerPage'); |
| 175 } | 177 } |
| 176 | 178 |
| 177 cr.addSingletonGetter(CertificateManager); | 179 cr.addSingletonGetter(CertificateManager); |
| 178 | 180 |
| 179 CertificateManager.prototype = { | 181 CertificateManager.prototype = { |
| 180 __proto__: OptionsPage.prototype, | 182 __proto__: Page.prototype, |
| 181 | 183 |
| 182 /** @override */ | 184 /** @override */ |
| 183 initializePage: function(isKiosk) { | 185 initializePage: function(isKiosk) { |
| 184 OptionsPage.prototype.initializePage.call(this); | 186 Page.prototype.initializePage.call(this); |
| 185 | 187 |
| 186 this.personalTab = new CertificateManagerTab('personalCertsTab', | 188 this.personalTab = new CertificateManagerTab('personalCertsTab', |
| 187 !!isKiosk); | 189 !!isKiosk); |
| 188 this.serverTab = new CertificateManagerTab('serverCertsTab', !!isKiosk); | 190 this.serverTab = new CertificateManagerTab('serverCertsTab', !!isKiosk); |
| 189 this.caTab = new CertificateManagerTab('caCertsTab', !!isKiosk); | 191 this.caTab = new CertificateManagerTab('caCertsTab', !!isKiosk); |
| 190 this.otherTab = new CertificateManagerTab('otherCertsTab', !!isKiosk); | 192 this.otherTab = new CertificateManagerTab('otherCertsTab', !!isKiosk); |
| 191 | 193 |
| 192 this.addEventListener('visibleChange', this.handleVisibleChange_); | 194 this.addEventListener('visibleChange', this.handleVisibleChange_); |
| 193 | 195 |
| 194 $('certificate-confirm').onclick = function() { | 196 $('certificate-confirm').onclick = function() { |
| 195 OptionsPage.closeOverlay(); | 197 PageManager.closeOverlay(); |
| 196 }; | 198 }; |
| 197 }, | 199 }, |
| 198 | 200 |
| 199 initalized_: false, | 201 initalized_: false, |
| 200 | 202 |
| 201 /** | 203 /** |
| 202 * Handler for OptionsPage's visible property change event. | 204 * Handler for Page's visible property change event. |
| 203 * @private | 205 * @private |
| 204 * @param {Event} e Property change event. | 206 * @param {Event} e Property change event. |
| 205 */ | 207 */ |
| 206 handleVisibleChange_: function(e) { | 208 handleVisibleChange_: function(e) { |
| 207 if (!this.initalized_ && this.visible) { | 209 if (!this.initalized_ && this.visible) { |
| 208 this.initalized_ = true; | 210 this.initalized_ = true; |
| 209 OptionsPage.showTab($('personal-certs-nav-tab')); | 211 OptionsPage.showTab($('personal-certs-nav-tab')); |
| 210 chrome.send('populateCertificateManager'); | 212 chrome.send('populateCertificateManager'); |
| 211 } | 213 } |
| 212 } | 214 } |
| (...skipping 22 matching lines...) Expand all Loading... |
| 235 $('serverCertsTab-import').disabled = false; | 237 $('serverCertsTab-import').disabled = false; |
| 236 $('caCertsTab-import').disabled = false; | 238 $('caCertsTab-import').disabled = false; |
| 237 }; | 239 }; |
| 238 | 240 |
| 239 // Export | 241 // Export |
| 240 return { | 242 return { |
| 241 CertificateManagerTab: CertificateManagerTab, | 243 CertificateManagerTab: CertificateManagerTab, |
| 242 CertificateManager: CertificateManager | 244 CertificateManager: CertificateManager |
| 243 }; | 245 }; |
| 244 }); | 246 }); |
| OLD | NEW |