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

Side by Side Diff: chrome/browser/metrics/metrics_reporting_state.h

Issue 2248793002: Remove OnRecordingDisabled() metrics client interface. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: add helper function Created 4 years, 4 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
1 // Copyright (c) 2011 The Chromium Authors. All rights reserved. 1 // Copyright (c) 2011 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 #ifndef CHROME_BROWSER_METRICS_METRICS_REPORTING_STATE_H_ 5 #ifndef CHROME_BROWSER_METRICS_METRICS_REPORTING_STATE_H_
6 #define CHROME_BROWSER_METRICS_METRICS_REPORTING_STATE_H_ 6 #define CHROME_BROWSER_METRICS_METRICS_REPORTING_STATE_H_
7 7
8 #include "base/callback.h" 8 #include "base/callback.h"
9 #include "components/metrics/metrics_service_client.h" 9 #include "components/metrics/metrics_service_client.h"
10 10
11 typedef base::Callback<void(bool)> OnMetricsReportingCallbackType; 11 typedef base::Callback<void(bool)> OnMetricsReportingCallbackType;
12 12
13 class PrefService; 13 class PrefService;
14 class PrefRegistrySimple; 14 class PrefRegistrySimple;
15 15
16 // Changes metrics reporting state without caring about the success of the 16 // Changes metrics reporting state without caring about the success of the
17 // change. 17 // change.
18 void ChangeMetricsReportingState(bool enabled); 18 void ChangeMetricsReportingState(bool enabled);
19 19
20 // Changes metrics reporting state to the new value of |enabled|. Starts or 20 // Changes metrics reporting state to the new value of |enabled|. Starts or
21 // stops the metrics service based on the new state and then runs |callback_fn| 21 // stops the metrics service based on the new state and then runs |callback_fn|
22 // (which can be null) with the updated state (as the operation may fail). On 22 // (which can be null) with the updated state (as the operation may fail). On
23 // platforms other than CrOS and Android, also updates the underlying pref. 23 // platforms other than CrOS and Android, also updates the underlying pref.
24 // TODO(gayane): Support setting the pref on all platforms. 24 // TODO(gayane): Support setting the pref on all platforms.
25 void ChangeMetricsReportingStateWithReply( 25 void ChangeMetricsReportingStateWithReply(
26 bool enabled, 26 bool enabled,
27 const OnMetricsReportingCallbackType& callback_fn); 27 const OnMetricsReportingCallbackType& callback_fn);
28 28
29 // Update metrics prefs on a permission (opt-in/out) change. When opting out,
30 // this clears various client ids. When opting in, this resets saving crash
31 // prefs, so as not to trigger upload of various stale data.
32 void UpdateMetricsPrefsOnPermissionChange(bool metrics_enabled);
33
29 // Returns whether MetricsReporting can be modified by the user (except 34 // Returns whether MetricsReporting can be modified by the user (except
30 // Android). 35 // Android).
31 bool IsMetricsReportingPolicyManaged(); 36 bool IsMetricsReportingPolicyManaged();
32 37
33 // Initialize kMetricsReportingEnabled based on kStatsReportingPref device 38 // Initialize kMetricsReportingEnabled based on kStatsReportingPref device
34 // setting and add an observer as it is the source of truth on Chrome OS. 39 // setting and add an observer as it is the source of truth on Chrome OS.
35 void SetupMetricsStateForChromeOS(); 40 void SetupMetricsStateForChromeOS();
36 41
37 #endif // CHROME_BROWSER_METRICS_METRICS_REPORTING_STATE_H_ 42 #endif // CHROME_BROWSER_METRICS_METRICS_REPORTING_STATE_H_
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698