| 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" |
| 11 | 11 |
| 12 class ChromeMetricsServiceClient; | 12 class ChromeMetricsServiceClient; |
| 13 class MetricsService; | 13 class MetricsService; |
| 14 class PrefService; | 14 class PrefService; |
| 15 | 15 |
| 16 namespace base { | |
| 17 class FilePath; | |
| 18 } | |
| 19 | |
| 20 namespace metrics { | 16 namespace metrics { |
| 21 class MetricsStateManager; | 17 class MetricsStateManager; |
| 22 } | 18 } |
| 23 | 19 |
| 24 namespace rappor { | 20 namespace rappor { |
| 25 class RapporService; | 21 class RapporService; |
| 26 } | 22 } |
| 27 | 23 |
| 28 namespace chrome_variations { | 24 namespace chrome_variations { |
| 29 class VariationsService; | 25 class VariationsService; |
| (...skipping 10 matching lines...) Expand all Loading... |
| 40 | 36 |
| 41 // Returns the MetricsService, creating it if it hasn't been created yet. | 37 // Returns the MetricsService, creating it if it hasn't been created yet. |
| 42 MetricsService* GetMetricsService(); | 38 MetricsService* GetMetricsService(); |
| 43 | 39 |
| 44 // Returns the GetRapporService, creating it if it hasn't been created yet. | 40 // Returns the GetRapporService, creating it if it hasn't been created yet. |
| 45 rappor::RapporService* GetRapporService(); | 41 rappor::RapporService* GetRapporService(); |
| 46 | 42 |
| 47 // Returns the VariationsService, creating it if it hasn't been created yet. | 43 // Returns the VariationsService, creating it if it hasn't been created yet. |
| 48 chrome_variations::VariationsService* GetVariationsService(); | 44 chrome_variations::VariationsService* GetVariationsService(); |
| 49 | 45 |
| 50 // Should be called when a plugin loading error occurs. | |
| 51 void OnPluginLoadingError(const base::FilePath& plugin_path); | |
| 52 | |
| 53 private: | 46 private: |
| 54 metrics::MetricsStateManager* GetMetricsStateManager(); | 47 metrics::MetricsStateManager* GetMetricsStateManager(); |
| 55 | 48 |
| 56 // Returns true iff metrics reporting is enabled. | 49 // Returns true iff metrics reporting is enabled. |
| 57 bool IsMetricsReportingEnabled() const; | 50 bool IsMetricsReportingEnabled() const; |
| 58 | 51 |
| 59 // Ensures that all functions are called from the same thread. | 52 // Ensures that all functions are called from the same thread. |
| 60 base::ThreadChecker thread_checker_; | 53 base::ThreadChecker thread_checker_; |
| 61 | 54 |
| 62 // Weak pointer to the local state prefs store. | 55 // Weak pointer to the local state prefs store. |
| 63 PrefService* local_state_; | 56 PrefService* local_state_; |
| 64 | 57 |
| 65 // MetricsStateManager which is passed as a parameter to service constructors. | 58 // MetricsStateManager which is passed as a parameter to service constructors. |
| 66 scoped_ptr<metrics::MetricsStateManager> metrics_state_manager_; | 59 scoped_ptr<metrics::MetricsStateManager> metrics_state_manager_; |
| 67 | 60 |
| 68 // Chrome embedder implementation of the MetricsServiceClient. Owns the | 61 // Chrome embedder implementation of the MetricsServiceClient. Owns the |
| 69 // MetricsService. | 62 // MetricsService. |
| 70 scoped_ptr<ChromeMetricsServiceClient> metrics_service_client_; | 63 scoped_ptr<ChromeMetricsServiceClient> metrics_service_client_; |
| 71 | 64 |
| 72 // The RapporService, for RAPPOR metric uploads. | 65 // The RapporService, for RAPPOR metric uploads. |
| 73 scoped_ptr<rappor::RapporService> rappor_service_; | 66 scoped_ptr<rappor::RapporService> rappor_service_; |
| 74 | 67 |
| 75 // The VariationsService, for server-side experiments infrastructure. | 68 // The VariationsService, for server-side experiments infrastructure. |
| 76 scoped_ptr<chrome_variations::VariationsService> variations_service_; | 69 scoped_ptr<chrome_variations::VariationsService> variations_service_; |
| 77 | 70 |
| 78 DISALLOW_COPY_AND_ASSIGN(MetricsServicesManager); | 71 DISALLOW_COPY_AND_ASSIGN(MetricsServicesManager); |
| 79 }; | 72 }; |
| 80 | 73 |
| 81 #endif // CHROME_BROWSER_METRICS_METRICS_SERVICES_MANAGER_H_ | 74 #endif // CHROME_BROWSER_METRICS_METRICS_SERVICES_MANAGER_H_ |
| OLD | NEW |