| OLD | NEW |
| (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: 'synced-device-manager', |
| 7 |
| 8 properties: { |
| 9 // An array of synced devices with synced tab data. |
| 10 syncedDevices: { |
| 11 type: Array, |
| 12 value: [] |
| 13 } |
| 14 }, |
| 15 |
| 16 /** |
| 17 * Re-organises the sessionList information. |
| 18 */ |
| 19 addSyncedHistory: function(sessionList) { |
| 20 // Does not add more items onto the page when the sessionList updates. |
| 21 // TODO(yingran) : update the cards dynamically by refreshing the tab list |
| 22 // and last update time for each synced tab card. |
| 23 if (this.syncedDevices.length > 0) { |
| 24 return; |
| 25 } |
| 26 |
| 27 for (var i = 0; i < sessionList.length && sessionList[i].windows[0]; i++) { |
| 28 this.push('syncedDevices', { |
| 29 device: sessionList[i].name, |
| 30 lastUpdateTime: '- ' + sessionList[i].modifiedTime, |
| 31 tabs: sessionList[i].windows[0].tabs, |
| 32 }); |
| 33 } |
| 34 } |
| 35 }); |
| OLD | NEW |