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. |