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

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

Issue 2238163002: [MD History] Add UMA stats for switching views and the CBD button. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@start_focus_in_search_bar
Patch Set: address comments 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 21 matching lines...) Expand all
32 /** 32 /**
33 * An array of synced devices with synced tab data. 33 * An array of synced devices with synced tab data.
34 * @type {!Array<!ForeignDeviceInternal>} 34 * @type {!Array<!ForeignDeviceInternal>}
35 */ 35 */
36 syncedDevices_: { 36 syncedDevices_: {
37 type: Array, 37 type: Array,
38 value: function() { return []; } 38 value: function() { return []; }
39 }, 39 },
40 40
41 /** @private */ 41 /** @private */
42 signInState_: { 42 signInState: {
43 type: Boolean, 43 type: Boolean,
44 value: loadTimeData.getBoolean('isUserSignedIn'), 44 observer: 'signInStateChanged_',
45 }, 45 },
46 46
47 /** @private */ 47 /** @private */
48 guestSession_: { 48 guestSession_: {
49 type: Boolean, 49 type: Boolean,
50 value: loadTimeData.getBoolean('isGuestSession'), 50 value: loadTimeData.getBoolean('isGuestSession'),
51 }, 51 },
52 52
53 /** @private */ 53 /** @private */
54 fetchingSyncedTabs_: { 54 fetchingSyncedTabs_: {
(...skipping 165 matching lines...) Expand 10 before | Expand all | Expand 10 after
220 */ 220 */
221 tabSyncDisabled: function() { 221 tabSyncDisabled: function() {
222 this.fetchingSyncedTabs_ = false; 222 this.fetchingSyncedTabs_ = false;
223 this.clearDisplayedSyncedDevices_(); 223 this.clearDisplayedSyncedDevices_();
224 }, 224 },
225 225
226 /** 226 /**
227 * Get called when user's sign in state changes, this will affect UI of synced 227 * Get called when user's sign in state changes, this will affect UI of synced
228 * tabs page. Sign in promo gets displayed when user is signed out, and 228 * tabs page. Sign in promo gets displayed when user is signed out, and
229 * different messages are shown when there are no synced tabs. 229 * different messages are shown when there are no synced tabs.
230 * @param {boolean} isUserSignedIn 230 * @param {boolean} signInState
tsergeant 2016/08/19 00:46:23 Delete this to keep closure happy.
calamity 2016/08/19 06:26:07 Done.
231 */ 231 */
232 updateSignInState: function(isUserSignedIn) { 232 signInStateChanged_: function() {
233 // If user's sign in state didn't change, then don't change message or 233 this.fire('history-view-changed');
234 // update UI.
235 if (this.signInState_ == isUserSignedIn)
236 return;
237
238 this.signInState_ = isUserSignedIn;
239 234
240 // User signed out, clear synced device list and show the sign in promo. 235 // User signed out, clear synced device list and show the sign in promo.
241 if (!isUserSignedIn) { 236 if (!this.signInState) {
242 this.clearDisplayedSyncedDevices_(); 237 this.clearDisplayedSyncedDevices_();
243 return; 238 return;
244 } 239 }
245 // User signed in, show the loading message when querying for synced 240 // User signed in, show the loading message when querying for synced
246 // devices. 241 // devices.
247 this.fetchingSyncedTabs_ = true; 242 this.fetchingSyncedTabs_ = true;
248 }, 243 },
249 244
250 searchTermChanged: function(searchTerm) { 245 searchTermChanged: function(searchTerm) {
251 this.clearDisplayedSyncedDevices_(); 246 this.clearDisplayedSyncedDevices_();
252 this.updateSyncedDevices(this.sessionList); 247 this.updateSyncedDevices(this.sessionList);
253 } 248 }
254 }); 249 });
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698