OLD | NEW |
1 // Copyright 2014 The Chromium Authors. All rights reserved. | 1 // Copyright 2014 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/user_prefs/tracked/tracked_preference_helper.h" | 5 #include "components/user_prefs/tracked/tracked_preference_helper.h" |
6 | 6 |
7 #include "base/logging.h" | 7 #include "base/logging.h" |
8 #include "base/metrics/histogram.h" | 8 #include "base/metrics/histogram.h" |
| 9 #include "base/metrics/histogram_macros.h" |
9 #include "components/user_prefs/tracked/tracked_preference_histogram_names.h" | 10 #include "components/user_prefs/tracked/tracked_preference_histogram_names.h" |
10 | 11 |
11 TrackedPreferenceHelper::TrackedPreferenceHelper( | 12 TrackedPreferenceHelper::TrackedPreferenceHelper( |
12 const std::string& pref_path, | 13 const std::string& pref_path, |
13 size_t reporting_id, | 14 size_t reporting_id, |
14 size_t reporting_ids_count, | 15 size_t reporting_ids_count, |
15 PrefHashFilter::EnforcementLevel enforcement_level, | 16 PrefHashFilter::EnforcementLevel enforcement_level, |
16 PrefHashFilter::ValueType value_type) | 17 PrefHashFilter::ValueType value_type) |
17 : pref_path_(pref_path), | 18 : pref_path_(pref_path), |
18 reporting_id_(reporting_id), | 19 reporting_id_(reporting_id), |
(...skipping 95 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
114 size_t count) const { | 115 size_t count) const { |
115 // The histogram below is an expansion of the UMA_HISTOGRAM_COUNTS_100 macro | 116 // The histogram below is an expansion of the UMA_HISTOGRAM_COUNTS_100 macro |
116 // adapted to allow for a dynamically suffixed histogram name. | 117 // adapted to allow for a dynamically suffixed histogram name. |
117 // Note: The factory creates and owns the histogram. | 118 // Note: The factory creates and owns the histogram. |
118 base::HistogramBase* histogram = base::LinearHistogram::FactoryGet( | 119 base::HistogramBase* histogram = base::LinearHistogram::FactoryGet( |
119 user_prefs::tracked::kTrackedSplitPrefHistogramChanged + pref_path_, 1, | 120 user_prefs::tracked::kTrackedSplitPrefHistogramChanged + pref_path_, 1, |
120 100, // Allow counts up to 100. | 121 100, // Allow counts up to 100. |
121 101, base::HistogramBase::kUmaTargetedHistogramFlag); | 122 101, base::HistogramBase::kUmaTargetedHistogramFlag); |
122 histogram->Add(count); | 123 histogram->Add(count); |
123 } | 124 } |
OLD | NEW |