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 COMPONENTS_VARIATIONS_VARIATIONS_SERVICE_CLIENT_H_ | |
6 #define COMPONENTS_VARIATIONS_VARIATIONS_SERVICE_CLIENT_H_ | |
7 | |
8 #include <string> | |
9 | |
10 #include "base/callback.h" | |
11 #include "base/version.h" | |
12 | |
13 namespace base { | |
14 class SequencedWorkerPool; | |
15 } | |
16 | |
17 namespace net { | |
18 class URLRequestContextGetter; | |
19 } | |
20 | |
21 namespace network_time { | |
22 class NetworkTimeTracker; | |
23 } | |
24 | |
25 namespace chrome_variations { | |
26 | |
27 // An abstraction of operations that depend on the embedder's (e.g. Chrome) | |
28 // environment. | |
29 class VariationsServiceClient { | |
30 public: | |
31 virtual ~VariationsServiceClient() {} | |
32 | |
33 // Returns the current application locale (e.g. "en-US"). | |
34 virtual std::string GetApplicationLocale() = 0; | |
35 | |
36 // Returns the SequencedWorkerPool on which the VariationsService should run | |
37 // tasks that may block. | |
38 virtual base::SequencedWorkerPool* GetBlockingPool() = 0; | |
39 | |
40 // Returns a callback that when run returns the base::Version to use for | |
41 // variations seed simulation. VariationsService guarantees that the callback | |
42 // will be run on the pool returned by | |
43 // VariationsServiceClient::GetBlockingPool(). | |
44 virtual base::Callback<base::Version(void)> | |
45 GetVersionForSimulationCallback() = 0; | |
46 | |
47 virtual net::URLRequestContextGetter* GetURLRequestContext() = 0; | |
48 virtual network_time::NetworkTimeTracker* GetNetworkTimeTracker() = 0; | |
49 | |
50 // Called from VariationsService::PerformPreMainMessageLoopStartup(). | |
51 virtual void OnInitialStartup() {} | |
52 }; | |
53 | |
54 } // namespace chrome_variations | |
55 | |
56 #endif // COMPONENTS_VARIATIONS_VARIATIONS_SERVICE_CLIENT_H_ | |
OLD | NEW |