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

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

Issue 1874473004: MD History: Support dynamically updating synced tab data (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Fix indent Created 4 years, 8 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
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
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 }
OLDNEW
« no previous file with comments | « chrome/browser/resources/history/externs.js ('k') | chrome/browser/resources/md_history/synced_device_manager.js » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698