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 "base/metrics/histogram.h" | 7 #include "base/metrics/histogram.h" |
8 #include "components/history/core/browser/history_service.h" | 8 #include "components/history/core/browser/history_service.h" |
9 #include "components/rappor/rappor_service.h" | 9 #include "components/rappor/rappor_service.h" |
10 #include "components/rappor/rappor_utils.h" | 10 #include "components/rappor/rappor_utils.h" |
(...skipping 116 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
127 "interstitial." + settings_.metric_prefix + ".interaction"); | 127 "interstitial." + settings_.metric_prefix + ".interaction"); |
128 | 128 |
129 RecordSingleInteractionToMetrics(interaction, histogram_name); | 129 RecordSingleInteractionToMetrics(interaction, histogram_name); |
130 if (!settings_.extra_suffix.empty()) { | 130 if (!settings_.extra_suffix.empty()) { |
131 RecordSingleInteractionToMetrics( | 131 RecordSingleInteractionToMetrics( |
132 interaction, histogram_name + "." + settings_.extra_suffix); | 132 interaction, histogram_name + "." + settings_.extra_suffix); |
133 } | 133 } |
134 RecordExtraUserInteractionMetrics(interaction); | 134 RecordExtraUserInteractionMetrics(interaction); |
135 } | 135 } |
136 | 136 |
| 137 void MetricsHelper::RecordShutdownMetrics() { |
| 138 RecordExtraShutdownMetrics(); |
| 139 } |
| 140 |
137 int MetricsHelper::NumVisits() { | 141 int MetricsHelper::NumVisits() { |
138 return num_visits_; | 142 return num_visits_; |
139 } | 143 } |
140 | 144 |
141 void MetricsHelper::OnGotHistoryCount(bool success, | 145 void MetricsHelper::OnGotHistoryCount(bool success, |
142 int num_visits, | 146 int num_visits, |
143 base::Time /*first_visit*/) { | 147 base::Time /*first_visit*/) { |
144 if (success) | 148 if (success) |
145 num_visits_ = num_visits; | 149 num_visits_ = num_visits; |
146 } | 150 } |
147 | 151 |
148 } // namespace security_interstitials | 152 } // namespace security_interstitials |
OLD | NEW |