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

Unified Diff: chrome/browser/resources/ntp_android/ntp_android.js

Issue 70083009: Record NewTabPage.MostVisited histogram on Android. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Created 7 years, 1 month 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
« no previous file with comments | « no previous file | chrome/browser/ui/webui/ntp/new_tab_ui.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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:
« no previous file with comments | « no previous file | chrome/browser/ui/webui/ntp/new_tab_ui.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698