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

Unified Diff: chrome/browser/resources/settings/settings_main/settings_main.js

Issue 2156413002: Settings Router Refactor: Migrate to settings.Route.navigateTo calls. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: merge origin/master Created 4 years, 5 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 side-by-side diff with in-line comments
Download patch
Index: chrome/browser/resources/settings/settings_main/settings_main.js
diff --git a/chrome/browser/resources/settings/settings_main/settings_main.js b/chrome/browser/resources/settings/settings_main/settings_main.js
index b23930bcc55a02cca9df6a3e898753257a2916a0..30e6199f87c1b346f3b05de782a7aa0b78b4058e 100644
--- a/chrome/browser/resources/settings/settings_main/settings_main.js
+++ b/chrome/browser/resources/settings/settings_main/settings_main.js
@@ -26,7 +26,7 @@ Polymer({
/**
* The current active route.
- * @type {!SettingsRoute}
+ * @type {!settings.Route}
*/
currentRoute: {
type: Object,
@@ -84,11 +84,8 @@ Polymer({
document.addEventListener('toggle-advanced-page', function(e) {
this.showAdvancedPage_ = e.detail;
this.isAdvancedMenuOpen_ = e.detail;
- this.currentRoute = {
- page: this.isAdvancedMenuOpen_ ? 'advanced' : 'basic',
- section: '',
- subpage: [],
- };
+ settings.navigateTo(this.isAdvancedMenuOpen_ ?
+ settings.Route.ADVANCED : settings.Route.BASIC);
}.bind(this));
doWhenReady(
@@ -111,7 +108,7 @@ Polymer({
},
/**
- * @param {!SettingsRoute} newRoute
+ * @param {!settings.Route} newRoute
* @private
*/
currentRouteChanged_: function(newRoute) {
@@ -140,11 +137,8 @@ Polymer({
* @private
*/
ensureInDefaultSearchPage_: function() {
- if (this.currentRoute.page != 'basic' ||
- this.currentRoute.section != '' ||
- this.currentRoute.subpage.length != 0) {
- this.currentRoute = {page: 'basic', section: '', subpage: [], url: ''};
- }
+ if (this.currentRoute != settings.Route.BASIC)
+ settings.navigateTo(settings.Route.BASIC);
Dan Beam 2016/07/23 00:17:11 nit: maybe considering putting if (this.current
tommycli 2016/07/25 16:47:20 Done.
},
/**

Powered by Google App Engine
This is Rietveld 408576698