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 the name of the Safe Browsing Extended Reporting pref that is | 18 // 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. | 19 // currently in effect. The specific pref in-use may change through experiments. |
20 const char* GetExtendedReportingPrefName(); | 20 const char* GetExtendedReportingPrefName(); |
21 | 21 |
22 // Returns whether Safe Browsing Extended Reporting is currently enabled. | 22 // Returns whether Safe Browsing Extended Reporting is currently enabled. |
23 // This should be used to decide if any of the reporting preferences are set, | 23 // This should be used to decide if any of the reporting preferences are set, |
24 // regardless of which specific one is set. | 24 // regardless of which specific one is set. |
25 bool IsExtendedReportingEnabled(const PrefService& prefs); | 25 bool IsExtendedReportingEnabled(const PrefService& prefs); |
26 | 26 |
27 // Updates UMA metrics about Safe Browsing Extended Reporting states. | 27 // Updates UMA metrics about Safe Browsing Extended Reporting states. |
28 void RecordExtendedReportingMetrics(const PrefService& prefs); | 28 void RecordExtendedReportingMetrics(const PrefService& prefs); |
29 | 29 |
30 // Sets the currently active Safe Browsing Extended Reporting preference to the | |
31 // specified value. | |
32 void SetExtendedReportingPref(PrefService* prefs, bool value); | |
vakh (use Gerrit instead)
2016/10/20 21:14:43
Nit (feel free to ignore): I would encourage you t
lpz
2016/10/21 16:18:27
Done.
| |
33 | |
34 // Returns whether the currently active Safe Browsing Extended Reporting | |
35 // preference exists (eg: has been set before). | |
36 bool ExtendedReportingPrefExists(const PrefService& prefs); | |
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 |