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

Unified Diff: chrome/browser/resources/settings/route.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/route.js
diff --git a/chrome/browser/resources/settings/route.js b/chrome/browser/resources/settings/route.js
index 728caf47cb9af00d15b0dc0c7c50bc95b371b62f..096b3c13c9ecc79ea540eec75d273a1504609128 100644
--- a/chrome/browser/resources/settings/route.js
+++ b/chrome/browser/resources/settings/route.js
@@ -270,6 +270,10 @@ cr.define('settings', function() {
attached: function() {
assert(!routeObservers_.has(this));
routeObservers_.add(this);
+
+ // Emulating Polymer data bindings, the observer is called when the
+ // element starts observing the route.
+ this.currentRouteChanged(currentRoute_, undefined);
},
/** @override */
@@ -325,10 +329,11 @@ cr.define('settings', function() {
* @param {!URLSearchParams} queryParameters
*/
var setCurrentRoute = function(route, queryParameters) {
+ var oldRoute = currentRoute_;
currentRoute_ = route;
currentQueryParameters_ = queryParameters;
for (var observer of routeObservers_)
- observer.currentRouteChanged();
+ observer.currentRouteChanged(currentRoute_, oldRoute);
};
/** @return {!settings.Route} */

Powered by Google App Engine
This is Rietveld 408576698