Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(340)

Side by Side Diff: chrome/browser/resources/options/certificate_manager.js

Issue 410293004: Split OptionsPage into Page and PageManager (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Addressed feedback Created 6 years, 4 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch | Annotate | Revision Log
OLDNEW
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 147 matching lines...) Expand 10 before | Expand all | Expand 10 after
164 }; 166 };
165 167
166 ///////////////////////////////////////////////////////////////////////////// 168 /////////////////////////////////////////////////////////////////////////////
167 // CertificateManager class: 169 // CertificateManager class:
168 170
169 /** 171 /**
170 * Encapsulated handling of ChromeOS accounts options page. 172 * Encapsulated handling of ChromeOS accounts options page.
171 * @constructor 173 * @constructor
172 */ 174 */
173 function CertificateManager(model) { 175 function CertificateManager(model) {
174 OptionsPage.call(this, 'certificates', 176 Page.call(this, 'certificates',
175 loadTimeData.getString('certificateManagerPageTabTitle'), 177 loadTimeData.getString('certificateManagerPageTabTitle'),
176 'certificateManagerPage'); 178 'certificateManagerPage');
177 } 179 }
178 180
179 cr.addSingletonGetter(CertificateManager); 181 cr.addSingletonGetter(CertificateManager);
180 182
181 CertificateManager.prototype = { 183 CertificateManager.prototype = {
182 __proto__: OptionsPage.prototype, 184 __proto__: Page.prototype,
183 185
184 initializePage: function(isKiosk) { 186 initializePage: function(isKiosk) {
185 OptionsPage.prototype.initializePage.call(this); 187 Page.prototype.initializePage.call(this);
186 188
187 this.personalTab = new CertificateManagerTab('personalCertsTab', 189 this.personalTab = new CertificateManagerTab('personalCertsTab',
188 !!isKiosk); 190 !!isKiosk);
189 this.serverTab = new CertificateManagerTab('serverCertsTab', !!isKiosk); 191 this.serverTab = new CertificateManagerTab('serverCertsTab', !!isKiosk);
190 this.caTab = new CertificateManagerTab('caCertsTab', !!isKiosk); 192 this.caTab = new CertificateManagerTab('caCertsTab', !!isKiosk);
191 this.otherTab = new CertificateManagerTab('otherCertsTab', !!isKiosk); 193 this.otherTab = new CertificateManagerTab('otherCertsTab', !!isKiosk);
192 194
193 this.addEventListener('visibleChange', this.handleVisibleChange_); 195 this.addEventListener('visibleChange', this.handleVisibleChange_);
194 196
195 $('certificate-confirm').onclick = function() { 197 $('certificate-confirm').onclick = function() {
196 OptionsPage.closeOverlay(); 198 PageManager.closeOverlay();
197 }; 199 };
198 }, 200 },
199 201
200 initalized_: false, 202 initalized_: false,
201 203
202 /** 204 /**
203 * Handler for OptionsPage's visible property change event. 205 * Handler for Page's visible property change event.
204 * @private 206 * @private
205 * @param {Event} e Property change event. 207 * @param {Event} e Property change event.
206 */ 208 */
207 handleVisibleChange_: function(e) { 209 handleVisibleChange_: function(e) {
208 if (!this.initalized_ && this.visible) { 210 if (!this.initalized_ && this.visible) {
209 this.initalized_ = true; 211 this.initalized_ = true;
210 OptionsPage.showTab($('personal-certs-nav-tab')); 212 OptionsPage.showTab($('personal-certs-nav-tab'));
211 chrome.send('populateCertificateManager'); 213 chrome.send('populateCertificateManager');
212 } 214 }
213 } 215 }
(...skipping 22 matching lines...) Expand all
236 $('serverCertsTab-import').disabled = false; 238 $('serverCertsTab-import').disabled = false;
237 $('caCertsTab-import').disabled = false; 239 $('caCertsTab-import').disabled = false;
238 }; 240 };
239 241
240 // Export 242 // Export
241 return { 243 return {
242 CertificateManagerTab: CertificateManagerTab, 244 CertificateManagerTab: CertificateManagerTab,
243 CertificateManager: CertificateManager 245 CertificateManager: CertificateManager
244 }; 246 };
245 }); 247 });
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698