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 29 matching lines...) Expand all Loading... | |
40 | 40 |
41 /** | 41 /** |
42 * Called by the history backend after receiving results and after discovering | 42 * Called by the history backend after receiving results and after discovering |
43 * the existence of other forms of browsing history. | 43 * the existence of other forms of browsing history. |
44 * @param {boolean} hasSyncedResults Whether there are synced results. | 44 * @param {boolean} hasSyncedResults Whether there are synced results. |
45 * @param {boolean} includeOtherFormsOfBrowsingHistory Whether to include | 45 * @param {boolean} includeOtherFormsOfBrowsingHistory Whether to include |
46 * a sentence about the existence of other forms of browsing history. | 46 * a sentence about the existence of other forms of browsing history. |
47 */ | 47 */ |
48 function showNotification( | 48 function showNotification( |
49 hasSyncedResults, includeOtherFormsOfBrowsingHistory) { | 49 hasSyncedResults, includeOtherFormsOfBrowsingHistory) { |
50 // TODO(msramek): Implement the joint notification about web history and other | 50 // TODO(msramek): |hasSyncedResults| was used in the old WebUI to show |
51 // forms of browsing history for the MD history page. | 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 | |
53 // when WebUI is removed and this becomes the only client of | |
54 // BrowsingHistoryHandler. | |
55 var appElem = $('history-app'); | |
56 waitForUpgrade(appElem).then(function() { | |
57 /** @type {HistoryAppElement} */(appElem) | |
58 .set('showFooter', includeOtherFormsOfBrowsingHistory); | |
Dan Beam
2016/06/30 23:30:03
nit: you can just do
.showFooter = includeOther
msramek
2016/07/01 11:42:06
Done.
| |
59 }); | |
52 } | 60 } |
53 | 61 |
54 /** | 62 /** |
55 * 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 |
56 * no foreign sessions, or tab sync is disabled for this profile. | 64 * no foreign sessions, or tab sync is disabled for this profile. |
57 * |isTabSyncEnabled| makes it possible to distinguish between the cases. | 65 * |isTabSyncEnabled| makes it possible to distinguish between the cases. |
58 * | 66 * |
59 * @param {!Array<!ForeignSession>} sessionList Array of objects describing the | 67 * @param {!Array<!ForeignSession>} sessionList Array of objects describing the |
60 * sessions from other devices. | 68 * sessions from other devices. |
61 * @param {boolean} isTabSyncEnabled Is tab sync enabled for this profile? | 69 * @param {boolean} isTabSyncEnabled Is tab sync enabled for this profile? |
(...skipping 16 matching lines...) Expand all Loading... | |
78 * 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. |
79 * @param {boolean} isUserSignedIn Whether user is signed in or not now. | 87 * @param {boolean} isUserSignedIn Whether user is signed in or not now. |
80 */ | 88 */ |
81 function updateSignInState(isUserSignedIn) { | 89 function updateSignInState(isUserSignedIn) { |
82 var appElem = $('history-app'); | 90 var appElem = $('history-app'); |
83 waitForUpgrade(appElem).then(function() { | 91 waitForUpgrade(appElem).then(function() { |
84 /** @type {HistoryAppElement} */(appElem) | 92 /** @type {HistoryAppElement} */(appElem) |
85 .updateSignInState(isUserSignedIn); | 93 .updateSignInState(isUserSignedIn); |
86 }); | 94 }); |
87 } | 95 } |
OLD | NEW |