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

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: fix_test 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 * opened: boolean, 8 * opened: boolean,
9 * separatorIndexes: !Array<number>, 9 * separatorIndexes: !Array<number>,
10 * timestamp: number, 10 * timestamp: number,
(...skipping 22 matching lines...) Expand all
33 /** 33 /**
34 * An array of synced devices with synced tab data. 34 * An array of synced devices with synced tab data.
35 * @type {!Array<!ForeignDeviceInternal>} 35 * @type {!Array<!ForeignDeviceInternal>}
36 */ 36 */
37 syncedDevices_: { 37 syncedDevices_: {
38 type: Array, 38 type: Array,
39 value: function() { return []; } 39 value: function() { return []; }
40 }, 40 },
41 41
42 /** @private */ 42 /** @private */
43 signInState_: { 43 signInState: {
44 type: Boolean, 44 type: Boolean,
45 value: loadTimeData.getBoolean('isUserSignedIn'), 45 observer: 'signInStateChanged_',
46 }, 46 },
47 47
48 /** @private */ 48 /** @private */
49 guestSession_: { 49 guestSession_: {
50 type: Boolean, 50 type: Boolean,
51 value: loadTimeData.getBoolean('isGuestSession'), 51 value: loadTimeData.getBoolean('isGuestSession'),
52 }, 52 },
53 53
54 /** @private */ 54 /** @private */
55 fetchingSyncedTabs_: { 55 fetchingSyncedTabs_: {
(...skipping 180 matching lines...) Expand 10 before | Expand all | Expand 10 after
236 */ 236 */
237 tabSyncDisabled: function() { 237 tabSyncDisabled: function() {
238 this.fetchingSyncedTabs_ = false; 238 this.fetchingSyncedTabs_ = false;
239 this.clearDisplayedSyncedDevices_(); 239 this.clearDisplayedSyncedDevices_();
240 }, 240 },
241 241
242 /** 242 /**
243 * Get called when user's sign in state changes, this will affect UI of synced 243 * Get called when user's sign in state changes, this will affect UI of synced
244 * tabs page. Sign in promo gets displayed when user is signed out, and 244 * tabs page. Sign in promo gets displayed when user is signed out, and
245 * different messages are shown when there are no synced tabs. 245 * different messages are shown when there are no synced tabs.
246 * @param {boolean} isUserSignedIn
247 */ 246 */
248 updateSignInState: function(isUserSignedIn) { 247 signInStateChanged_: function() {
249 // If user's sign in state didn't change, then don't change message or 248 this.fire('history-view-changed');
250 // update UI.
251 if (this.signInState_ == isUserSignedIn)
252 return;
253
254 this.signInState_ = isUserSignedIn;
255 249
256 // User signed out, clear synced device list and show the sign in promo. 250 // User signed out, clear synced device list and show the sign in promo.
257 if (!isUserSignedIn) { 251 if (!this.signInState) {
258 this.clearDisplayedSyncedDevices_(); 252 this.clearDisplayedSyncedDevices_();
259 return; 253 return;
260 } 254 }
261 // User signed in, show the loading message when querying for synced 255 // User signed in, show the loading message when querying for synced
262 // devices. 256 // devices.
263 this.fetchingSyncedTabs_ = true; 257 this.fetchingSyncedTabs_ = true;
264 }, 258 },
265 259
266 searchTermChanged: function(searchTerm) { 260 searchTermChanged: function(searchTerm) {
267 this.clearDisplayedSyncedDevices_(); 261 this.clearDisplayedSyncedDevices_();
268 this.updateSyncedDevices(this.sessionList); 262 this.updateSyncedDevices(this.sessionList);
269 } 263 }
270 }); 264 });
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698