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

Unified Diff: components/ntp_tiles/metrics.h

Issue 2557513007: ntp_tiles::metrics: Add rappor metrics for impression URLs per icon type. (Closed)
Patch Set: Rebased. Created 4 years 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/DEPS ('k') | components/ntp_tiles/metrics.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: components/ntp_tiles/metrics.h
diff --git a/components/ntp_tiles/metrics.h b/components/ntp_tiles/metrics.h
index c32dbf258df3a21c54958841bd61274cf2120c98..009c4942b8be62d4b58e6d3aff742e6ad66a26f2 100644
--- a/components/ntp_tiles/metrics.h
+++ b/components/ntp_tiles/metrics.h
@@ -9,6 +9,11 @@
#include <vector>
#include "components/ntp_tiles/ntp_tile.h"
+#include "url/gurl.h"
+
+namespace rappor {
+class RapporService;
+} // namespace rappor
namespace ntp_tiles {
namespace metrics {
@@ -39,10 +44,22 @@ enum MostVisitedTileType {
UNKNOWN_TILE_TYPE,
};
+struct TileImpression {
+ TileImpression(NTPTileSource source,
+ MostVisitedTileType type,
+ const GURL& url)
+ : source(source), type(type), url(url) {}
+
+ NTPTileSource source;
+ MostVisitedTileType type;
+ GURL url;
+};
+
// Records an NTP impression, after all tiles have loaded.
-// Includes the visual types (see above) of all visible tiles.
-void RecordPageImpression(
- const std::vector<std::pair<NTPTileSource, MostVisitedTileType>>& tiles);
+// Includes the visual types (see above) of all visible tiles. If
+// |rappor_service| is null, no rappor metrics will be reported.
+void RecordPageImpression(const std::vector<TileImpression>& tiles,
+ rappor::RapporService* rappor_service);
// Records a click on a tile.
void RecordTileClick(int index,
« no previous file with comments | « components/ntp_tiles/DEPS ('k') | components/ntp_tiles/metrics.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698