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 #include "components/rappor/rappor_service.h" |
11 | 12 |
12 class ChromeMetricsServiceClient; | 13 class ChromeMetricsServiceClient; |
13 class PrefService; | 14 class PrefService; |
14 | 15 |
15 namespace base { | 16 namespace base { |
16 class FilePath; | 17 class FilePath; |
17 } | 18 } |
18 | 19 |
19 namespace metrics { | 20 namespace metrics { |
20 class MetricsService; | 21 class MetricsService; |
(...skipping 30 matching lines...) Expand all Loading... |
51 // Should be called when a plugin loading error occurs. | 52 // Should be called when a plugin loading error occurs. |
52 void OnPluginLoadingError(const base::FilePath& plugin_path); | 53 void OnPluginLoadingError(const base::FilePath& plugin_path); |
53 | 54 |
54 // Update the managed services when permissions for recording/uploading | 55 // Update the managed services when permissions for recording/uploading |
55 // metrics change. | 56 // metrics change. |
56 void UpdatePermissions(bool may_record, bool may_upload); | 57 void UpdatePermissions(bool may_record, bool may_upload); |
57 | 58 |
58 // Returns true iff metrics reporting is enabled. | 59 // Returns true iff metrics reporting is enabled. |
59 bool IsMetricsReportingEnabled() const; | 60 bool IsMetricsReportingEnabled() const; |
60 | 61 |
| 62 // Returns true iff Rappor reporting is enabled. |
| 63 bool IsRapporEnabled(bool metrics_enabled) const; |
| 64 |
| 65 // Returns the recording level for Rappor metrics. |
| 66 rappor::RecordingLevel GetRapporRecordingLevel(bool metrics_enabled) const; |
| 67 |
61 private: | 68 private: |
62 // Returns the ChromeMetricsServiceClient, creating it if it hasn't been | 69 // Returns the ChromeMetricsServiceClient, creating it if it hasn't been |
63 // created yet (and additionally creating the MetricsService in that case). | 70 // created yet (and additionally creating the MetricsService in that case). |
64 ChromeMetricsServiceClient* GetChromeMetricsServiceClient(); | 71 ChromeMetricsServiceClient* GetChromeMetricsServiceClient(); |
65 | 72 |
66 metrics::MetricsStateManager* GetMetricsStateManager(); | 73 metrics::MetricsStateManager* GetMetricsStateManager(); |
67 | 74 |
68 // Ensures that all functions are called from the same thread. | 75 // Ensures that all functions are called from the same thread. |
69 base::ThreadChecker thread_checker_; | 76 base::ThreadChecker thread_checker_; |
70 | 77 |
(...skipping 10 matching lines...) Expand all Loading... |
81 // The RapporService, for RAPPOR metric uploads. | 88 // The RapporService, for RAPPOR metric uploads. |
82 scoped_ptr<rappor::RapporService> rappor_service_; | 89 scoped_ptr<rappor::RapporService> rappor_service_; |
83 | 90 |
84 // The VariationsService, for server-side experiments infrastructure. | 91 // The VariationsService, for server-side experiments infrastructure. |
85 scoped_ptr<chrome_variations::VariationsService> variations_service_; | 92 scoped_ptr<chrome_variations::VariationsService> variations_service_; |
86 | 93 |
87 DISALLOW_COPY_AND_ASSIGN(MetricsServicesManager); | 94 DISALLOW_COPY_AND_ASSIGN(MetricsServicesManager); |
88 }; | 95 }; |
89 | 96 |
90 #endif // CHROME_BROWSER_METRICS_METRICS_SERVICES_MANAGER_H_ | 97 #endif // CHROME_BROWSER_METRICS_METRICS_SERVICES_MANAGER_H_ |
OLD | NEW |