1 // Copyright 2016 The Chromium Authors
2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file.
5 #ifndef COMPONENTS_METRICS_METRICS_REPORTING_DEFAULT_STATE_H_
6 #define COMPONENTS_METRICS_METRICS_REPORTING_DEFAULT_STATE_H_
8 class PrefRegistrySimple;
13 // Metrics reporting default state. This relates to the state of the enable
14 // checkbox shown on first-run. This enum is used to store values in a pref, and
15 // shouldn't be renumbered.
16 enum EnableMetricsDefault {
17 // We only record the value during first-run. The default of existing
18 // installs is considered unknown.
20 // The first-run checkbox was unchecked by default.
22 // The first-run checkbox was checked by default.
26 // Register prefs relating to metrics reporting state. Currently only registers
27 // a pref for metrics reporting default opt-in state.
28 void RegisterMetricsReportingStatePrefs(PrefRegistrySimple* registry);
30 // Sets whether metrics reporting was opt-in or not. If it was opt-in, then the
31 // enable checkbox on first-run was default unchecked. If it was opt-out, then
32 // the checkbox was default checked. This should only be set once, and only
34 void RecordMetricsReportingDefaultState(PrefService* local_state,
35 EnableMetricsDefault default_state);
37 // Same as above, but does not verify the current state is UNKNOWN.
38 void ForceRecordMetricsReportingDefaultState(
39 PrefService* local_state,
40 EnableMetricsDefault default_state);
42 // Gets information about the default value for the enable metrics reporting
43 // checkbox shown during first-run.
44 EnableMetricsDefault GetMetricsReportingDefaultState(PrefService* local_state);
46 } // namespace metrics
48 #endif // COMPONENTS_METRICS_METRICS_REPORTING_DEFAULT_STATE_H_