Chromium Code Reviews| OLD | NEW |
|---|---|
| 1 // Copyright 2016 The Chromium Authors. All rights reserved. | 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 | 2 // Use of this source code is governed by a BSD-style license that can be |
| 3 // found in the LICENSE file. | 3 // found in the LICENSE file. |
| 4 | 4 |
| 5 Polymer({ | 5 Polymer({ |
| 6 is: 'history-app', | 6 is: 'history-app', |
| 7 | 7 |
| 8 properties: { | 8 properties: { |
| 9 // The id of the currently selected page. | 9 // The id of the currently selected page. |
| 10 selectedPage: { | 10 selectedPage: { |
| (...skipping 74 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 85 if (info.finished) | 85 if (info.finished) |
| 86 list.disableResultLoading(); | 86 list.disableResultLoading(); |
| 87 }, | 87 }, |
| 88 | 88 |
| 89 /** | 89 /** |
| 90 * @param {!Array<!ForeignSession>} sessionList Array of objects describing | 90 * @param {!Array<!ForeignSession>} sessionList Array of objects describing |
| 91 * the sessions from other devices. | 91 * the sessions from other devices. |
| 92 * @param {boolean} isTabSyncEnabled Is tab sync enabled for this profile? | 92 * @param {boolean} isTabSyncEnabled Is tab sync enabled for this profile? |
| 93 */ | 93 */ |
| 94 setForeignSessions: function(sessionList, isTabSyncEnabled) { | 94 setForeignSessions: function(sessionList, isTabSyncEnabled) { |
| 95 // TODO(calamity): Add a 'no synced devices' message when sessions are | 95 if (!isTabSyncEnabled) |
|
tsergeant
2016/05/05 17:59:09
This TODO is still relevant.
calamity
2016/05/05 18:49:33
Reinstated.
| |
| 96 // empty. | 96 return; |
| 97 this.$['history-side-bar'].hidden = !isTabSyncEnabled; | 97 |
| 98 var syncedDeviceElem = this.$['history-synced-device-manager']; | 98 var syncedDeviceElem = this.$['history-synced-device-manager']; |
| 99 var syncedDeviceManager = | 99 var syncedDeviceManager = |
| 100 /** @type {HistorySyncedDeviceManagerElement} */(syncedDeviceElem); | 100 /** @type {HistorySyncedDeviceManagerElement} */(syncedDeviceElem); |
| 101 if (isTabSyncEnabled) { | 101 syncedDeviceManager.setSyncedHistory(sessionList); |
| 102 syncedDeviceManager.setSyncedHistory(sessionList); | 102 /** @type {HistoryToolbarElement} */(this.$.toolbar).hasSidebar = true; |
|
tsergeant
2016/05/05 17:59:09
Can you please change the implementation of histor
calamity
2016/05/05 18:49:33
Good point. Done. I'll remove more of the extraneo
| |
| 103 /** @type {HistoryToolbarElement} */(this.$.toolbar).hasSidebar = true; | |
| 104 } | |
| 105 }, | 103 }, |
| 106 | 104 |
| 107 deleteComplete: function() { | 105 deleteComplete: function() { |
| 108 var historyList = /** @type {HistoryListElement} */(this.$['history-list']); | 106 var historyList = /** @type {HistoryListElement} */(this.$['history-list']); |
| 109 var toolbar = /** @type {HistoryToolbarElement} */(this.$.toolbar); | 107 var toolbar = /** @type {HistoryToolbarElement} */(this.$.toolbar); |
| 110 historyList.removeDeletedHistory(toolbar.count); | 108 historyList.removeDeletedHistory(toolbar.count); |
| 111 toolbar.count = 0; | 109 toolbar.count = 0; |
| 112 } | 110 } |
| 113 }); | 111 }); |
| OLD | NEW |