Upstream version 11.40.277.0
[platform/framework/web/crosswalk.git] / src / chrome / browser / net / spdyproxy / data_reduction_proxy_chrome_settings.h
1 // Copyright 2014 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_NET_SPDYPROXY_DATA_REDUCTION_PROXY_CHROME_SETTINGS_H_
6 #define CHROME_BROWSER_NET_SPDYPROXY_DATA_REDUCTION_PROXY_CHROME_SETTINGS_H_
7
8 #include "base/memory/scoped_ptr.h"
9 #include "components/data_reduction_proxy/core/browser/data_reduction_proxy_auth_request_handler.h"
10 #include "components/data_reduction_proxy/core/browser/data_reduction_proxy_settings.h"
11 #include "components/keyed_service/core/keyed_service.h"
12
13 namespace base {
14 class PrefService;
15 }
16
17 namespace data_reduction_proxy {
18 class DataReductionProxyConfigurator;
19 class DataReductionProxyParams;
20 }
21
22 namespace net {
23 class URLRequestContextGetter;
24 }
25
26 class PrefService;
27
28 // Data reduction proxy settings class suitable for use with a Chrome browser.
29 // It is keyed to a browser context.
30 class DataReductionProxyChromeSettings
31     : public data_reduction_proxy::DataReductionProxySettings,
32       public KeyedService {
33  public:
34   // Constructs a settings object with the given configuration parameters.
35   // Construction and destruction must happen on the UI thread.
36   explicit DataReductionProxyChromeSettings(
37       data_reduction_proxy::DataReductionProxyParams* params);
38
39   // Destructs the settings object.
40   ~DataReductionProxyChromeSettings() override;
41
42   // Initialize the settings object with the given configurator, prefs services,
43   // and request context.
44   void InitDataReductionProxySettings(
45       data_reduction_proxy::DataReductionProxyConfigurator* configurator,
46       PrefService* profile_prefs,
47       PrefService* local_state_prefs,
48       net::URLRequestContextGetter* request_context);
49
50   // Gets the client type for the data reduction proxy.
51   static data_reduction_proxy::Client GetClient();
52
53  private:
54   // Registers the DataReductionProxyEnabled synthetic field trial with
55   // the group |data_reduction_proxy_enabled|.
56   void RegisterSyntheticFieldTrial(bool data_reduction_proxy_enabled);
57
58   DISALLOW_COPY_AND_ASSIGN(DataReductionProxyChromeSettings);
59 };
60
61 #endif  // CHROME_BROWSER_NET_SPDYPROXY_DATA_REDUCTION_PROXY_CHROME_SETTINGS_H_