[Presentation API, Android] Implement basic messaging
[chromium-blink-merge.git] / chrome / browser / interstitials / chrome_metrics_helper.h
blobe56e59afb8f4d641ce58228cd13653cf78d3abe3
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
3 // found in the LICENSE file.
5 #ifndef CHROME_BROWSER_INTERSTITIALS_CHROME_METRICS_HELPER_H_
6 #define CHROME_BROWSER_INTERSTITIALS_CHROME_METRICS_HELPER_H_
8 #include <string>
10 #include "components/security_interstitials/core/metrics_helper.h"
11 #include "url/gurl.h"
13 namespace content {
14 class WebContents;
17 namespace extensions {
18 class ExperienceSamplingEvent;
21 // This class adds desktop-Chrome-specific metrics (extension experience
22 // sampling) to the security_interstitials::MetricsHelper. Together, they
23 // record UMA, Rappor, and experience sampling metrics.
24 class ChromeMetricsHelper : public security_interstitials::MetricsHelper {
25 public:
26 ChromeMetricsHelper(
27 content::WebContents* web_contents,
28 const GURL& url,
29 const security_interstitials::MetricsHelper::ReportDetails settings,
30 const std::string& sampling_event_name);
31 ~ChromeMetricsHelper() override;
33 protected:
34 // security_interstitials::MetricsHelper methods:
35 void RecordExtraUserDecisionMetrics(
36 security_interstitials::MetricsHelper::Decision decision) override;
37 void RecordExtraUserInteractionMetrics(
38 security_interstitials::MetricsHelper::Interaction interaction) override;
40 private:
41 content::WebContents* web_contents_;
42 const GURL request_url_;
43 const std::string sampling_event_name_;
44 #if defined(ENABLE_EXTENSIONS)
45 scoped_ptr<extensions::ExperienceSamplingEvent> sampling_event_;
46 #endif
48 DISALLOW_COPY_AND_ASSIGN(ChromeMetricsHelper);
51 #endif // CHROME_BROWSER_INTERSTITIALS_CHROME_METRICS_HELPER_H_