Index: chrome/browser/resources/md_history/history_item.js |
diff --git a/chrome/browser/resources/md_history/history_item.js b/chrome/browser/resources/md_history/history_item.js |
index b6b6603dfd28f920c4b07f74edfe8b5a1e6d983c..6a62ff7250b101e56868ab5d37f7b53d97a307cc 100644 |
--- a/chrome/browser/resources/md_history/history_item.js |
+++ b/chrome/browser/resources/md_history/history_item.js |
@@ -70,8 +70,10 @@ cr.define('md_history', function() { |
if (this.$$('#bookmark-star') == this.root.activeElement) |
this.$['menu-button'].focus(); |
- md_history.BrowserService.getInstance() |
- .removeBookmark(this.item.url); |
+ var browserService = md_history.BrowserService.getInstance(); |
+ browserService.removeBookmark(this.item.url); |
+ browserService.recordAction('BookmarkStarClicked'); |
+ |
this.fire('remove-bookmark-stars', this.item.url); |
}, |
@@ -91,6 +93,31 @@ cr.define('md_history', function() { |
}, |
/** |
+ * Record metrics when a result is clicked. This is deliberately tied to |
+ * on-click rather than on-tap, as on-click triggers from middle clicks. |
+ */ |
+ onLinkClick_: function() { |
+ var browserService = md_history.BrowserService.getInstance(); |
+ browserService.recordAction('EntryLinkClick'); |
+ browserService.recordHistogram( |
+ 'HistoryPage.ClickPosition', this.item.index, UMA_MAX_BUCKET_VALUE); |
+ |
+ if (this.item.index <= UMA_MAX_SUBSET_BUCKET_VALUE) { |
+ browserService.recordHistogram( |
+ 'HistoryPage.ClickPositionSubset', this.item.index, |
+ UMA_MAX_SUBSET_BUCKET_VALUE); |
+ } |
+ |
+ if (this.searchTerm) |
+ browserService.recordAction('SearchResultClick'); |
+ }, |
+ |
+ onLinkRightClick_: function() { |
+ md_history.BrowserService.getInstance().recordAction( |
+ 'EntryLinkRightClick'); |
+ }, |
+ |
+ /** |
* Set the favicon image, based on the URL of the history item. |
* @private |
*/ |