Index: chrome/browser/engagement/site_engagement_metrics.h |
diff --git a/chrome/browser/engagement/site_engagement_metrics.h b/chrome/browser/engagement/site_engagement_metrics.h |
new file mode 100644 |
index 0000000000000000000000000000000000000000..defbd14f9108607a673ec4248f02bebf1d0fab4b |
--- /dev/null |
+++ b/chrome/browser/engagement/site_engagement_metrics.h |
@@ -0,0 +1,44 @@ |
+// Copyright 2015 The Chromium Authors. All rights reserved. |
+// Use of this source code is governed by a BSD-style license that can be |
+// found in the LICENSE file. |
+ |
+#ifndef CHROME_BROWSER_ENGAGEMENT_SITE_ENGAGEMENT_METRICS_H_ |
+#define CHROME_BROWSER_ENGAGEMENT_SITE_ENGAGEMENT_METRICS_H_ |
+ |
+#include <map> |
+ |
+#include "url/gurl.h" |
+ |
+// Helper class managing the UMA histograms for the Site Engagement Service. |
+class SiteEngagementMetrics { |
+ public: |
+ // This is used to back a UMA histogram, so it should be treated as |
+ // append-only. |
+ enum EngagementType { |
+ ENGAGEMENT_NAVIGATION, |
+ ENGAGEMENT_KEYPRESS, |
+ ENGAGEMENT_MOUSE, |
+ }; |
+ |
+ static void RecordTotalSiteEngagement(double total_engagement); |
+ |
+ static void RecordTotalOriginsEngaged(int total_origins); |
benwells
2015/09/30 00:10:54
Nit: I don' think you need a blank line between ev
dominickn
2015/10/01 01:12:02
Done.
|
+ |
+ static void RecordEngagementScore(std::map<GURL, double> score_map); |
benwells
2015/09/30 00:10:54
Nit: this should be RecordEngagementScores (i.e. w
dominickn
2015/10/01 01:12:02
Done.
|
+ |
+ static void RecordOriginsWithMaxEngagement(int total_origins); |
+ |
+ static void RecordOriginsWithMaxDailyEngagement(int total_origins); |
+ |
+ static void RecordEngagement(EngagementType type); |
+ |
+ static const char kTotalEngagementHistogram[]; |
benwells
2015/09/30 00:10:54
Nit: normally you'd put these first (and that woul
dominickn
2015/10/01 01:12:02
Done.
|
+ static const char kTotalOriginsHistogram[]; |
+ static const char kEngagementScoreHistogram[]; |
+ static const char kOriginsWithMaxEngagementHistogram[]; |
+ static const char kOriginsWithMaxDailyEngagementHistogram[]; |
+ static const char kEngagementTypeHistogram[]; |
+ |
benwells
2015/09/30 00:10:54
Nit: no blank line.
dominickn
2015/10/01 01:12:02
Done.
|
+}; |
+ |
+#endif // CHROME_BROWSER_ENGAGEMENT_SITE_ENGAGEMENT_METRICS_H_ |