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.
5 #ifndef COMPONENTS_VARIATIONS_SERVICE_VARIATIONS_SERVICE_CLIENT_H_
6 #define COMPONENTS_VARIATIONS_SERVICE_VARIATIONS_SERVICE_CLIENT_H_
10 #include "base/callback.h"
11 #include "base/version.h"
14 class SequencedWorkerPool
;
18 class URLRequestContextGetter
;
21 namespace network_time
{
22 class NetworkTimeTracker
;
25 namespace chrome_variations
{
27 // An abstraction of operations that depend on the embedder's (e.g. Chrome)
29 class VariationsServiceClient
{
31 virtual ~VariationsServiceClient() {}
33 // Returns the current application locale (e.g. "en-US").
34 virtual std::string
GetApplicationLocale() = 0;
36 // Returns the SequencedWorkerPool on which the VariationsService should run
37 // tasks that may block.
38 virtual base::SequencedWorkerPool
* GetBlockingPool() = 0;
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;
47 virtual net::URLRequestContextGetter
* GetURLRequestContext() = 0;
48 virtual network_time::NetworkTimeTracker
* GetNetworkTimeTracker() = 0;
50 // Called from VariationsService::PerformPreMainMessageLoopStartup().
51 virtual void OnInitialStartup() {}
54 } // namespace chrome_variations
56 #endif // COMPONENTS_VARIATIONS_SERVICE_VARIATIONS_SERVICE_CLIENT_H_