OLD | NEW |
---|---|
1 // Copyright 2014 The Chromium Authors. All rights reserved. | 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 | 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_ANDROID_METRICS_PROVIDER_H_ | 5 #ifndef CHROME_BROWSER_METRICS_ANDROID_METRICS_PROVIDER_H_ |
6 #define CHROME_BROWSER_METRICS_ANDROID_METRICS_PROVIDER_H_ | 6 #define CHROME_BROWSER_METRICS_ANDROID_METRICS_PROVIDER_H_ |
7 | 7 |
8 #include "base/basictypes.h" | 8 #include "base/basictypes.h" |
9 #include "chrome/browser/android/activity_type_ids.h" | 9 #include "chrome/browser/android/activity_type_ids.h" |
10 #include "components/metrics/metrics_provider.h" | 10 #include "components/metrics/metrics_provider.h" |
11 | 11 |
12 class PrefService; | 12 class PrefService; |
13 class PrefRegistrySimple; | 13 class PrefRegistrySimple; |
14 | 14 |
15 // AndroidMetricsProvider provides Android-specific stability metrics. | 15 // AndroidMetricsProvider provides Android-specific stability metrics. |
16 class AndroidMetricsProvider : public metrics::MetricsProvider { | 16 class AndroidMetricsProvider : public metrics::MetricsProvider { |
17 public: | 17 public: |
18 // Creates the AndroidMetricsProvider with the given |local_state|. | 18 // Creates the AndroidMetricsProvider with the given |local_state|. |
19 explicit AndroidMetricsProvider(PrefService* local_state); | 19 explicit AndroidMetricsProvider(PrefService* local_state); |
20 virtual ~AndroidMetricsProvider(); | 20 virtual ~AndroidMetricsProvider(); |
21 | 21 |
22 // metrics::MetricsProvider: | |
Alexei Svitkine (slow)
2014/10/17 18:30:52
Can you put this in the same section as ProvideSta
Maria
2014/10/17 21:44:50
This file needs to be generally reordered as the c
Alexei Svitkine (slow)
2014/10/20 15:47:00
That sounds fine to me, thanks!
| |
23 void OnCollectFinalMetrics() override; | |
24 | |
22 // Called when the Activity that the user interacts with is swapped out. | 25 // Called when the Activity that the user interacts with is swapped out. |
23 // TODO(asvitkine): Expose a way for Android code to actually invoke this. | 26 // TODO(asvitkine): Expose a way for Android code to actually invoke this. |
24 void OnForegroundActivityChanged(ActivityTypeIds::Type type); | 27 void OnForegroundActivityChanged(ActivityTypeIds::Type type); |
25 | 28 |
26 // metrics::MetricsDataProvider: | 29 // metrics::MetricsProvider: |
27 virtual void ProvideStabilityMetrics( | 30 virtual void ProvideStabilityMetrics( |
28 metrics::SystemProfileProto* system_profile_proto) override; | 31 metrics::SystemProfileProto* system_profile_proto) override; |
29 | 32 |
30 // Registers local state prefs used by this class. | 33 // Registers local state prefs used by this class. |
31 static void RegisterPrefs(PrefRegistrySimple* registry); | 34 static void RegisterPrefs(PrefRegistrySimple* registry); |
32 | 35 |
33 private: | 36 private: |
34 // Called to log launch and crash stats to preferences. | 37 // Called to log launch and crash stats to preferences. |
35 void LogStabilityToPrefs(); | 38 void LogStabilityToPrefs(); |
36 | 39 |
37 // Converts crash stats stored in the preferences into histograms. | 40 // Converts crash stats stored in the preferences into histograms. |
38 void ConvertStabilityPrefsToHistograms(); | 41 void ConvertStabilityPrefsToHistograms(); |
39 | 42 |
40 // Weak pointer to the local state prefs store. | 43 // Weak pointer to the local state prefs store. |
41 PrefService* local_state_; | 44 PrefService* local_state_; |
42 | 45 |
43 DISALLOW_COPY_AND_ASSIGN(AndroidMetricsProvider); | 46 DISALLOW_COPY_AND_ASSIGN(AndroidMetricsProvider); |
44 }; | 47 }; |
45 | 48 |
46 #endif // CHROME_BROWSER_METRICS_ANDROID_METRICS_PROVIDER_H_ | 49 #endif // CHROME_BROWSER_METRICS_ANDROID_METRICS_PROVIDER_H_ |
OLD | NEW |