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 // Safe Browsing preferences and some basic utility functions for using them. | 5 // Safe Browsing preferences and some basic utility functions for using them. |
6 | 6 |
7 #ifndef COMPONENTS_SAFE_BROWSING_DB_SAFE_BROWSING_PREFS_H_ | 7 #ifndef COMPONENTS_SAFE_BROWSING_DB_SAFE_BROWSING_PREFS_H_ |
8 #define COMPONENTS_SAFE_BROWSING_DB_SAFE_BROWSING_PREFS_H_ | 8 #define COMPONENTS_SAFE_BROWSING_DB_SAFE_BROWSING_PREFS_H_ |
9 | 9 |
10 class PrefService; | 10 class PrefService; |
11 | 11 |
12 namespace prefs { | 12 namespace prefs { |
13 extern const char kSafeBrowsingExtendedReportingEnabled[]; | 13 extern const char kSafeBrowsingExtendedReportingEnabled[]; |
14 } | 14 } |
15 | 15 |
16 namespace safe_browsing { | 16 namespace safe_browsing { |
17 | 17 |
| 18 // Returns whether the currently active Safe Browsing Extended Reporting |
| 19 // preference exists (eg: has been set before). |
| 20 bool ExtendedReportingPrefExists(const PrefService& prefs); |
| 21 |
18 // Returns the name of the Safe Browsing Extended Reporting pref that is | 22 // Returns the name of the Safe Browsing Extended Reporting pref that is |
19 // currently in effect. The specific pref in-use may change through experiments. | 23 // currently in effect. The specific pref in-use may change through experiments. |
20 const char* GetExtendedReportingPrefName(); | 24 const char* GetExtendedReportingPrefName(); |
21 | 25 |
22 // Returns whether Safe Browsing Extended Reporting is currently enabled. | 26 // Returns whether Safe Browsing Extended Reporting is currently enabled. |
23 // This should be used to decide if any of the reporting preferences are set, | 27 // This should be used to decide if any of the reporting preferences are set, |
24 // regardless of which specific one is set. | 28 // regardless of which specific one is set. |
25 bool IsExtendedReportingEnabled(const PrefService& prefs); | 29 bool IsExtendedReportingEnabled(const PrefService& prefs); |
26 | 30 |
27 // Updates UMA metrics about Safe Browsing Extended Reporting states. | 31 // Updates UMA metrics about Safe Browsing Extended Reporting states. |
28 void RecordExtendedReportingMetrics(const PrefService& prefs); | 32 void RecordExtendedReportingMetrics(const PrefService& prefs); |
29 | 33 |
| 34 // Sets the currently active Safe Browsing Extended Reporting preference to the |
| 35 // specified value. |
| 36 void SetExtendedReportingPref(PrefService* prefs, bool value); |
| 37 |
30 } // namespace safe_browsing | 38 } // namespace safe_browsing |
31 | 39 |
32 #endif // COMPONENTS_SAFE_BROWSING_DB_SAFE_BROWSING_PREFS_H_ | 40 #endif // COMPONENTS_SAFE_BROWSING_DB_SAFE_BROWSING_PREFS_H_ |
OLD | NEW |