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_METRICS_SERVICES_MANAGER_H_ | 5 #ifndef CHROME_BROWSER_METRICS_METRICS_SERVICES_MANAGER_H_ |
6 #define CHROME_BROWSER_METRICS_METRICS_SERVICES_MANAGER_H_ | 6 #define CHROME_BROWSER_METRICS_METRICS_SERVICES_MANAGER_H_ |
7 | 7 |
8 #include "base/basictypes.h" | 8 #include "base/basictypes.h" |
9 #include "base/memory/scoped_ptr.h" | 9 #include "base/memory/scoped_ptr.h" |
10 #include "base/threading/thread_checker.h" | 10 #include "base/threading/thread_checker.h" |
(...skipping 27 matching lines...) Expand all Loading... |
38 | 38 |
39 // Returns the GetRapporService, creating it if it hasn't been created yet. | 39 // Returns the GetRapporService, creating it if it hasn't been created yet. |
40 rappor::RapporService* GetRapporService(); | 40 rappor::RapporService* GetRapporService(); |
41 | 41 |
42 // Returns the VariationsService, creating it if it hasn't been created yet. | 42 // Returns the VariationsService, creating it if it hasn't been created yet. |
43 chrome_variations::VariationsService* GetVariationsService(); | 43 chrome_variations::VariationsService* GetVariationsService(); |
44 | 44 |
45 private: | 45 private: |
46 metrics::MetricsStateManager* GetMetricsStateManager(); | 46 metrics::MetricsStateManager* GetMetricsStateManager(); |
47 | 47 |
| 48 // Returns true iff metrics reporting is enabled. |
| 49 bool IsMetricsReportingEnabled() const; |
| 50 |
48 // Ensures that all functions are called from the same thread. | 51 // Ensures that all functions are called from the same thread. |
49 base::ThreadChecker thread_checker_; | 52 base::ThreadChecker thread_checker_; |
50 | 53 |
51 // Weak pointer to the local state prefs store. | 54 // Weak pointer to the local state prefs store. |
52 PrefService* local_state_; | 55 PrefService* local_state_; |
53 | 56 |
54 // MetricsStateManager which is passed as a parameter to service constructors. | 57 // MetricsStateManager which is passed as a parameter to service constructors. |
55 scoped_ptr<metrics::MetricsStateManager> metrics_state_manager_; | 58 scoped_ptr<metrics::MetricsStateManager> metrics_state_manager_; |
56 | 59 |
57 // The MetricsService, used for UMA report uploads. | 60 // The MetricsService, used for UMA report uploads. |
58 scoped_ptr<MetricsService> metrics_service_; | 61 scoped_ptr<MetricsService> metrics_service_; |
59 | 62 |
60 // The RapporService, for RAPPOR metric uploads. | 63 // The RapporService, for RAPPOR metric uploads. |
61 scoped_ptr<rappor::RapporService> rappor_service_; | 64 scoped_ptr<rappor::RapporService> rappor_service_; |
62 | 65 |
63 // The VariationsService, for server-side experiments infrastructure. | 66 // The VariationsService, for server-side experiments infrastructure. |
64 scoped_ptr<chrome_variations::VariationsService> variations_service_; | 67 scoped_ptr<chrome_variations::VariationsService> variations_service_; |
65 | 68 |
66 DISALLOW_COPY_AND_ASSIGN(MetricsServicesManager); | 69 DISALLOW_COPY_AND_ASSIGN(MetricsServicesManager); |
67 }; | 70 }; |
68 | 71 |
69 #endif // CHROME_BROWSER_METRICS_METRICS_SERVICES_MANAGER_H_ | 72 #endif // CHROME_BROWSER_METRICS_METRICS_SERVICES_MANAGER_H_ |
OLD | NEW |