• Home
  • Line#
  • Scopes#
  • Navigate#
  • Raw
  • Download
1 // Copyright 2014 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.
4 
5 #ifndef COMPONENTS_METRICS_METRICS_SWITCHES_H_
6 #define COMPONENTS_METRICS_METRICS_SWITCHES_H_
7 
8 #include "base/command_line.h"
9 
10 namespace metrics {
11 namespace switches {
12 
13 // Alphabetical list of switches specific to the metrics component. Document
14 // each in the .cc file.
15 
16 extern const char kExportUmaLogsToFile[];
17 extern const char kForceEnableMetricsReporting[];
18 extern const char kMetricsRecordingOnly[];
19 extern const char kMetricsUploadIntervalSec[];
20 extern const char kResetVariationState[];
21 extern const char kUkmServerUrl[];
22 extern const char kUmaServerUrl[];
23 extern const char kUmaInsecureServerUrl[];
24 
25 }  // namespace switches
26 
27 // Returns true if kMetricsRecordingOnly is on the command line for the current
28 // process.
29 bool IsMetricsRecordingOnlyEnabled();
30 
31 // Returns true if kForceEnableMetricsReporting is on the command line for the
32 // current process.
33 bool IsMetricsReportingForceEnabled();
34 
35 // Returns true if kForceMsbbSettingOnForUkm is on the command line for the
36 // current process.
37 bool IsMsbbSettingForcedOnForUkm();
38 
39 // Adds kMetricsRecordingOnly to |command_line| if not already present.
40 void EnableMetricsRecordingOnlyForTesting(
41     base::CommandLine* command_line = base::CommandLine::ForCurrentProcess());
42 
43 // Adds kForceEnableMetricsReporting to |command_line| if not already present.
44 void ForceEnableMetricsReportingForTesting(
45     base::CommandLine* command_line = base::CommandLine::ForCurrentProcess());
46 
47 }  // namespace metrics
48 
49 #endif  // COMPONENTS_METRICS_METRICS_SWITCHES_H_
50