OLD | NEW |
1 // Copyright (c) 2016 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2016 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 "base/metrics/histogram_macros.h" | 5 #include "base/metrics/histogram_macros.h" |
6 #include "components/prefs/pref_service.h" | 6 #include "components/prefs/pref_service.h" |
7 #include "components/safe_browsing_db/safe_browsing_prefs.h" | 7 #include "components/safe_browsing_db/safe_browsing_prefs.h" |
8 | 8 |
9 namespace prefs { | 9 namespace prefs { |
10 | 10 |
(...skipping 11 matching lines...) Expand all Loading... |
22 | 22 |
23 bool IsExtendedReportingEnabled(const PrefService& prefs) { | 23 bool IsExtendedReportingEnabled(const PrefService& prefs) { |
24 return prefs.GetBoolean(GetExtendedReportingPrefName()); | 24 return prefs.GetBoolean(GetExtendedReportingPrefName()); |
25 } | 25 } |
26 | 26 |
27 void RecordExtendedReportingMetrics(const PrefService& prefs) { | 27 void RecordExtendedReportingMetrics(const PrefService& prefs) { |
28 UMA_HISTOGRAM_BOOLEAN("SafeBrowsing.Pref.Extended", | 28 UMA_HISTOGRAM_BOOLEAN("SafeBrowsing.Pref.Extended", |
29 IsExtendedReportingEnabled(prefs)); | 29 IsExtendedReportingEnabled(prefs)); |
30 } | 30 } |
31 | 31 |
| 32 void SetExtendedReportingPref(PrefService* prefs, bool value) { |
| 33 prefs->SetBoolean(GetExtendedReportingPrefName(), value); |
| 34 } |
| 35 |
| 36 bool ExtendedReportingPrefExists(const PrefService& prefs) { |
| 37 return prefs.HasPrefPath(GetExtendedReportingPrefName()); |
| 38 } |
| 39 |
32 } // namespace safe_browsing | 40 } // namespace safe_browsing |
OLD | NEW |