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

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

Issue 2210933004: Settings Router Refactor: Kill settings-router. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: fix merge Created 4 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 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 30eb744895e2bfcd570189da2d7104532ef06f75..676429b994c7533a5426cb7ced6b98673c6cadf0 100644
--- a/chrome/browser/resources/settings/settings_main/settings_main.js
+++ b/chrome/browser/resources/settings/settings_main/settings_main.js
@@ -9,6 +9,8 @@
Polymer({
is: 'settings-main',
+ behaviors: [settings.RouteObserverBehavior],
+
properties: {
/**
* Preferences state.
@@ -18,16 +20,6 @@ Polymer({
notify: true,
},
- /**
- * The current active route.
- * @type {!settings.Route}
- */
- currentRoute: {
- type: Object,
- notify: true,
- observer: 'currentRouteChanged_',
- },
-
/** @private */
advancedToggleExpanded_: {
type: Boolean,
@@ -129,10 +121,8 @@ Polymer({
return showBasicPage && !inSubpage;
},
- /**
- * @private
- */
- currentRouteChanged_: function(newRoute) {
+ /** @protected */
+ currentRouteChanged: function(newRoute) {
this.inSubpage_ = newRoute.subpage.length > 0;
this.style.height = this.inSubpage_ ? '100%' : '';
@@ -171,12 +161,11 @@ Polymer({
* @private
*/
overscrollHeight_: function() {
- if (!this.currentRoute || this.currentRoute.subpage.length != 0 ||
- this.showPages_.about) {
+ var route = settings.getCurrentRoute();
+ if (route.subpage.length != 0 || this.showPages_.about)
return 0;
- }
- var query = 'settings-section[section="' + this.currentRoute.section + '"]';
+ var query = 'settings-section[section="' + route.section + '"]';
var topSection = this.$$('settings-basic-page').$$(query);
if (!topSection && this.showPages_.advanced)
topSection = this.$$('settings-advanced-page').$$(query);

Powered by Google App Engine
This is Rietveld 408576698