Commit b3801704 authored by skym's avatar skym Committed by Commit bot

[Sync] Updating HistoryPage.OtherDevicesMenu metric to capture presence of foreign data.

BUG=568353

Review URL: https://codereview.chromium.org/1542593003

Cr-Commit-Position: refs/heads/master@{#367030}
parent 1c0fd1fa
......@@ -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);
}
};
......
......@@ -72159,6 +72159,7 @@ To add a new entry, add it with any value and run test to compute valid value.
<int value="6" label="Collapse Session"/>
<int value="7" label="Expand Session"/>
<int value="8" label="Open All"/>
<int value="9" label="Has foreign data"/>
</enum>
<enum name="OverscrollMode" type="int">
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment