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

Unified Diff: chrome/browser/resources/history/other_devices.js

Issue 1542593003: [Sync] Updating HistoryPage.OtherDevicesMenu metric to capture presence of foreign data. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Updating comment. Created 5 years 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
« no previous file with comments | « no previous file | tools/metrics/histograms/histograms.xml » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: chrome/browser/resources/history/other_devices.js
diff --git a/chrome/browser/resources/history/other_devices.js b/chrome/browser/resources/history/other_devices.js
index 15d7d47a48cf67c26c193ccf5cbe4727610613a7..8f46192d61f9a8a62b9171c7ab579c3410fbc6a7 100644
--- a/chrome/browser/resources/history/other_devices.js
+++ b/chrome/browser/resources/history/other_devices.js
@@ -24,7 +24,8 @@
COLLAPSE_SESSION: 6,
EXPAND_SESSION: 7,
OPEN_ALL: 8,
- LIMIT: 9 // Should always be the last one.
+ HAS_FOREIGN_DATA: 9,
+ LIMIT: 10 // Should always be the last one.
};
/**
@@ -353,6 +354,7 @@ function DevicesView() {
this.rowHeights_ = [NB_ENTRIES_FIRST_ROW_COLUMN];
this.focusGrids_ = [];
this.updateSignInState(loadTimeData.getBoolean('isUserSignedIn'));
+ this.hasSeenForeignData_ = false;
recordUmaEvent_(HISTOGRAM_EVENT.INITIALIZED);
}
@@ -379,6 +381,14 @@ DevicesView.prototype.setSessionList = function(sessionList) {
for (var i = 0; i < sessionList.length; i++)
this.devices_.push(new Device(sessionList[i], this));
this.displayResults_();
+
+ // This metric should only be emitted if we see foreign data, and it should
+ // only be emitted once per page refresh. Flip flag to remember because this
+ // method is called upon any update.
+ if (!this.hasSeenForeignData_ && sessionList.length > 0) {
+ this.hasSeenForeignData_ = true;
+ recordUmaEvent_(HISTOGRAM_EVENT.HAS_FOREIGN_DATA);
+ }
};
« no previous file with comments | « no previous file | tools/metrics/histograms/histograms.xml » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698