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

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

Issue 2077473002: MD History: add sign in promo in synced tabs when user isn't logged in (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: first acceptable version Created 4 years, 6 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 2016 The Chromium Authors. All rights reserved. 1 // Copyright 2016 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 /** 5 /**
6 * @typedef {{querying: boolean, 6 * @typedef {{querying: boolean,
7 * searchTerm: string, 7 * searchTerm: string,
8 * results: ?Array<!HistoryEntry>, 8 * results: ?Array<!HistoryEntry>,
9 * info: ?HistoryQuery, 9 * info: ?HistoryQuery,
10 * incremental: boolean, 10 * incremental: boolean,
(...skipping 204 matching lines...) Expand 10 before | Expand all | Expand 10 after
215 * @return {string} 215 * @return {string}
216 */ 216 */
217 getSelectedPage: function(selectedPage, range) { 217 getSelectedPage: function(selectedPage, range) {
218 if (selectedPage == 'history-list' && range != HistoryRange.ALL_TIME) 218 if (selectedPage == 'history-list' && range != HistoryRange.ALL_TIME)
219 return 'history-grouped-list'; 219 return 'history-grouped-list';
220 220
221 return selectedPage; 221 return selectedPage;
222 }, 222 },
223 223
224 /** 224 /**
225 * Update sign in state of synced device manager after user logs in or out.
226 * @param {boolean} isUserSignedIn
227 */
228 updateSignInState: function(isUserSignedIn) {
229 var syncedDeviceManagerElem =
230 /** @type {HistorySyncedDeviceManagerElement} */this
231 .$$('history-synced-device-manager');
232 waitForUpgrade(syncedDeviceManagerElem).then(function() {
tsergeant 2016/06/17 06:22:02 There's no need to use waitForUpgrade here. That'
lshang 2016/06/21 03:00:26 Done.
233 syncedDeviceManagerElem.updateSignInState(isUserSignedIn);
234 });
235 },
236
237 /**
225 * @param {string} selectedPage 238 * @param {string} selectedPage
226 * @return {boolean} 239 * @return {boolean}
227 * @private 240 * @private
228 */ 241 */
229 syncedTabsSelected_: function(selectedPage) { 242 syncedTabsSelected_: function(selectedPage) {
230 return selectedPage == 'history-synced-device-manager'; 243 return selectedPage == 'history-synced-device-manager';
231 }, 244 },
232 245
233 /** 246 /**
234 * @param {boolean} querying 247 * @param {boolean} querying
235 * @param {boolean} incremental 248 * @param {boolean} incremental
236 * @param {string} searchTerm 249 * @param {string} searchTerm
237 * @return {boolean} Whether a loading spinner should be shown (implies the 250 * @return {boolean} Whether a loading spinner should be shown (implies the
238 * backend is querying a new search term). 251 * backend is querying a new search term).
239 * @private 252 * @private
240 */ 253 */
241 shouldShowSpinner_: function(querying, incremental, searchTerm) { 254 shouldShowSpinner_: function(querying, incremental, searchTerm) {
242 return querying && !incremental && searchTerm != ''; 255 return querying && !incremental && searchTerm != '';
243 } 256 }
244 }); 257 });
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698