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

Side by Side Diff: chrome/browser/resources/md_history/synced_device_manager.js

Issue 1729263005: MD History: Display synced tabs history. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@mdh_shared_styles
Patch Set: address nit Created 4 years, 9 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 unified diff | Download patch
OLDNEW
(Empty)
1 // Copyright 2016 The Chromium Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file.
4
5 Polymer({
6 is: 'history-synced-device-manager',
7
8 properties: {
9 // An array of synced devices with synced tab data.
Dan Beam 2016/03/10 18:57:15 can this be @typed as well?
calamity 2016/03/14 02:29:40 Done.
10 syncedDevices: {
11 type: Array,
12 value: function() { return []; }
13 }
14 },
15
16 /**
17 * Adds |sessionList| to the currently displayed synced tabs.
18 * @param {Array<Session>} sessionList
19 */
20 addSyncedHistory: function(sessionList) {
21 // TODO(calamity): Does not add more items onto the page when the
22 // sessionList updates. Update the cards dynamically by refreshing the tab
23 // list and last update time for each synced tab card.
24 if (this.syncedDevices.length > 0)
25 return;
26
27 for (var i = 0; i < sessionList.length; i++) {
28 var tabs = [];
29 for (var j = 0; j < sessionList[i].windows.length; j++) {
30 tabs = tabs.concat(sessionList[i].windows[j].tabs);
Dan Beam 2016/03/10 18:57:15 nit: .tabs can never be empty, right? otherwise t
calamity 2016/03/14 02:29:40 #BetterSafeThanSorry
31 tabs[tabs.length - 1].needsWindowSeparator = true;
32 }
33
34 this.push('syncedDevices', {
35 device: sessionList[i].name,
36 lastUpdateTime: '– ' + sessionList[i].modifiedTime,
37 tabs: tabs,
38 });
39 }
40 }
41 });
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698