OLD | NEW |
1 // Copyright 2015 The Chromium Authors. All rights reserved. | 1 // Copyright 2015 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 COMPONENTS_METRICS_SERVICES_MANAGER_METRICS_SERVICES_MANAGER_CLIENT_H_ | 5 #ifndef COMPONENTS_METRICS_SERVICES_MANAGER_METRICS_SERVICES_MANAGER_CLIENT_H_ |
6 #define COMPONENTS_METRICS_SERVICES_MANAGER_METRICS_SERVICES_MANAGER_CLIENT_H_ | 6 #define COMPONENTS_METRICS_SERVICES_MANAGER_METRICS_SERVICES_MANAGER_CLIENT_H_ |
7 | 7 |
8 #include <memory> | 8 #include <memory> |
9 | 9 |
10 #include "base/callback_forward.h" | 10 #include "base/callback_forward.h" |
| 11 #include "base/metrics/field_trial.h" |
11 | 12 |
12 namespace metrics { | 13 namespace metrics { |
13 class MetricsServiceClient; | 14 class MetricsServiceClient; |
14 } | 15 } |
15 | 16 |
16 namespace net { | 17 namespace net { |
17 class URLRequestContextGetter; | 18 class URLRequestContextGetter; |
18 } | 19 } |
19 | 20 |
20 namespace rappor { | 21 namespace rappor { |
(...skipping 11 matching lines...) Expand all Loading... |
32 class MetricsServicesManagerClient { | 33 class MetricsServicesManagerClient { |
33 public: | 34 public: |
34 virtual ~MetricsServicesManagerClient() {} | 35 virtual ~MetricsServicesManagerClient() {} |
35 | 36 |
36 // Methods that create the various services in the context of the embedder. | 37 // Methods that create the various services in the context of the embedder. |
37 virtual std::unique_ptr<rappor::RapporService> CreateRapporService() = 0; | 38 virtual std::unique_ptr<rappor::RapporService> CreateRapporService() = 0; |
38 virtual std::unique_ptr<variations::VariationsService> | 39 virtual std::unique_ptr<variations::VariationsService> |
39 CreateVariationsService() = 0; | 40 CreateVariationsService() = 0; |
40 virtual std::unique_ptr<metrics::MetricsServiceClient> | 41 virtual std::unique_ptr<metrics::MetricsServiceClient> |
41 CreateMetricsServiceClient() = 0; | 42 CreateMetricsServiceClient() = 0; |
| 43 virtual std::unique_ptr<const base::FieldTrial::EntropyProvider> |
| 44 CreateEntropyProvider() = 0; |
42 | 45 |
43 // Returns the URL request context in which the metrics services should | 46 // Returns the URL request context in which the metrics services should |
44 // operate. | 47 // operate. |
45 virtual net::URLRequestContextGetter* GetURLRequestContext() = 0; | 48 virtual net::URLRequestContextGetter* GetURLRequestContext() = 0; |
46 | 49 |
47 // Returns whether safe browsing is enabled. If relevant in the embedder's | 50 // Returns whether safe browsing is enabled. If relevant in the embedder's |
48 // context, |on_update_callback| will be set up to be called when the state of | 51 // context, |on_update_callback| will be set up to be called when the state of |
49 // safe browsing changes. |on_update_callback| is guaranteed to be valid for | 52 // safe browsing changes. |on_update_callback| is guaranteed to be valid for |
50 // the lifetime of this client instance, but should not be used beyond this | 53 // the lifetime of this client instance, but should not be used beyond this |
51 // instance being destroyed. | 54 // instance being destroyed. |
52 virtual bool IsSafeBrowsingEnabled( | 55 virtual bool IsSafeBrowsingEnabled( |
53 const base::Closure& on_update_callback) = 0; | 56 const base::Closure& on_update_callback) = 0; |
54 | 57 |
55 // Returns whether metrics reporting is enabled. | 58 // Returns whether metrics reporting is enabled. |
56 virtual bool IsMetricsReportingEnabled() = 0; | 59 virtual bool IsMetricsReportingEnabled() = 0; |
57 | 60 |
58 // Whether the metrics services should record but not report metrics. | 61 // Whether the metrics services should record but not report metrics. |
59 virtual bool OnlyDoMetricsRecording() = 0; | 62 virtual bool OnlyDoMetricsRecording() = 0; |
60 | 63 |
61 // Update the running state of metrics services managed by the embedder, for | 64 // Update the running state of metrics services managed by the embedder, for |
62 // example, crash reporting. | 65 // example, crash reporting. |
63 virtual void UpdateRunningServices(bool may_record, bool may_upload) {} | 66 virtual void UpdateRunningServices(bool may_record, bool may_upload) {} |
64 }; | 67 }; |
65 | 68 |
66 } // namespace metrics_services_manager | 69 } // namespace metrics_services_manager |
67 | 70 |
68 #endif // COMPONENTS_METRICS_SERVICES_MANAGER_METRICS_SERVICES_MANAGER_CLIENT_H
_ | 71 #endif // COMPONENTS_METRICS_SERVICES_MANAGER_METRICS_SERVICES_MANAGER_CLIENT_H
_ |
OLD | NEW |