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 37 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
48 // Returns the VariationsService, creating it if it hasn't been created yet. | 48 // Returns the VariationsService, creating it if it hasn't been created yet. |
49 chrome_variations::VariationsService* GetVariationsService(); | 49 chrome_variations::VariationsService* GetVariationsService(); |
50 | 50 |
51 // Should be called when a plugin loading error occurs. | 51 // Should be called when a plugin loading error occurs. |
52 void OnPluginLoadingError(const base::FilePath& plugin_path); | 52 void OnPluginLoadingError(const base::FilePath& plugin_path); |
53 | 53 |
54 // Update the managed services when permissions for recording/uploading | 54 // Update the managed services when permissions for recording/uploading |
55 // metrics change. | 55 // metrics change. |
56 void UpdatePermissions(bool may_record, bool may_upload); | 56 void UpdatePermissions(bool may_record, bool may_upload); |
57 | 57 |
| 58 // Update the managed services when permissions for uploading metrics change. |
| 59 void UpdateUploadPermissions(bool may_upload); |
| 60 |
| 61 private: |
58 // Returns true iff metrics reporting is enabled. | 62 // Returns true iff metrics reporting is enabled. |
59 bool IsMetricsReportingEnabled() const; | 63 bool IsMetricsReportingEnabled() const; |
60 | 64 |
61 private: | |
62 // Returns the ChromeMetricsServiceClient, creating it if it hasn't been | 65 // Returns the ChromeMetricsServiceClient, creating it if it hasn't been |
63 // created yet (and additionally creating the MetricsService in that case). | 66 // created yet (and additionally creating the MetricsService in that case). |
64 ChromeMetricsServiceClient* GetChromeMetricsServiceClient(); | 67 ChromeMetricsServiceClient* GetChromeMetricsServiceClient(); |
65 | 68 |
66 metrics::MetricsStateManager* GetMetricsStateManager(); | 69 metrics::MetricsStateManager* GetMetricsStateManager(); |
67 | 70 |
68 // Ensures that all functions are called from the same thread. | 71 // Ensures that all functions are called from the same thread. |
69 base::ThreadChecker thread_checker_; | 72 base::ThreadChecker thread_checker_; |
70 | 73 |
71 // Weak pointer to the local state prefs store. | 74 // Weak pointer to the local state prefs store. |
72 PrefService* local_state_; | 75 PrefService* local_state_; |
73 | 76 |
74 // MetricsStateManager which is passed as a parameter to service constructors. | 77 // MetricsStateManager which is passed as a parameter to service constructors. |
75 scoped_ptr<metrics::MetricsStateManager> metrics_state_manager_; | 78 scoped_ptr<metrics::MetricsStateManager> metrics_state_manager_; |
76 | 79 |
77 // Chrome embedder implementation of the MetricsServiceClient. Owns the | 80 // Chrome embedder implementation of the MetricsServiceClient. Owns the |
78 // MetricsService. | 81 // MetricsService. |
79 scoped_ptr<ChromeMetricsServiceClient> metrics_service_client_; | 82 scoped_ptr<ChromeMetricsServiceClient> metrics_service_client_; |
80 | 83 |
81 // The RapporService, for RAPPOR metric uploads. | 84 // The RapporService, for RAPPOR metric uploads. |
82 scoped_ptr<rappor::RapporService> rappor_service_; | 85 scoped_ptr<rappor::RapporService> rappor_service_; |
83 | 86 |
84 // The VariationsService, for server-side experiments infrastructure. | 87 // The VariationsService, for server-side experiments infrastructure. |
85 scoped_ptr<chrome_variations::VariationsService> variations_service_; | 88 scoped_ptr<chrome_variations::VariationsService> variations_service_; |
86 | 89 |
87 DISALLOW_COPY_AND_ASSIGN(MetricsServicesManager); | 90 DISALLOW_COPY_AND_ASSIGN(MetricsServicesManager); |
88 }; | 91 }; |
89 | 92 |
90 #endif // CHROME_BROWSER_METRICS_METRICS_SERVICES_MANAGER_H_ | 93 #endif // CHROME_BROWSER_METRICS_METRICS_SERVICES_MANAGER_H_ |
OLD | NEW |