Chromium Code Reviews| Index: chrome/browser/resources/ntp_android/ntp_android.js |
| diff --git a/chrome/browser/resources/ntp_android/ntp_android.js b/chrome/browser/resources/ntp_android/ntp_android.js |
| index ad62da041f40a9ee09e7da6ae4773ab1205ab1a2..e1cf31ac35b7540d9d1236ce012f3c5b7a545bbe 100644 |
| --- a/chrome/browser/resources/ntp_android/ntp_android.js |
| +++ b/chrome/browser/resources/ntp_android/ntp_android.js |
| @@ -943,11 +943,17 @@ cr.define('ntp', function() { |
| data.splice(8, data.length - 8); |
| } |
| + data.forEach(function(item, index) { |
| + item.mostVisitedIndex = index; |
| + }); |
|
Dan Beam
2013/11/14 04:44:38
nit: I'd strip off this duplicate/volatile data an
newt (away)
2013/11/14 18:44:02
If it's OK with you, I think I'll leave this as is
Dan Beam
2013/11/14 19:16:03
that's fine.
|
| + |
| if (equals(data, mostVisitedData_)) |
| return; |
| var clickFunction = function(item) { |
| chrome.send('openedMostVisited'); |
| + chrome.send('metricsHandler:recordInHistogram', |
| + ['NewTabPage.MostVisited', item.mostVisitedIndex, 8]); |
| window.location = item.url; |
| }; |
| populateData(findList('most_visited'), SectionType.MOST_VISITED, data, |
| @@ -1204,6 +1210,12 @@ cr.define('ntp', function() { |
| case ContextMenuItemIds.MOST_VISITED_OPEN_IN_NEW_TAB: |
| case ContextMenuItemIds.MOST_VISITED_OPEN_IN_INCOGNITO_TAB: |
| chrome.send('openedMostVisited'); |
| + if (contextMenuItem != null) { |
|
Dan Beam
2013/11/14 04:44:38
nit: if (contextMenuItem) {
newt (away)
2013/11/14 18:44:02
Done.
|
| + chrome.send('metricsHandler:recordInHistogram', |
| + ['NewTabPage.MostVisited', |
| + contextMenuItem.mostVisitedIndex, |
| + 8]); |
| + } |
| break; |
| case ContextMenuItemIds.RECENTLY_CLOSED_OPEN_IN_NEW_TAB: |