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

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: fix test 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/md_history/app.js
diff --git a/chrome/browser/resources/md_history/app.js b/chrome/browser/resources/md_history/app.js
index 6d3f5d4e2d111d016111463a05fa1550b1bec366..6475b13e9afb5779c1c5871389d56cd6e0ad5512 100644
--- a/chrome/browser/resources/md_history/app.js
+++ b/chrome/browser/resources/md_history/app.js
@@ -44,8 +44,18 @@ Polymer({
};
}
},
+
+ // Route data for the current page.
+ routeData_: Object,
},
+ observers: [
+ // routeData_.page <=> selectedPage
+ 'routeDataChanged_(routeData_.page)',
+ 'selectedPageChanged_(selectedPage_)',
+ ],
+
+ // TODO(calamity): Replace these event listeners with data bound properties.
listeners: {
'cr-menu-tap': 'onMenuTap_',
'history-checkbox-select': 'checkboxSelected',
@@ -159,7 +169,7 @@ Polymer({
* @private
*/
syncedTabsSelected_: function(selectedPage) {
- return selectedPage == 'synced-devices';
+ return selectedPage == 'syncedTabs';
},
/**
@@ -173,4 +183,30 @@ Polymer({
shouldShowSpinner_: function(querying, incremental, searchTerm) {
return querying && !incremental && searchTerm != '';
},
+
+ /**
+ * @param {string} page
+ * @private
+ */
+ routeDataChanged_: function(page) {
+ this.selectedPage_ = page;
+ },
+
+ /**
+ * @param {string} selectedPage
+ * @private
+ */
+ selectedPageChanged_: function(selectedPage) {
+ this.set('routeData_.page', selectedPage);
+ },
+
+ /**
+ * @param {string} selectedPage
+ * @param {Array} items
+ * @return {string}
+ * @private
+ */
+ getSelectedPage_(selectedPage, items) {
tsergeant 2016/07/13 07:23:33 If I understand correctly, this only exists to for
calamity 2016/07/14 06:20:57 Good point. Done.
+ return selectedPage;
+ },
});

Powered by Google App Engine
This is Rietveld 408576698