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

Unified Diff: chrome/browser/resources/md_history/synced_device_card.js

Issue 2255033002: [MD History] Copy stats from the old history page. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@sidebar_stats
Patch Set: rebase 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_card.js
diff --git a/chrome/browser/resources/md_history/synced_device_card.js b/chrome/browser/resources/md_history/synced_device_card.js
index 8090df8ae3b0a0587737661eda5022417c8b734b..20a9151524b6ea025ddd058994fc8847976967f6 100644
--- a/chrome/browser/resources/md_history/synced_device_card.js
+++ b/chrome/browser/resources/md_history/synced_device_card.js
@@ -47,7 +47,11 @@ Polymer({
*/
openTab_: function(e) {
var tab = /** @type {ForeignSessionTab} */(e.model.tab);
- md_history.BrowserService.getInstance().openForeignSessionTab(
+ var browserService = md_history.BrowserService.getInstance();
+ browserService.recordHistogram(
+ SYNCED_TABS_HISTOGRAM_NAME, SyncedTabsHistogram.LINK_CLICKED,
+ SyncedTabsHistogram.LIMIT);
+ browserService.openForeignSessionTab(
this.sessionTag, tab.windowId, tab.sessionId, e);
e.preventDefault();
},
@@ -56,6 +60,14 @@ Polymer({
* Toggles the dropdown display of synced tabs for each device card.
*/
toggleTabCard: function() {
+ var histogramValue = this.$.collapse.opened ?
+ SyncedTabsHistogram.COLLAPSE_SESSION :
+ SyncedTabsHistogram.EXPAND_SESSION;
+
+ md_history.BrowserService.getInstance().recordHistogram(
+ SYNCED_TABS_HISTOGRAM_NAME, histogramValue,
+ SyncedTabsHistogram.LIMIT);
+
this.$.collapse.toggle();
this.$['dropdown-indicator'].icon =
this.$.collapse.opened ? 'cr:expand-less' : 'cr:expand-more';

Powered by Google App Engine
This is Rietveld 408576698