OLD | NEW |
1 // Copyright 2015 The Chromium Authors. All rights reserved. | 1 // Copyright 2015 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 CHROME_BROWSER_ENGAGEMENT_SITE_ENGAGEMENT_METRICS_H_ | 5 #ifndef CHROME_BROWSER_ENGAGEMENT_SITE_ENGAGEMENT_METRICS_H_ |
6 #define CHROME_BROWSER_ENGAGEMENT_SITE_ENGAGEMENT_METRICS_H_ | 6 #define CHROME_BROWSER_ENGAGEMENT_SITE_ENGAGEMENT_METRICS_H_ |
7 | 7 |
8 #include <map> | 8 #include <map> |
9 #include <vector> | 9 #include <vector> |
10 | 10 |
11 #include "base/gtest_prod_util.h" | 11 #include "base/gtest_prod_util.h" |
12 #include "url/gurl.h" | 12 #include "url/gurl.h" |
13 | 13 |
14 // Helper class managing the UMA histograms for the Site Engagement Service. | 14 // Helper class managing the UMA histograms for the Site Engagement Service. |
15 class SiteEngagementMetrics { | 15 class SiteEngagementMetrics { |
16 public: | 16 public: |
17 // This is used to back a UMA histogram, so it should be treated as | 17 // This is used to back a UMA histogram, so it should be treated as |
18 // append-only. Any new values should be inserted immediately prior to | 18 // append-only. Any new values should be inserted immediately prior to |
19 // ENGAGEMENT_LAST. | 19 // ENGAGEMENT_LAST. |
20 enum EngagementType { | 20 enum EngagementType { |
21 ENGAGEMENT_NAVIGATION, | 21 ENGAGEMENT_NAVIGATION, |
22 ENGAGEMENT_KEYPRESS, | 22 ENGAGEMENT_KEYPRESS, |
23 ENGAGEMENT_MOUSE, | 23 ENGAGEMENT_MOUSE, |
24 ENGAGEMENT_TOUCH_GESTURE, | 24 ENGAGEMENT_TOUCH_GESTURE, |
25 ENGAGEMENT_WHEEL, | 25 ENGAGEMENT_SCROLL, |
26 ENGAGEMENT_MEDIA_HIDDEN, | 26 ENGAGEMENT_MEDIA_HIDDEN, |
27 ENGAGEMENT_MEDIA_VISIBLE, | 27 ENGAGEMENT_MEDIA_VISIBLE, |
28 ENGAGEMENT_WEBAPP_SHORTCUT_LAUNCH, | 28 ENGAGEMENT_WEBAPP_SHORTCUT_LAUNCH, |
29 ENGAGEMENT_FIRST_DAILY_ENGAGEMENT, | 29 ENGAGEMENT_FIRST_DAILY_ENGAGEMENT, |
30 ENGAGEMENT_LAST, | 30 ENGAGEMENT_LAST, |
31 }; | 31 }; |
32 | 32 |
33 static void RecordTotalSiteEngagement(double total_engagement); | 33 static void RecordTotalSiteEngagement(double total_engagement); |
34 static void RecordTotalOriginsEngaged(int total_origins); | 34 static void RecordTotalOriginsEngaged(int total_origins); |
35 static void RecordMeanEngagement(double mean_engagement); | 35 static void RecordMeanEngagement(double mean_engagement); |
(...skipping 26 matching lines...) Expand all Loading... |
62 static const char kEngagementTypeHistogram[]; | 62 static const char kEngagementTypeHistogram[]; |
63 static const char kEngagementBucketHistogramBase[]; | 63 static const char kEngagementBucketHistogramBase[]; |
64 static const char kDaysSinceLastShortcutLaunchHistogram[]; | 64 static const char kDaysSinceLastShortcutLaunchHistogram[]; |
65 static const char kScoreDecayedFromHistogram[]; | 65 static const char kScoreDecayedFromHistogram[]; |
66 static const char kScoreDecayedToHistogram[]; | 66 static const char kScoreDecayedToHistogram[]; |
67 | 67 |
68 static std::vector<std::string> GetEngagementBucketHistogramNames(); | 68 static std::vector<std::string> GetEngagementBucketHistogramNames(); |
69 }; | 69 }; |
70 | 70 |
71 #endif // CHROME_BROWSER_ENGAGEMENT_SITE_ENGAGEMENT_METRICS_H_ | 71 #endif // CHROME_BROWSER_ENGAGEMENT_SITE_ENGAGEMENT_METRICS_H_ |
OLD | NEW |