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

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

Issue 1411863002: Use kMetricsReportingEnabled instead of kStatsReporingPref on metrics side (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Add default value for device setting Created 5 years, 1 month 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 9
10 typedef base::Callback<void(bool)> OnMetricsReportingCallbackType; 10 typedef base::Callback<void(bool)> OnMetricsReportingCallbackType;
11 11
12 // Initiates a change to metrics reporting state to the new value of |enabled|. 12 // Initiates a change to metrics reporting state to the new value of |enabled|.
13 // Starts or stops the metrics service based on the new state and then runs 13 // Starts or stops the metrics service based on the new state and then runs
14 // |callback_fn| (which can be null) with the updated state (as the operation 14 // |callback_fn| (which can be null) with the updated state (as the operation
15 // may fail). On platforms other than CrOS and Android, also updates the 15 // may fail). On platforms other than CrOS and Android, also updates the
16 // underlying pref. 16 // underlying pref.
17 // TODO(gayane): Support setting the pref on all platforms. 17 // TODO(gayane): Support setting the pref on all platforms.
18 void InitiateMetricsReportingChange( 18 void InitiateMetricsReportingChange(
19 bool enabled, 19 bool enabled,
20 const OnMetricsReportingCallbackType& callback_fn); 20 const OnMetricsReportingCallbackType& callback_fn);
21 21
22 // Returns whether MetricsReporting can be modified by the user (except CrOS and 22 // Returns whether MetricsReporting can be modified by the user (except
23 // Android). 23 // Android).
24 bool IsMetricsReportingUserChangable(); 24 bool IsMetricsReportingPolicyManaged();
25
26 // Initialize kMetricsReportingEnabled based on kStatsReportingPref device
27 // setting and add an observer as it is the source of truth on Chrome OS.
28 void SetupMetricsStateForChromeOS();
25 29
26 #endif // CHROME_BROWSER_METRICS_METRICS_REPORTING_STATE_H_ 30 #endif // CHROME_BROWSER_METRICS_METRICS_REPORTING_STATE_H_
OLDNEW
« no previous file with comments | « chrome/browser/metrics/chrome_metrics_services_manager_client.cc ('k') | chrome/browser/metrics/metrics_reporting_state.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698