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

Unified Diff: components/ntp_tiles/most_visited_sites.cc

Issue 2126263002: Add NewTabPage.MostVisited and .SuggestionsImpression on Android (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@remove_provider_id
Patch Set: rebase Created 4 years, 5 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
« no previous file with comments | « components/ntp_tiles/most_visited_sites.h ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: components/ntp_tiles/most_visited_sites.cc
diff --git a/components/ntp_tiles/most_visited_sites.cc b/components/ntp_tiles/most_visited_sites.cc
index b03fdaa5b315baa8a10b1be485370d95b90952d4..8b758c24b823a0959180f77e967a8931cf5566cc 100644
--- a/components/ntp_tiles/most_visited_sites.cc
+++ b/components/ntp_tiles/most_visited_sites.cc
@@ -253,6 +253,9 @@ void MostVisitedSites::RecordOpenedMostVisitedItem(int index, int tile_type) {
// function to work with asynchronous UI.
DCHECK_GE(index, 0);
DCHECK_LT(index, static_cast<int>(current_suggestions_.size()));
+
+ UMA_HISTOGRAM_ENUMERATION("NewTabPage.MostVisited", index, num_sites_);
+
std::string histogram = base::StringPrintf(
"NewTabPage.MostVisited.%s",
GetSourceHistogramName(current_suggestions_[index].source).c_str());
@@ -502,8 +505,6 @@ void MostVisitedSites::NotifyMostVisitedURLsObserver() {
if (received_most_visited_sites_ && received_popular_sites_ &&
!recorded_uma_) {
RecordImpressionUMAMetrics();
- UMA_HISTOGRAM_SPARSE_SLOWLY("NewTabPage.NumberOfTiles",
- current_suggestions_.size());
recorded_uma_ = true;
}
@@ -530,7 +531,13 @@ void MostVisitedSites::OnPopularSitesAvailable(bool success) {
}
void MostVisitedSites::RecordImpressionUMAMetrics() {
+ UMA_HISTOGRAM_SPARSE_SLOWLY("NewTabPage.NumberOfTiles",
+ current_suggestions_.size());
+
for (size_t i = 0; i < current_suggestions_.size(); i++) {
+ UMA_HISTOGRAM_ENUMERATION(
+ "NewTabPage.SuggestionsImpression", static_cast<int>(i), num_sites_);
+
std::string histogram = base::StringPrintf(
"NewTabPage.SuggestionsImpression.%s",
GetSourceHistogramName(current_suggestions_[i].source).c_str());
« no previous file with comments | « components/ntp_tiles/most_visited_sites.h ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698