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 /** @type {Promise} */ | 10 /** @type {Promise} */ |
(...skipping 40 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
51 | 51 |
52 /** | 52 /** |
53 * Called by the history backend after receiving results and after discovering | 53 * Called by the history backend after receiving results and after discovering |
54 * the existence of other forms of browsing history. | 54 * the existence of other forms of browsing history. |
55 * @param {boolean} hasSyncedResults Whether there are synced results. | 55 * @param {boolean} hasSyncedResults Whether there are synced results. |
56 * @param {boolean} includeOtherFormsOfBrowsingHistory Whether to include | 56 * @param {boolean} includeOtherFormsOfBrowsingHistory Whether to include |
57 * a sentence about the existence of other forms of browsing history. | 57 * a sentence about the existence of other forms of browsing history. |
58 */ | 58 */ |
59 function showNotification( | 59 function showNotification( |
60 hasSyncedResults, includeOtherFormsOfBrowsingHistory) { | 60 hasSyncedResults, includeOtherFormsOfBrowsingHistory) { |
61 // TODO(msramek): |hasSyncedResults| was used in the old WebUI to show | |
62 // the message about other signed-in devices. This message does not exist | |
63 // in the MD history anymore, so the parameter is not needed. Remove it | |
64 // when WebUI is removed and this becomes the only client of | |
65 // BrowsingHistoryHandler. | |
66 waitForAppUpgrade().then(function() { | 61 waitForAppUpgrade().then(function() { |
67 /** @type {HistoryAppElement} */ ($('history-app')).showSidebarFooter = | 62 var app = /** @type {HistoryAppElement} */ ($('history-app')); |
68 includeOtherFormsOfBrowsingHistory; | 63 app.showSidebarFooter = includeOtherFormsOfBrowsingHistory; |
| 64 app.hasSyncedResults = hasSyncedResults; |
69 }); | 65 }); |
70 } | 66 } |
71 | 67 |
72 /** | 68 /** |
73 * Receives the synced history data. An empty list means that either there are | 69 * Receives the synced history data. An empty list means that either there are |
74 * no foreign sessions, or tab sync is disabled for this profile. | 70 * no foreign sessions, or tab sync is disabled for this profile. |
75 * |isTabSyncEnabled| makes it possible to distinguish between the cases. | 71 * |isTabSyncEnabled| makes it possible to distinguish between the cases. |
76 * | 72 * |
77 * @param {!Array<!ForeignSession>} sessionList Array of objects describing the | 73 * @param {!Array<!ForeignSession>} sessionList Array of objects describing the |
78 * sessions from other devices. | 74 * sessions from other devices. |
(...skipping 21 matching lines...) Expand all Loading... |
100 * @param {boolean} isUserSignedIn Whether user is signed in or not now. | 96 * @param {boolean} isUserSignedIn Whether user is signed in or not now. |
101 */ | 97 */ |
102 function updateSignInState(isUserSignedIn) { | 98 function updateSignInState(isUserSignedIn) { |
103 waitForAppUpgrade().then(function() { | 99 waitForAppUpgrade().then(function() { |
104 if ($('history-app')) { | 100 if ($('history-app')) { |
105 /** @type {HistoryAppElement} */($('history-app')) | 101 /** @type {HistoryAppElement} */($('history-app')) |
106 .updateSignInState(isUserSignedIn); | 102 .updateSignInState(isUserSignedIn); |
107 } | 103 } |
108 }); | 104 }); |
109 } | 105 } |
OLD | NEW |