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

Side by Side 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 unified diff | Download patch
« no previous file with comments | « components/ntp_tiles/DEPS ('k') | components/ntp_tiles/metrics.cc » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 // Copyright 2016 The Chromium Authors. All rights reserved. 1 // Copyright 2016 The Chromium Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be 2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file. 3 // found in the LICENSE file.
4 4
5 #ifndef COMPONENTS_NTP_TILES_METRICS_H_ 5 #ifndef COMPONENTS_NTP_TILES_METRICS_H_
6 #define COMPONENTS_NTP_TILES_METRICS_H_ 6 #define COMPONENTS_NTP_TILES_METRICS_H_
7 7
8 #include <utility> 8 #include <utility>
9 #include <vector> 9 #include <vector>
10 10
11 #include "components/ntp_tiles/ntp_tile.h" 11 #include "components/ntp_tiles/ntp_tile.h"
12 #include "url/gurl.h"
13
14 namespace rappor {
15 class RapporService;
16 } // namespace rappor
12 17
13 namespace ntp_tiles { 18 namespace ntp_tiles {
14 namespace metrics { 19 namespace metrics {
15 20
16 // The visual type of a most visited tile. 21 // The visual type of a most visited tile.
17 // 22 //
18 // These values must stay in sync with the MostVisitedTileType enum 23 // These values must stay in sync with the MostVisitedTileType enum
19 // in histograms.xml. 24 // in histograms.xml.
20 // 25 //
21 // A Java counterpart will be generated for this enum. 26 // A Java counterpart will be generated for this enum.
(...skipping 10 matching lines...) Expand all
32 // The number of different tile types that get recorded. Entries below this 37 // The number of different tile types that get recorded. Entries below this
33 // are not recorded in UMA. 38 // are not recorded in UMA.
34 NUM_RECORDED_TILE_TYPES, 39 NUM_RECORDED_TILE_TYPES,
35 // The item displays a thumbnail of the page. Used on desktop. 40 // The item displays a thumbnail of the page. Used on desktop.
36 THUMBNAIL, 41 THUMBNAIL,
37 // The tile type has not been determined yet. Used on iOS, until we can detect 42 // The tile type has not been determined yet. Used on iOS, until we can detect
38 // when all tiles have loaded. 43 // when all tiles have loaded.
39 UNKNOWN_TILE_TYPE, 44 UNKNOWN_TILE_TYPE,
40 }; 45 };
41 46
47 struct TileImpression {
48 TileImpression(NTPTileSource source,
49 MostVisitedTileType type,
50 const GURL& url)
51 : source(source), type(type), url(url) {}
52
53 NTPTileSource source;
54 MostVisitedTileType type;
55 GURL url;
56 };
57
42 // Records an NTP impression, after all tiles have loaded. 58 // Records an NTP impression, after all tiles have loaded.
43 // Includes the visual types (see above) of all visible tiles. 59 // Includes the visual types (see above) of all visible tiles. If
44 void RecordPageImpression( 60 // |rappor_service| is null, no rappor metrics will be reported.
45 const std::vector<std::pair<NTPTileSource, MostVisitedTileType>>& tiles); 61 void RecordPageImpression(const std::vector<TileImpression>& tiles,
62 rappor::RapporService* rappor_service);
46 63
47 // Records a click on a tile. 64 // Records a click on a tile.
48 void RecordTileClick(int index, 65 void RecordTileClick(int index,
49 NTPTileSource source, 66 NTPTileSource source,
50 MostVisitedTileType tile_type); 67 MostVisitedTileType tile_type);
51 68
52 } // namespace metrics 69 } // namespace metrics
53 } // namespace ntp_tiles 70 } // namespace ntp_tiles
54 71
55 #endif 72 #endif
OLDNEW
« 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