| OLD | NEW |
| 1 // Copyright 2015 The Chromium Authors. All rights reserved. | 1 // Copyright 2015 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 // Send the history query immediately. This allows the query to process during | 5 // Send the history query immediately. This allows the query to process during |
| 6 // the initial page startup. | 6 // the initial page startup. |
| 7 chrome.send('queryHistory', ['', 0, 0, 0, RESULTS_PER_PAGE]); | 7 chrome.send('queryHistory', ['', 0, 0, 0, RESULTS_PER_PAGE]); |
| 8 chrome.send('getForeignSessions'); | 8 chrome.send('getForeignSessions'); |
| 9 | 9 |
| 10 /** | 10 /** |
| (...skipping 111 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 122 * @param {boolean} isTabSyncEnabled Is tab sync enabled for this profile? | 122 * @param {boolean} isTabSyncEnabled Is tab sync enabled for this profile? |
| 123 */ | 123 */ |
| 124 function setForeignSessions(sessionList, isTabSyncEnabled) { | 124 function setForeignSessions(sessionList, isTabSyncEnabled) { |
| 125 // TODO(calamity): Add a 'no synced devices' message when sessions are empty. | 125 // TODO(calamity): Add a 'no synced devices' message when sessions are empty. |
| 126 $('history-side-bar').hidden = !isTabSyncEnabled; | 126 $('history-side-bar').hidden = !isTabSyncEnabled; |
| 127 var syncedDeviceElem = $('history-synced-device-manager'); | 127 var syncedDeviceElem = $('history-synced-device-manager'); |
| 128 waitForUpgrade(syncedDeviceElem).then(function() { | 128 waitForUpgrade(syncedDeviceElem).then(function() { |
| 129 var syncedDeviceManager = | 129 var syncedDeviceManager = |
| 130 /** @type {HistorySyncedDeviceManagerElement} */(syncedDeviceElem); | 130 /** @type {HistorySyncedDeviceManagerElement} */(syncedDeviceElem); |
| 131 if (isTabSyncEnabled) | 131 if (isTabSyncEnabled) |
| 132 syncedDeviceManager.addSyncedHistory(sessionList); | 132 syncedDeviceManager.setSyncedHistory(sessionList); |
| 133 }); | 133 }); |
| 134 } | 134 } |
| 135 | 135 |
| 136 /** | 136 /** |
| 137 * Called by the history backend when deletion was succesful. | 137 * Called by the history backend when deletion was succesful. |
| 138 */ | 138 */ |
| 139 function deleteComplete() { | 139 function deleteComplete() { |
| 140 var historyList = /** @type {HistoryListElement} */($('history-list')); | 140 var historyList = /** @type {HistoryListElement} */($('history-list')); |
| 141 var toolbar = /** @type {HistoryToolbarElement} */($('toolbar')); | 141 var toolbar = /** @type {HistoryToolbarElement} */($('toolbar')); |
| 142 historyList.removeDeletedHistory(toolbar.count); | 142 historyList.removeDeletedHistory(toolbar.count); |
| 143 toolbar.count = 0; | 143 toolbar.count = 0; |
| 144 } | 144 } |
| 145 | 145 |
| 146 /** | 146 /** |
| 147 * Called by the history backend when the deletion failed. | 147 * Called by the history backend when the deletion failed. |
| 148 */ | 148 */ |
| 149 function deleteFailed() { | 149 function deleteFailed() { |
| 150 } | 150 } |
| 151 | 151 |
| 152 /** | 152 /** |
| 153 * Called when the history is deleted by someone else. | 153 * Called when the history is deleted by someone else. |
| 154 */ | 154 */ |
| 155 function historyDeleted() { | 155 function historyDeleted() { |
| 156 } | 156 } |
| OLD | NEW |