| OLD | NEW |
| 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 Loading... |
| 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 }); |
| OLD | NEW |