Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(732)

Side by Side Diff: components/metrics/metrics_reporting_default_state.cc

Issue 2014463003: Modifications for recording whether UMA/Crash default state for iOS (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 4 years, 7 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
OLDNEW
(Empty)
1 // Copyright 2016 The Chromium Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file.
4
5 #include "components/metrics/metrics_reporting_default_state.h"
6
7 #include "components/metrics/metrics_pref_names.h"
8
9 namespace metrics {
10
11 void RegisterMetricsReportingStatePrefs(PrefRegistrySimple* registry) {
12 registry->RegisterIntegerPref(prefs::kMetricsDefaultOptIn,
13 MetricsServiceClient::DEFAULT_UNKNOWN);
14 }
15
16 void RecordMetricsReportingDefaultOptIn(PrefService* local_state, bool opt_in) {
17 DCHECK(GetMetricsReportingDefaultOptIn(local_state) ==
18 MetricsServiceClient::DEFAULT_UNKNOWN);
19 local_state->SetInteger(
20 prefs::kMetricsDefaultOptIn,
21 opt_in ? MetricsServiceClient::OPT_IN : MetricsServiceClient::OPT_OUT);
22 }
23
24 MetricsServiceClient::EnableMetricsDefault GetMetricsReportingDefaultOptIn(
25 PrefService* local_state) {
26 return static_cast<MetricsServiceClient::EnableMetricsDefault>(
27 local_state->GetInteger(prefs::kMetricsDefaultOptIn));
28 }
29
30 } // namespace metrics
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698