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 #include "components/security_interstitials/core/metrics_helper.h" | 5 #include "components/security_interstitials/core/metrics_helper.h" |
6 | 6 |
7 #include <utility> | 7 #include <utility> |
8 | 8 |
9 #include "base/metrics/histogram.h" | 9 #include "base/metrics/histogram.h" |
10 #include "base/metrics/user_metrics.h" | 10 #include "base/metrics/user_metrics.h" |
(...skipping 90 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
101 if (metric_name == "bad_clock") | 101 if (metric_name == "bad_clock") |
102 RecordAction(UserMetricsAction("BadClockInterstitial.Settings")); | 102 RecordAction(UserMetricsAction("BadClockInterstitial.Settings")); |
103 } | 103 } |
104 } | 104 } |
105 | 105 |
106 } // namespace | 106 } // namespace |
107 | 107 |
108 MetricsHelper::ReportDetails::ReportDetails() | 108 MetricsHelper::ReportDetails::ReportDetails() |
109 : rappor_report_type(rappor::NUM_RAPPOR_TYPES) {} | 109 : rappor_report_type(rappor::NUM_RAPPOR_TYPES) {} |
110 | 110 |
| 111 MetricsHelper::ReportDetails::ReportDetails(const ReportDetails& other) = |
| 112 default; |
| 113 |
111 MetricsHelper::MetricsHelper(const GURL& request_url, | 114 MetricsHelper::MetricsHelper(const GURL& request_url, |
112 const ReportDetails settings, | 115 const ReportDetails settings, |
113 history::HistoryService* history_service, | 116 history::HistoryService* history_service, |
114 rappor::RapporService* rappor_service) | 117 rappor::RapporService* rappor_service) |
115 : request_url_(request_url), | 118 : request_url_(request_url), |
116 settings_(settings), | 119 settings_(settings), |
117 rappor_service_(rappor_service), | 120 rappor_service_(rappor_service), |
118 num_visits_(-1) { | 121 num_visits_(-1) { |
119 DCHECK(!settings_.metric_prefix.empty()); | 122 DCHECK(!settings_.metric_prefix.empty()); |
120 if (settings_.rappor_report_type == rappor::NUM_RAPPOR_TYPES) // Default. | 123 if (settings_.rappor_report_type == rappor::NUM_RAPPOR_TYPES) // Default. |
(...skipping 85 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
206 } | 209 } |
207 | 210 |
208 void MetricsHelper::OnGotHistoryCount(bool success, | 211 void MetricsHelper::OnGotHistoryCount(bool success, |
209 int num_visits, | 212 int num_visits, |
210 base::Time /*first_visit*/) { | 213 base::Time /*first_visit*/) { |
211 if (success) | 214 if (success) |
212 num_visits_ = num_visits; | 215 num_visits_ = num_visits; |
213 } | 216 } |
214 | 217 |
215 } // namespace security_interstitials | 218 } // namespace security_interstitials |
OLD | NEW |