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

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

Issue 1607403004: MD History: Display synced tabs history (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@second_patch
Patch Set: Style fixes & having no synced history will hide the sidebar Created 4 years, 11 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/synced_device_manager.js
diff --git a/chrome/browser/resources/md_history/synced_device_manager.js b/chrome/browser/resources/md_history/synced_device_manager.js
new file mode 100644
index 0000000000000000000000000000000000000000..21ad6d97022a024c2abc228dc6f88de86645e86f
--- /dev/null
+++ b/chrome/browser/resources/md_history/synced_device_manager.js
@@ -0,0 +1,35 @@
+// Copyright 2016 The Chromium Authors. All rights reserved.
+// Use of this source code is governed by a BSD-style license that can be
+// found in the LICENSE file.
+
+Polymer({
+ is: 'synced-device-manager',
+
+ properties: {
+ // An array of synced devices with synced tab data.
+ syncedTabs: {
calamity 2016/02/02 04:09:48 syncedDevices?
yingran 2016/02/09 04:21:34 Done.
+ type: Array,
+ value: []
+ }
+ },
+
+ /**
+ * Re-organises the sessionList information.
+ */
+ addSyncedHistory: function(sessionList) {
+ // Does not add more items onto the page when the sessionList updates.
+ // TODO(yingran) : update the cards dynamically by refreshing the tab list
+ // and last update time for each synced tab card.
+ if (this.syncedTabs.length > 0) {
+ return;
+ }
+
+ for (var i = 0; i < sessionList.length && sessionList[i].windows[0]; i++) {
+ this.push('syncedTabs', {
+ device: sessionList[i].name,
+ lastUpdateTime: '- ' + sessionList[i].modifiedTime,
+ tabs: sessionList[i].windows[0].tabs,
calamity 2016/02/02 04:09:48 Only 1 window? We should also have a horizontal li
yingran 2016/02/09 04:21:34 Coming soon, in another CL!
calamity 2016/02/11 00:23:31 Can we have tabs from all windows, unsplit? That w
yingran 2016/02/11 02:06:35 they already appear... as in all tabs from all win
+ });
+ }
+ }
+});

Powered by Google App Engine
This is Rietveld 408576698