 Chromium Code Reviews
 Chromium Code Reviews Issue 2557513007:
  ntp_tiles::metrics: Add rappor metrics for impression URLs per icon type.  (Closed)
    
  
    Issue 2557513007:
  ntp_tiles::metrics: Add rappor metrics for impression URLs per icon type.  (Closed) 
  | Index: components/ntp_tiles/metrics.h | 
| diff --git a/components/ntp_tiles/metrics.h b/components/ntp_tiles/metrics.h | 
| index c32dbf258df3a21c54958841bd61274cf2120c98..1b1a00ffd899154fcd06c5f42f04a97faa35b614 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,17 @@ enum MostVisitedTileType { | 
| UNKNOWN_TILE_TYPE, | 
| }; | 
| +struct TileImpression { | 
| + NTPTileSource source; | 
| + MostVisitedTileType type; | 
| + GURL url; | 
| 
Marc Treib
2016/12/08 12:58:22
Add a constructor? As it is, it's easy to accident
 
mastiz
2016/12/08 13:47:07
Done.
 | 
| +}; | 
| + | 
| // 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, |