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

Unified 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: rebase, vulcanize 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 side-by-side diff with in-line comments
Download patch
Index: chrome/browser/resources/md_history/synced_device_manager.js
diff --git a/chrome/browser/resources/md_history/synced_device_manager.js b/chrome/browser/resources/md_history/synced_device_manager.js
index 12e67fddbe540238b32f22538bf1542ee2947b2d..2e3759bf780d3ca6b6820f0d2d55ce0ec5977db3 100644
--- a/chrome/browser/resources/md_history/synced_device_manager.js
+++ b/chrome/browser/resources/md_history/synced_device_manager.js
@@ -39,9 +39,11 @@ Polymer({
},
/** @private */
- signInState_: {
+ signInState: {
type: Boolean,
+ // Updated on attach by chrome.sending 'otherDevicesInitialized'.
value: loadTimeData.getBoolean('isUserSignedIn'),
+ observer: 'signInStateChanged_',
},
/** @private */
@@ -227,18 +229,13 @@ Polymer({
* Get called when user's sign in state changes, this will affect UI of synced
* tabs page. Sign in promo gets displayed when user is signed out, and
* different messages are shown when there are no synced tabs.
- * @param {boolean} isUserSignedIn
+ * @param {boolean} signInState
*/
- updateSignInState: function(isUserSignedIn) {
- // If user's sign in state didn't change, then don't change message or
- // update UI.
- if (this.signInState_ == isUserSignedIn)
- return;
-
- this.signInState_ = isUserSignedIn;
+ signInStateChanged_: function(signInState) {
tsergeant 2016/08/17 06:03:09 Convention is for observer functions to leave out
calamity 2016/08/18 03:11:15 Done.
+ this.fire('history-view-changed');
// User signed out, clear synced device list and show the sign in promo.
- if (!isUserSignedIn) {
+ if (!signInState) {
this.clearDisplayedSyncedDevices_();
return;
}

Powered by Google App Engine
This is Rietveld 408576698