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

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, 6 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 #include "components/prefs/pref_registry_simple.h"
9 #include "components/prefs/pref_service.h"
10
11 namespace metrics {
12
13 void RegisterMetricsReportingStatePrefs(PrefRegistrySimple* registry) {
14 registry->RegisterIntegerPref(prefs::kMetricsDefaultOptIn,
15 MetricsServiceClient::DEFAULT_UNKNOWN);
16 }
17
18 void RecordMetricsReportingDefaultOptIn(PrefService* local_state, bool opt_in) {
19 DCHECK(GetMetricsReportingDefaultOptIn(local_state) ==
20 MetricsServiceClient::DEFAULT_UNKNOWN);
21 local_state->SetInteger(
22 prefs::kMetricsDefaultOptIn,
23 opt_in ? MetricsServiceClient::OPT_IN : MetricsServiceClient::OPT_OUT);
24 }
25
26 MetricsServiceClient::EnableMetricsDefault GetMetricsReportingDefaultOptIn(
27 PrefService* local_state) {
28 return static_cast<MetricsServiceClient::EnableMetricsDefault>(
29 local_state->GetInteger(prefs::kMetricsDefaultOptIn));
30 }
31
32 } // namespace metrics
OLDNEW
« no previous file with comments | « components/metrics/metrics_reporting_default_state.h ('k') | ios/chrome/browser/metrics/ios_chrome_metrics_service_client.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698