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

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: Fix flaky test yet a different way 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 0b94e78334c8f1b72da5dc3c7b5ab5dde1e96673..cbc368d132f1c069c02e10daac50b7a204b210fe 100644
--- a/chrome/browser/resources/settings/settings_main/settings_main.js
+++ b/chrome/browser/resources/settings/settings_main/settings_main.js
@@ -20,7 +20,7 @@ Polymer({
/**
* The current active route.
- * @type {!SettingsRoute}
+ * @type {!settings.Route}
*/
currentRoute: {
type: Object,
@@ -73,11 +73,8 @@ Polymer({
attached: function() {
document.addEventListener('toggle-advanced-page', function(e) {
this.advancedToggleExpanded_ = e.detail;
- this.currentRoute = {
- page: this.advancedToggleExpanded_ ? 'advanced' : 'basic',
- section: '',
- subpage: [],
- };
+ settings.navigateTo(this.advancedToggleExpanded_ ?
+ settings.Route.ADVANCED : settings.Route.BASIC);
}.bind(this));
doWhenReady(
@@ -109,7 +106,6 @@ Polymer({
},
/**
- * @param {!SettingsRoute} newRoute
* @private
*/
currentRouteChanged_: function(newRoute) {
@@ -131,7 +127,7 @@ Polymer({
}
// Wait for the dom-if changes prior to calculating the overflow padding.
- this.async(function() {
+ setTimeout(function() {
this.$.overscroll.style.paddingBottom = this.overscrollHeight_() + 'px';
});
michaelpg 2016/07/27 03:11:35 .bind(this)
},
@@ -190,11 +186,7 @@ Polymer({
* @private
*/
ensureInDefaultSearchPage_: function() {
- if (this.currentRoute.page != 'basic' ||
- this.currentRoute.section != '' ||
- this.currentRoute.subpage.length != 0) {
- this.currentRoute = {page: 'basic', section: '', subpage: [], url: ''};
- }
+ settings.navigateTo(settings.Route.BASIC);
},
/**

Powered by Google App Engine
This is Rietveld 408576698