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

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

Issue 2517243002: [Sync] Removing complexity around PROXY_TABS now that empty sessions are provided when disabled. (Closed)
Patch Set: Rebase and re-vulcanize after conflict. Created 4 years 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 {{device: string, 6 * @typedef {{device: string,
7 * lastUpdateTime: string, 7 * lastUpdateTime: string,
8 * opened: boolean, 8 * opened: boolean,
9 * separatorIndexes: !Array<number>, 9 * separatorIndexes: !Array<number>,
10 * timestamp: number, 10 * timestamp: number,
(...skipping 249 matching lines...) Expand 10 before | Expand all | Expand 10 after
260 sessionList.forEach(function(session) { 260 sessionList.forEach(function(session) {
261 var device = this.createInternalDevice_(session); 261 var device = this.createInternalDevice_(session);
262 if (device.tabs.length != 0) 262 if (device.tabs.length != 0)
263 devices.push(device); 263 devices.push(device);
264 }.bind(this)); 264 }.bind(this));
265 265
266 this.syncedDevices_ = devices; 266 this.syncedDevices_ = devices;
267 }, 267 },
268 268
269 /** 269 /**
270 * End fetching synced tabs when sync is disabled.
271 */
272 tabSyncDisabled: function() {
273 this.fetchingSyncedTabs_ = false;
274 this.clearDisplayedSyncedDevices_();
275 },
276
277 /**
278 * Get called when user's sign in state changes, this will affect UI of synced 270 * Get called when user's sign in state changes, this will affect UI of synced
279 * tabs page. Sign in promo gets displayed when user is signed out, and 271 * tabs page. Sign in promo gets displayed when user is signed out, and
280 * different messages are shown when there are no synced tabs. 272 * different messages are shown when there are no synced tabs.
281 */ 273 */
282 signInStateChanged_: function() { 274 signInStateChanged_: function() {
283 this.fire('history-view-changed'); 275 this.fire('history-view-changed');
284 276
285 // User signed out, clear synced device list and show the sign in promo. 277 // User signed out, clear synced device list and show the sign in promo.
286 if (!this.signInState) { 278 if (!this.signInState) {
287 this.clearDisplayedSyncedDevices_(); 279 this.clearDisplayedSyncedDevices_();
288 return; 280 return;
289 } 281 }
290 // User signed in, show the loading message when querying for synced 282 // User signed in, show the loading message when querying for synced
291 // devices. 283 // devices.
292 this.fetchingSyncedTabs_ = true; 284 this.fetchingSyncedTabs_ = true;
293 }, 285 },
294 286
295 searchTermChanged: function(searchTerm) { 287 searchTermChanged: function(searchTerm) {
296 this.clearDisplayedSyncedDevices_(); 288 this.clearDisplayedSyncedDevices_();
297 this.updateSyncedDevices(this.sessionList); 289 this.updateSyncedDevices(this.sessionList);
298 } 290 }
299 }); 291 });
OLDNEW
« no previous file with comments | « chrome/browser/resources/md_history/lazy_load.crisper.js ('k') | chrome/browser/ui/webui/foreign_session_handler.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698