Roll src/third_party/WebKit 605a979:06cb9e9 (svn 202556:202558)
[chromium-blink-merge.git] / components / variations / service / variations_service_client.h
blob2cd26c832963499f4d8b4a3d40f3ff791c8c3b2f
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_
8 #include <string>
10 #include "base/callback.h"
11 #include "base/strings/string16.h"
12 #include "base/version.h"
13 #include "components/version_info/version_info.h"
15 namespace base {
16 class SequencedWorkerPool;
19 namespace net {
20 class URLRequestContextGetter;
23 namespace network_time {
24 class NetworkTimeTracker;
27 namespace variations {
29 // An abstraction of operations that depend on the embedder's (e.g. Chrome)
30 // environment.
31 class VariationsServiceClient {
32 public:
33 virtual ~VariationsServiceClient() {}
35 // Returns the current application locale (e.g. "en-US").
36 virtual std::string GetApplicationLocale() = 0;
38 // Returns the SequencedWorkerPool on which the VariationsService should run
39 // tasks that may block.
40 virtual base::SequencedWorkerPool* GetBlockingPool() = 0;
42 // Returns a callback that when run returns the base::Version to use for
43 // variations seed simulation. VariationsService guarantees that the callback
44 // will be run on the pool returned by
45 // VariationsServiceClient::GetBlockingPool().
46 virtual base::Callback<base::Version(void)>
47 GetVersionForSimulationCallback() = 0;
49 virtual net::URLRequestContextGetter* GetURLRequestContext() = 0;
50 virtual network_time::NetworkTimeTracker* GetNetworkTimeTracker() = 0;
52 // Gets the channel of the embedder.
53 virtual version_info::Channel GetChannel() = 0;
55 // Returns whether the embedder overrides the value of the restrict parameter.
56 // |parameter| is an out-param that will contain the value of the restrict
57 // parameter if true is returned.
58 virtual bool OverridesRestrictParameter(std::string* parameter) = 0;
60 // Allows the embedder to override the string resource specified by |hash|
61 // with |string| in the resource bundle if desired.
62 virtual void OverrideUIString(uint32_t hash,
63 const base::string16& string) = 0;
65 // Called from VariationsService::PerformPreMainMessageLoopStartup().
66 virtual void OnInitialStartup() {}
69 } // namespace variations
71 #endif // COMPONENTS_VARIATIONS_SERVICE_VARIATIONS_SERVICE_CLIENT_H_