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

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

Issue 423533003: Use PageManager in About page (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: fix settings app browser test 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
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 var AddLanguageOverlay = options.AddLanguageOverlay; 5 var AddLanguageOverlay = options.AddLanguageOverlay;
6 var AlertOverlay = options.AlertOverlay; 6 var AlertOverlay = options.AlertOverlay;
7 var AutofillEditAddressOverlay = options.AutofillEditAddressOverlay; 7 var AutofillEditAddressOverlay = options.AutofillEditAddressOverlay;
8 var AutofillEditCreditCardOverlay = options.AutofillEditCreditCardOverlay; 8 var AutofillEditCreditCardOverlay = options.AutofillEditCreditCardOverlay;
9 var AutofillOptions = options.AutofillOptions; 9 var AutofillOptions = options.AutofillOptions;
10 var AutomaticSettingsResetBanner = options.AutomaticSettingsResetBanner; 10 var AutomaticSettingsResetBanner = options.AutomaticSettingsResetBanner;
(...skipping 208 matching lines...) Expand 10 before | Expand all | Expand 10 after
219 [$('certificatesManageButton')]); 219 [$('certificatesManageButton')]);
220 PageManager.registerOverlay(CertificateRestoreOverlay.getInstance(), 220 PageManager.registerOverlay(CertificateRestoreOverlay.getInstance(),
221 CertificateManager.getInstance()); 221 CertificateManager.getInstance());
222 } 222 }
223 223
224 cr.ui.FocusManager.disableMouseFocusOnButtons(); 224 cr.ui.FocusManager.disableMouseFocusOnButtons();
225 OptionsFocusManager.getInstance().initialize(); 225 OptionsFocusManager.getInstance().initialize();
226 Preferences.getInstance().initialize(); 226 Preferences.getInstance().initialize();
227 AutomaticSettingsResetBanner.getInstance().initialize(); 227 AutomaticSettingsResetBanner.getInstance().initialize();
228 OptionsPage.initialize(); 228 OptionsPage.initialize();
229 PageManager.initialize(BrowserOptions.getInstance());
230 PageManager.addObserver(new uber.PageManagerObserver());
229 231
230 var pageName = PageManager.getPageNameFromPath(); 232 var pageName = PageManager.getPageNameFromPath();
231 // Still update history so that chrome://settings/nonexistant redirects 233 // Still update history so that chrome://settings/nonexistant redirects
232 // appropriately to chrome://settings/. If the URL matches, updateHistory_ 234 // appropriately to chrome://settings/. If the URL matches, updateHistory_
233 // will avoid the extra replaceState. 235 // will avoid the extra replaceState.
234 PageManager.showPageByName(pageName, true, {replaceState: true}); 236 var updateHistory = true;
237 PageManager.showPageByName(pageName, updateHistory, {replaceState: true});
235 238
236 var subpagesNavTabs = document.querySelectorAll('.subpages-nav-tabs'); 239 var subpagesNavTabs = document.querySelectorAll('.subpages-nav-tabs');
237 for (var i = 0; i < subpagesNavTabs.length; i++) { 240 for (var i = 0; i < subpagesNavTabs.length; i++) {
238 subpagesNavTabs[i].onclick = function(event) { 241 subpagesNavTabs[i].onclick = function(event) {
239 OptionsPage.showTab(event.srcElement); 242 OptionsPage.showTab(event.srcElement);
240 }; 243 };
241 } 244 }
242 245
246 uber.onContentFrameLoaded();
247
243 window.setTimeout(function() { 248 window.setTimeout(function() {
244 document.documentElement.classList.remove('loading'); 249 document.documentElement.classList.remove('loading');
245 chrome.send('onFinishedLoadingOptions'); 250 chrome.send('onFinishedLoadingOptions');
246 }); 251 });
247 } 252 }
248 253
249 document.documentElement.classList.add('loading'); 254 document.documentElement.classList.add('loading');
250 document.addEventListener('DOMContentLoaded', load); 255 document.addEventListener('DOMContentLoaded', load);
251 256
252 /** 257 /**
253 * Listener for the |beforeunload| event. 258 * Listener for the |beforeunload| event.
254 */ 259 */
255 window.onbeforeunload = function() { 260 window.onbeforeunload = function() {
256 PageManager.willClose(); 261 PageManager.willClose();
257 }; 262 };
258 263
259 /** 264 /**
260 * Listener for the |popstate| event. 265 * Listener for the |popstate| event.
261 * @param {Event} e The |popstate| event. 266 * @param {Event} e The |popstate| event.
262 */ 267 */
263 window.onpopstate = function(e) { 268 window.onpopstate = function(e) {
264 var pageName = PageManager.getPageNameFromPath(); 269 var pageName = PageManager.getPageNameFromPath();
265 PageManager.setState(pageName, e.state); 270 PageManager.setState(pageName, e.state);
266 }; 271 };
OLDNEW
« no previous file with comments | « chrome/browser/resources/options/browser_options.js ('k') | chrome/browser/resources/options/options_bundle.js » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698