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

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

Issue 2220303002: MD History: Show 'no synced tabs' when tab sync is disabled (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: minor change Created 4 years, 4 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 {{device: string, 6 * @typedef {{device: string,
7 * lastUpdateTime: string, 7 * lastUpdateTime: string,
8 * separatorIndexes: !Array<number>, 8 * separatorIndexes: !Array<number>,
9 * timestamp: number, 9 * timestamp: number,
10 * tabs: !Array<!ForeignSessionTab>, 10 * tabs: !Array<!ForeignSessionTab>,
(...skipping 171 matching lines...) Expand 10 before | Expand all | Expand 10 after
182 } 182 }
183 } 183 }
184 184
185 // Then, append any new devices. 185 // Then, append any new devices.
186 for (var i = updateCount; i < sessionList.length; i++) { 186 for (var i = updateCount; i < sessionList.length; i++) {
187 this.push('syncedDevices_', this.createInternalDevice_(sessionList[i])); 187 this.push('syncedDevices_', this.createInternalDevice_(sessionList[i]));
188 } 188 }
189 }, 189 },
190 190
191 /** 191 /**
192 * End fetching synced tabs when sync is disabled.
193 */
194 tabSyncDisabled: function() {
195 this.fetchingSyncedTabs_ = false;
196 this.clearDisplayedSyncedDevices_();
197 },
198
199 /**
192 * Get called when user's sign in state changes, this will affect UI of synced 200 * Get called when user's sign in state changes, this will affect UI of synced
193 * tabs page. Sign in promo gets displayed when user is signed out, and 201 * tabs page. Sign in promo gets displayed when user is signed out, and
194 * different messages are shown when there are no synced tabs. 202 * different messages are shown when there are no synced tabs.
195 * @param {boolean} isUserSignedIn 203 * @param {boolean} isUserSignedIn
196 */ 204 */
197 updateSignInState: function(isUserSignedIn) { 205 updateSignInState: function(isUserSignedIn) {
198 // If user's sign in state didn't change, then don't change message or 206 // If user's sign in state didn't change, then don't change message or
199 // update UI. 207 // update UI.
200 if (this.signInState_ == isUserSignedIn) 208 if (this.signInState_ == isUserSignedIn)
201 return; 209 return;
202 210
203 this.signInState_ = isUserSignedIn; 211 this.signInState_ = isUserSignedIn;
204 212
205 // User signed out, clear synced device list and show the sign in promo. 213 // User signed out, clear synced device list and show the sign in promo.
206 if (!isUserSignedIn) { 214 if (!isUserSignedIn) {
207 this.clearDisplayedSyncedDevices_(); 215 this.clearDisplayedSyncedDevices_();
208 return; 216 return;
209 } 217 }
210 // User signed in, show the loading message when querying for synced 218 // User signed in, show the loading message when querying for synced
211 // devices. 219 // devices.
212 this.fetchingSyncedTabs_ = true; 220 this.fetchingSyncedTabs_ = true;
213 }, 221 },
214 222
215 searchTermChanged: function(searchTerm) { 223 searchTermChanged: function(searchTerm) {
216 this.clearDisplayedSyncedDevices_(); 224 this.clearDisplayedSyncedDevices_();
217 this.updateSyncedDevices(this.sessionList); 225 this.updateSyncedDevices(this.sessionList);
218 } 226 }
219 }); 227 });
OLDNEW
« no previous file with comments | « chrome/browser/resources/md_history/app.js ('k') | chrome/test/data/webui/md_history/history_synced_tabs_test.js » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698