| 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 | |
| 51 // Ensures that all functions are called from the same thread. | 48 // Ensures that all functions are called from the same thread. |
| 52 base::ThreadChecker thread_checker_; | 49 base::ThreadChecker thread_checker_; |
| 53 | 50 |
| 54 // Weak pointer to the local state prefs store. | 51 // Weak pointer to the local state prefs store. |
| 55 PrefService* local_state_; | 52 PrefService* local_state_; |
| 56 | 53 |
| 57 // MetricsStateManager which is passed as a parameter to service constructors. | 54 // MetricsStateManager which is passed as a parameter to service constructors. |
| 58 scoped_ptr<metrics::MetricsStateManager> metrics_state_manager_; | 55 scoped_ptr<metrics::MetricsStateManager> metrics_state_manager_; |
| 59 | 56 |
| 60 // The MetricsService, used for UMA report uploads. | 57 // The MetricsService, used for UMA report uploads. |
| 61 scoped_ptr<MetricsService> metrics_service_; | 58 scoped_ptr<MetricsService> metrics_service_; |
| 62 | 59 |
| 63 // The RapporService, for RAPPOR metric uploads. | 60 // The RapporService, for RAPPOR metric uploads. |
| 64 scoped_ptr<rappor::RapporService> rappor_service_; | 61 scoped_ptr<rappor::RapporService> rappor_service_; |
| 65 | 62 |
| 66 // The VariationsService, for server-side experiments infrastructure. | 63 // The VariationsService, for server-side experiments infrastructure. |
| 67 scoped_ptr<chrome_variations::VariationsService> variations_service_; | 64 scoped_ptr<chrome_variations::VariationsService> variations_service_; |
| 68 | 65 |
| 69 DISALLOW_COPY_AND_ASSIGN(MetricsServicesManager); | 66 DISALLOW_COPY_AND_ASSIGN(MetricsServicesManager); |
| 70 }; | 67 }; |
| 71 | 68 |
| 72 #endif // CHROME_BROWSER_METRICS_METRICS_SERVICES_MANAGER_H_ | 69 #endif // CHROME_BROWSER_METRICS_METRICS_SERVICES_MANAGER_H_ |
| OLD | NEW |