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

Unified Diff: components/ntp_tiles/most_visited_sites.h

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: Even more fixes. 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.h
diff --git a/components/ntp_tiles/most_visited_sites.h b/components/ntp_tiles/most_visited_sites.h
index 429be26fb2d7f4d4e2cad66077777a02a9551906..849c6b67ddd6184e1d40bd32fe60fa343bd405ea 100644
--- a/components/ntp_tiles/most_visited_sites.h
+++ b/components/ntp_tiles/most_visited_sites.h
@@ -95,8 +95,38 @@ class MostVisitedSites : public history::TopSitesObserver,
using SuggestionsVector = std::vector<Suggestion>;
using PopularSitesVector = std::vector<PopularSites::Site>;
+ // 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,
+ };
+
// The source of the Most Visited sites.
- enum MostVisitedSource { TOP_SITES, SUGGESTIONS_SERVICE, POPULAR, WHITELIST };
+ // A Java counterpart will be generated for this enum.
+ // GENERATED_JAVA_ENUM_PACKAGE: org.chromium.chrome.browser.ntp
+ enum MostVisitedSource {
+ // Item comes from the personal top sites list.
+ TOP_SITES,
+ // Item comes from the suggestions service.
+ SUGGESTIONS_SERVICE,
+ // Item is regionally popular.
+ POPULAR,
+ // Item is on an administrator-managed whitelist.
Marc Treib 2016/07/01 10:01:04 s/administrator/custodian (that's the terminology
dewittj 2016/07/01 21:35:21 Done.
+ WHITELIST
+ };
// The observer to be notified when the list of most visited sites changes.
class Observer {
@@ -149,7 +179,9 @@ class MostVisitedSites : public history::TopSitesObserver,
using ThumbnailCallback = base::Callback<
void(bool /* is_local_thumbnail */, const SkBitmap* /* bitmap */)>;
void AddOrRemoveBlacklistedUrl(const GURL& url, bool add_url);
- void RecordTileTypeMetrics(const std::vector<int>& tile_types);
+ void RecordTileTypeMetrics(const std::vector<int>& tile_types,
+ const std::vector<int>& sources,
+ const std::vector<int>& provider_indices);
void RecordOpenedMostVisitedItem(int index, int tile_type);
// MostVisitedSitesSupervisor::Observer implementation.

Powered by Google App Engine
This is Rietveld 408576698