Pin Chrome's shortcut to the Win10 Start menu on install and OS upgrade.
[chromium-blink-merge.git] / chrome / browser / extensions / api / metrics_private / metrics_private_api.h
blob631132ec19ef8d3a673e6e67d4707ded3ec81b5b
1 // Copyright (c) 2012 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.
5 #ifndef CHROME_BROWSER_EXTENSIONS_API_METRICS_PRIVATE_METRICS_PRIVATE_API_H_
6 #define CHROME_BROWSER_EXTENSIONS_API_METRICS_PRIVATE_METRICS_PRIVATE_API_H_
8 #include <string>
10 #include "base/metrics/histogram.h"
11 #include "extensions/browser/extension_function.h"
13 namespace extensions {
15 class MetricsPrivateGetIsCrashReportingEnabledFunction
16 : public SyncExtensionFunction {
17 public:
18 DECLARE_EXTENSION_FUNCTION("metricsPrivate.getIsCrashReportingEnabled",
19 METRICSPRIVATE_GETISCRASHRECORDINGENABLED)
21 protected:
22 ~MetricsPrivateGetIsCrashReportingEnabledFunction() override {}
24 // ExtensionFunction:
25 bool RunSync() override;
28 class MetricsPrivateGetFieldTrialFunction : public SyncExtensionFunction {
29 public:
30 DECLARE_EXTENSION_FUNCTION("metricsPrivate.getFieldTrial",
31 METRICSPRIVATE_GETFIELDTRIAL)
33 protected:
34 ~MetricsPrivateGetFieldTrialFunction() override {}
36 // ExtensionFunction:
37 bool RunSync() override;
40 class MetricsPrivateGetVariationParamsFunction : public SyncExtensionFunction {
41 public:
42 DECLARE_EXTENSION_FUNCTION("metricsPrivate.getVariationParams",
43 METRICSPRIVATE_GETVARIATIONPARAMS)
45 protected:
46 ~MetricsPrivateGetVariationParamsFunction() override {}
48 // ExtensionFunction:
49 bool RunSync() override;
52 class MetricsPrivateRecordUserActionFunction : public SyncExtensionFunction {
53 public:
54 DECLARE_EXTENSION_FUNCTION("metricsPrivate.recordUserAction",
55 METRICSPRIVATE_RECORDUSERACTION)
57 protected:
58 ~MetricsPrivateRecordUserActionFunction() override {}
60 // ExtensionFunction:
61 bool RunSync() override;
64 class MetricsHistogramHelperFunction : public SyncExtensionFunction {
65 protected:
66 ~MetricsHistogramHelperFunction() override {}
67 virtual bool RecordValue(const std::string& name,
68 base::HistogramType type,
69 int min, int max, size_t buckets,
70 int sample);
73 class MetricsPrivateRecordValueFunction
74 : public MetricsHistogramHelperFunction {
75 public:
76 DECLARE_EXTENSION_FUNCTION("metricsPrivate.recordValue",
77 METRICSPRIVATE_RECORDVALUE)
79 protected:
80 ~MetricsPrivateRecordValueFunction() override {}
82 // ExtensionFunction:
83 bool RunSync() override;
86 class MetricsPrivateRecordSparseValueFunction
87 : public MetricsHistogramHelperFunction {
88 public:
89 DECLARE_EXTENSION_FUNCTION("metricsPrivate.recordSparseValue",
90 METRICSPRIVATE_RECORDSPARSEVALUE)
92 protected:
93 ~MetricsPrivateRecordSparseValueFunction() override {}
95 // ExtensionFunction:
96 bool RunSync() override;
99 class MetricsPrivateRecordPercentageFunction
100 : public MetricsHistogramHelperFunction {
101 public:
102 DECLARE_EXTENSION_FUNCTION("metricsPrivate.recordPercentage",
103 METRICSPRIVATE_RECORDPERCENTAGE)
105 protected:
106 ~MetricsPrivateRecordPercentageFunction() override {}
108 // ExtensionFunction:
109 bool RunSync() override;
112 class MetricsPrivateRecordCountFunction
113 : public MetricsHistogramHelperFunction {
114 public:
115 DECLARE_EXTENSION_FUNCTION("metricsPrivate.recordCount",
116 METRICSPRIVATE_RECORDCOUNT)
118 protected:
119 ~MetricsPrivateRecordCountFunction() override {}
121 // ExtensionFunction:
122 bool RunSync() override;
125 class MetricsPrivateRecordSmallCountFunction
126 : public MetricsHistogramHelperFunction {
127 public:
128 DECLARE_EXTENSION_FUNCTION("metricsPrivate.recordSmallCount",
129 METRICSPRIVATE_RECORDSMALLCOUNT)
131 protected:
132 ~MetricsPrivateRecordSmallCountFunction() override {}
134 // ExtensionFunction:
135 bool RunSync() override;
138 class MetricsPrivateRecordMediumCountFunction
139 : public MetricsHistogramHelperFunction {
140 public:
141 DECLARE_EXTENSION_FUNCTION("metricsPrivate.recordMediumCount",
142 METRICSPRIVATE_RECORDMEDIUMCOUNT)
144 protected:
145 ~MetricsPrivateRecordMediumCountFunction() override {}
147 // ExtensionFunction:
148 bool RunSync() override;
151 class MetricsPrivateRecordTimeFunction : public MetricsHistogramHelperFunction {
152 public:
153 DECLARE_EXTENSION_FUNCTION("metricsPrivate.recordTime",
154 METRICSPRIVATE_RECORDTIME)
156 protected:
157 ~MetricsPrivateRecordTimeFunction() override {}
159 // ExtensionFunction:
160 bool RunSync() override;
163 class MetricsPrivateRecordMediumTimeFunction
164 : public MetricsHistogramHelperFunction {
165 public:
166 DECLARE_EXTENSION_FUNCTION("metricsPrivate.recordMediumTime",
167 METRICSPRIVATE_RECORDMEDIUMTIME)
169 protected:
170 ~MetricsPrivateRecordMediumTimeFunction() override {}
172 // ExtensionFunction:
173 bool RunSync() override;
176 class MetricsPrivateRecordLongTimeFunction
177 : public MetricsHistogramHelperFunction {
178 public:
179 DECLARE_EXTENSION_FUNCTION("metricsPrivate.recordLongTime",
180 METRICSPRIVATE_RECORDLONGTIME)
182 protected:
183 ~MetricsPrivateRecordLongTimeFunction() override {}
185 // ExtensionFunction:
186 bool RunSync() override;
189 } // namespace extensions
191 #endif // CHROME_BROWSER_EXTENSIONS_API_METRICS_PRIVATE_METRICS_PRIVATE_API_H_