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

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

Issue 555163007: Settings: manage location.hash explicitly on a Page. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: dbeam comments Created 6 years, 3 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 230 matching lines...) Expand 10 before | Expand all | Expand 10 after
241 OptionsPage.initialize(); 241 OptionsPage.initialize();
242 PageManager.initialize(BrowserOptions.getInstance()); 242 PageManager.initialize(BrowserOptions.getInstance());
243 PageManager.addObserver(new uber.PageManagerObserver()); 243 PageManager.addObserver(new uber.PageManagerObserver());
244 uber.onContentFrameLoaded(); 244 uber.onContentFrameLoaded();
245 245
246 var pageName = PageManager.getPageNameFromPath(); 246 var pageName = PageManager.getPageNameFromPath();
247 // Still update history so that chrome://settings/nonexistant redirects 247 // Still update history so that chrome://settings/nonexistant redirects
248 // appropriately to chrome://settings/. If the URL matches, updateHistory_ 248 // appropriately to chrome://settings/. If the URL matches, updateHistory_
249 // will avoid the extra replaceState. 249 // will avoid the extra replaceState.
250 var updateHistory = true; 250 var updateHistory = true;
251 PageManager.showPageByName(pageName, updateHistory, {replaceState: true}); 251 PageManager.showPageByName(pageName, updateHistory,
252 {replaceState: true, hash: location.hash});
252 253
253 var subpagesNavTabs = document.querySelectorAll('.subpages-nav-tabs'); 254 var subpagesNavTabs = document.querySelectorAll('.subpages-nav-tabs');
254 for (var i = 0; i < subpagesNavTabs.length; i++) { 255 for (var i = 0; i < subpagesNavTabs.length; i++) {
255 subpagesNavTabs[i].onclick = function(event) { 256 subpagesNavTabs[i].onclick = function(event) {
256 OptionsPage.showTab(event.srcElement); 257 OptionsPage.showTab(event.srcElement);
257 }; 258 };
258 } 259 }
259 260
260 window.setTimeout(function() { 261 window.setTimeout(function() {
261 document.documentElement.classList.remove('loading'); 262 document.documentElement.classList.remove('loading');
(...skipping 10 matching lines...) Expand all
272 window.onbeforeunload = function() { 273 window.onbeforeunload = function() {
273 PageManager.willClose(); 274 PageManager.willClose();
274 }; 275 };
275 276
276 /** 277 /**
277 * Listener for the |popstate| event. 278 * Listener for the |popstate| event.
278 * @param {Event} e The |popstate| event. 279 * @param {Event} e The |popstate| event.
279 */ 280 */
280 window.onpopstate = function(e) { 281 window.onpopstate = function(e) {
281 var pageName = PageManager.getPageNameFromPath(); 282 var pageName = PageManager.getPageNameFromPath();
282 PageManager.setState(pageName, e.state); 283 PageManager.setState(pageName, location.hash, e.state);
283 }; 284 };
OLDNEW
« no previous file with comments | « chrome/browser/resources/options/content_settings_exceptions_area.js ('k') | chrome/browser/resources/options/search_page.js » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698