| OLD | NEW |
| (Empty) |
| 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 | |
| 3 // found in the LICENSE file. | |
| 4 | |
| 5 #ifndef CHROME_BROWSER_METRICS_METRICS_SERVICES_MANAGER_CLIENT_H_ | |
| 6 #define CHROME_BROWSER_METRICS_METRICS_SERVICES_MANAGER_CLIENT_H_ | |
| 7 | |
| 8 #include "base/basictypes.h" | |
| 9 #include "base/callback.h" | |
| 10 #include "base/memory/scoped_ptr.h" | |
| 11 #include "base/threading/thread_checker.h" | |
| 12 | |
| 13 namespace metrics { | |
| 14 class MetricsService; | |
| 15 class MetricsServiceClient; | |
| 16 } | |
| 17 | |
| 18 namespace net { | |
| 19 class URLRequestContextGetter; | |
| 20 } | |
| 21 | |
| 22 namespace rappor { | |
| 23 class RapporService; | |
| 24 } | |
| 25 | |
| 26 namespace variations { | |
| 27 class VariationsService; | |
| 28 } | |
| 29 | |
| 30 // MetricsServicesManagerClient is an interface that allows | |
| 31 // MetricsServicesManager to interact with its embedder. | |
| 32 class MetricsServicesManagerClient { | |
| 33 public: | |
| 34 virtual ~MetricsServicesManagerClient() {} | |
| 35 | |
| 36 // Methods that create the various services in the context of the embedder. | |
| 37 virtual scoped_ptr<rappor::RapporService> CreateRapporService() = 0; | |
| 38 virtual scoped_ptr<variations::VariationsService> | |
| 39 CreateVariationsService() = 0; | |
| 40 virtual scoped_ptr<metrics::MetricsServiceClient> | |
| 41 CreateMetricsServiceClient() = 0; | |
| 42 | |
| 43 // Returns the URL request context in which the metrics services should | |
| 44 // operate. | |
| 45 virtual net::URLRequestContextGetter* GetURLRequestContext() = 0; | |
| 46 | |
| 47 // 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 | |
| 49 // 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 | |
| 51 // instance being destroyed. | |
| 52 virtual bool IsSafeBrowsingEnabled( | |
| 53 const base::Closure& on_update_callback) = 0; | |
| 54 | |
| 55 // Returns whether metrics reporting is enabled. | |
| 56 virtual bool IsMetricsReportingEnabled() = 0; | |
| 57 | |
| 58 // Whether the metrics services should record but not report metrics. | |
| 59 virtual bool OnlyDoMetricsRecording() = 0; | |
| 60 }; | |
| 61 | |
| 62 #endif // CHROME_BROWSER_METRICS_METRICS_SERVICES_MANAGER_CLIENT_H_ | |
| OLD | NEW |