Updating trunk VERSION from 2139.0 to 2140.0
[chromium-blink-merge.git] / components / metrics / metrics_provider.h
blob001e66a42c6330f55a673840983bf24570454c97
1 // Copyright 2014 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 COMPONENTS_METRICS_METRICS_PROVIDER_H_
6 #define COMPONENTS_METRICS_METRICS_PROVIDER_H_
8 #include "base/basictypes.h"
10 namespace metrics {
12 class ChromeUserMetricsExtension;
13 class SystemProfileProto;
14 class SystemProfileProto_Stability;
16 // MetricsProvider is an interface allowing different parts of the UMA protos to
17 // be filled out by different classes.
18 class MetricsProvider {
19 public:
20 MetricsProvider() {}
21 virtual ~MetricsProvider() {}
23 // Called when a new MetricsLog is created.
24 virtual void OnDidCreateMetricsLog() {}
26 // Called when metrics recording has been enabled.
27 virtual void OnRecordingEnabled() {}
29 // Called when metrics recording has been disabled.
30 virtual void OnRecordingDisabled() {}
32 // Provides additional metrics into the system profile.
33 virtual void ProvideSystemProfileMetrics(
34 SystemProfileProto* system_profile_proto) {}
36 // Provides additional stability metrics. Stability metrics can be provided
37 // directly into |stability_proto| fields or by logging stability histograms
38 // via the UMA_STABILITY_HISTOGRAM_ENUMERATION() macro.
39 virtual void ProvideStabilityMetrics(
40 SystemProfileProto* system_profile_proto) {}
42 // Provides general metrics that are neither system profile nor stability
43 // metrics.
44 virtual void ProvideGeneralMetrics(
45 ChromeUserMetricsExtension* uma_proto) {}
47 private:
48 DISALLOW_COPY_AND_ASSIGN(MetricsProvider);
51 } // namespace metrics
53 #endif // COMPONENTS_METRICS_METRICS_PROVIDER_H_