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

Unified Diff: components/ntp_tiles/most_visited_sites.cc

Issue 2105933002: NTP: Fix metrics recording crash by plumbing the necessary data to Java. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Fix test. Created 4 years, 6 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: 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 ab85f7886b6b0e31dcae9f25db2d62dfdeeef6ec..af77c666ced971cabd18aa91ffb0c9146cba91ad 100644
--- a/components/ntp_tiles/most_visited_sites.cc
+++ b/components/ntp_tiles/most_visited_sites.cc
@@ -49,25 +49,6 @@ const char kPopularSitesFieldTrialName[] = "NTPPopularSites";
const base::Feature kDisplaySuggestionsServiceTiles{
"DisplaySuggestionsServiceTiles", base::FEATURE_ENABLED_BY_DEFAULT};
-// The visual type of a most visited tile.
-//
-// These values must stay in sync with the MostVisitedTileType enum
-// in histograms.xml.
-//
-// A Java counterpart will be generated for this enum.
-// GENERATED_JAVA_ENUM_PACKAGE: org.chromium.chrome.browser.ntp
-enum MostVisitedTileType {
- // The icon or thumbnail hasn't loaded yet.
- NONE,
- // The item displays a site's actual favicon or touch icon.
- ICON_REAL,
- // The item displays a color derived from the site's favicon or touch icon.
- ICON_COLOR,
- // The item displays a default gray box in place of an icon.
- ICON_DEFAULT,
- NUM_TILE_TYPES,
-};
-
// Log an event for a given |histogram| at a given element |position|. This
// routine exists because regular histogram macros are cached thus can't be used
// if the name of the histogram will change at a given call site.
@@ -261,27 +242,6 @@ void MostVisitedSites::AddOrRemoveBlacklistedUrl(const GURL& url,
}
}
-void MostVisitedSites::RecordTileTypeMetrics(
- const std::vector<int>& tile_types) {
- DCHECK_EQ(current_suggestions_.size(), tile_types.size());
- int counts_per_type[NUM_TILE_TYPES] = {0};
- for (size_t i = 0; i < tile_types.size(); ++i) {
- int tile_type = tile_types[i];
- ++counts_per_type[tile_type];
- std::string histogram = base::StringPrintf(
- "NewTabPage.TileType.%s",
- GetSourceHistogramName(current_suggestions_[i]).c_str());
- LogHistogramEvent(histogram, tile_type, NUM_TILE_TYPES);
- }
-
- UMA_HISTOGRAM_SPARSE_SLOWLY("NewTabPage.IconsReal",
- counts_per_type[ICON_REAL]);
- UMA_HISTOGRAM_SPARSE_SLOWLY("NewTabPage.IconsColor",
- counts_per_type[ICON_COLOR]);
- UMA_HISTOGRAM_SPARSE_SLOWLY("NewTabPage.IconsGray",
- counts_per_type[ICON_DEFAULT]);
-}
-
void MostVisitedSites::RecordOpenedMostVisitedItem(int index, int tile_type) {
DCHECK_GE(index, 0);
DCHECK_LT(index, static_cast<int>(current_suggestions_.size()));
« components/ntp_tiles/most_visited_sites.h ('K') | « 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