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

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: add_stats 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 289809ef35c1cbded83b71fff76da6522accc9dc..7c370ad1afbc859fadf9fe72bc78b9b5034aafe1 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';
@@ -112,4 +124,10 @@ Polymer({
});
e.stopPropagation(); // Prevent iron-collapse.
},
+
+ onLinkRightClick_: function() {
+ md_history.BrowserService.getInstance().recordHistogram(
+ SYNCED_TABS_HISTOGRAM_NAME, SyncedTabsHistogram.LINK_RIGHT_CLICKED,
+ SyncedTabsHistogram.LIMIT);
+ },
});

Powered by Google App Engine
This is Rietveld 408576698