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 36 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
47 */ | 47 */ |
48 function showNotification( | 48 function showNotification( |
49 hasSyncedResults, includeOtherFormsOfBrowsingHistory) { | 49 hasSyncedResults, includeOtherFormsOfBrowsingHistory) { |
50 // TODO(msramek): |hasSyncedResults| was used in the old WebUI to show | 50 // TODO(msramek): |hasSyncedResults| was used in the old WebUI to show |
51 // the message about other signed-in devices. This message does not exist | 51 // the message about other signed-in devices. This message does not exist |
52 // in the MD history anymore, so the parameter is not needed. Remove it | 52 // in the MD history anymore, so the parameter is not needed. Remove it |
53 // when WebUI is removed and this becomes the only client of | 53 // when WebUI is removed and this becomes the only client of |
54 // BrowsingHistoryHandler. | 54 // BrowsingHistoryHandler. |
55 var appElem = $('history-app'); | 55 var appElem = $('history-app'); |
56 waitForUpgrade(appElem).then(function() { | 56 waitForUpgrade(appElem).then(function() { |
57 /** @type {HistoryAppElement} */(appElem) | 57 /** @type {HistoryAppElement} */ (appElem).showSidebarFooter = |
58 .getSideBar().showFooter = includeOtherFormsOfBrowsingHistory; | 58 includeOtherFormsOfBrowsingHistory; |
59 }); | 59 }); |
60 } | 60 } |
61 | 61 |
62 /** | 62 /** |
63 * Receives the synced history data. An empty list means that either there are | 63 * Receives the synced history data. An empty list means that either there are |
64 * no foreign sessions, or tab sync is disabled for this profile. | 64 * no foreign sessions, or tab sync is disabled for this profile. |
65 * |isTabSyncEnabled| makes it possible to distinguish between the cases. | 65 * |isTabSyncEnabled| makes it possible to distinguish between the cases. |
66 * | 66 * |
67 * @param {!Array<!ForeignSession>} sessionList Array of objects describing the | 67 * @param {!Array<!ForeignSession>} sessionList Array of objects describing the |
68 * sessions from other devices. | 68 * sessions from other devices. |
(...skipping 17 matching lines...) Expand all Loading... |
86 * Called by the history backend after user's sign in state changes. | 86 * Called by the history backend after user's sign in state changes. |
87 * @param {boolean} isUserSignedIn Whether user is signed in or not now. | 87 * @param {boolean} isUserSignedIn Whether user is signed in or not now. |
88 */ | 88 */ |
89 function updateSignInState(isUserSignedIn) { | 89 function updateSignInState(isUserSignedIn) { |
90 var appElem = $('history-app'); | 90 var appElem = $('history-app'); |
91 waitForUpgrade(appElem).then(function() { | 91 waitForUpgrade(appElem).then(function() { |
92 /** @type {HistoryAppElement} */(appElem) | 92 /** @type {HistoryAppElement} */(appElem) |
93 .updateSignInState(isUserSignedIn); | 93 .updateSignInState(isUserSignedIn); |
94 }); | 94 }); |
95 } | 95 } |
OLD | NEW |