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

Unified Diff: chrome/browser/resources/md_history/app.js

Issue 2042973002: [MD History] Add routing to the synced devices page. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@hide_search_bar
Patch Set: Created 4 years, 6 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/md_history/app.js
diff --git a/chrome/browser/resources/md_history/app.js b/chrome/browser/resources/md_history/app.js
index a16204324a4bf4384f0b4b5fb8b3d1c2846d2305..7bbe7eb2922a3882661960799e6659f7e3c04b5b 100644
--- a/chrome/browser/resources/md_history/app.js
+++ b/chrome/browser/resources/md_history/app.js
@@ -48,11 +48,23 @@ Polymer({
};
}
},
+
+ // The top level route.
+ route: {
+ type: Object
+ },
+
+ // Route data for the current page.
+ routeData: {
+ type: Object,
+ observer: 'routeChanged_'
+ }
},
observers: [
'searchTermChanged_(queryState_.searchTerm)',
'groupedRangeChanged_(queryState_.range)',
+ 'routeChanged_(route)',
],
// TODO(calamity): Replace these event listeners with data bound properties.
@@ -68,6 +80,15 @@ Polymer({
this.grouped_ = loadTimeData.getBoolean('groupByDomain');
},
+ routeChanged_: function(route) {
+ var routeToElementId = {
+ 'openTabs': 'history-synced-device-manager',
+ };
tsergeant 2016/06/08 03:42:17 I'm not a big fan of this (as I think you predicte
calamity 2016/06/14 05:05:50 Ok, so we'll be going with /, /grouped/week, /grou
+ var path = this.routeData.page;
+ var elementId = routeToElementId[path] || 'history-list';
+ this.selectedPage_ = elementId;
+ },
+
/**
* Listens for history-item being selected or deselected (through checkbox)
* and changes the view of the top toolbar.

Powered by Google App Engine
This is Rietveld 408576698