OLD | NEW |
1 // Copyright 2014 The Chromium Authors. All rights reserved. | 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 | 2 // Use of this source code is governed by a BSD-style license that can be |
3 // found in the LICENSE file. | 3 // found in the LICENSE file. |
4 | 4 |
5 #ifndef CHROME_BROWSER_NET_SPDYPROXY_DATA_REDUCTION_PROXY_CHROME_SETTINGS_H_ | 5 #ifndef CHROME_BROWSER_NET_SPDYPROXY_DATA_REDUCTION_PROXY_CHROME_SETTINGS_H_ |
6 #define CHROME_BROWSER_NET_SPDYPROXY_DATA_REDUCTION_PROXY_CHROME_SETTINGS_H_ | 6 #define CHROME_BROWSER_NET_SPDYPROXY_DATA_REDUCTION_PROXY_CHROME_SETTINGS_H_ |
7 | 7 |
8 #include "base/memory/scoped_ptr.h" | |
9 #include "components/data_reduction_proxy/core/browser/data_reduction_proxy_auth
_request_handler.h" | 8 #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_sett
ings.h" | 9 #include "components/data_reduction_proxy/core/browser/data_reduction_proxy_sett
ings.h" |
11 #include "components/keyed_service/core/keyed_service.h" | 10 #include "components/keyed_service/core/keyed_service.h" |
12 | 11 |
13 namespace base { | 12 namespace base { |
14 class PrefService; | 13 class PrefService; |
15 } | 14 } |
16 | 15 |
17 namespace data_reduction_proxy { | 16 namespace data_reduction_proxy { |
18 class DataReductionProxyConfigurator; | 17 class DataReductionProxyConfig; |
19 class DataReductionProxyIOData; | 18 class DataReductionProxyIOData; |
20 class DataReductionProxyEventStore; | 19 class DataReductionProxyEventStore; |
21 class DataReductionProxyParams; | |
22 } | |
23 | |
24 namespace net { | |
25 class NetLog; | |
26 class URLRequestContextGetter; | |
27 } | 20 } |
28 | 21 |
29 class PrefService; | 22 class PrefService; |
30 | 23 |
31 // Data reduction proxy settings class suitable for use with a Chrome browser. | 24 // Data reduction proxy settings class suitable for use with a Chrome browser. |
32 // It is keyed to a browser context. | 25 // It is keyed to a browser context. |
33 class DataReductionProxyChromeSettings | 26 class DataReductionProxyChromeSettings |
34 : public data_reduction_proxy::DataReductionProxySettings, | 27 : public data_reduction_proxy::DataReductionProxySettings, |
35 public KeyedService { | 28 public KeyedService { |
36 public: | 29 public: |
37 // Constructs a settings object with the given configuration parameters. | 30 // Constructs a settings object. Construction and destruction must happen on |
38 // Construction and destruction must happen on the UI thread. | 31 // the UI thread. |
39 explicit DataReductionProxyChromeSettings( | 32 DataReductionProxyChromeSettings(); |
40 scoped_ptr<data_reduction_proxy::DataReductionProxyParams> params); | |
41 | 33 |
42 // Destructs the settings object. | 34 // Destructs the settings object. |
43 ~DataReductionProxyChromeSettings() override; | 35 ~DataReductionProxyChromeSettings() override; |
44 | 36 |
45 // Initialize the settings object with the given configurator, prefs services, | 37 // Initialize the settings object with the given prefs services, and io_data. |
46 // and request context. | |
47 void InitDataReductionProxySettings( | 38 void InitDataReductionProxySettings( |
48 data_reduction_proxy::DataReductionProxyIOData* io_data, | 39 data_reduction_proxy::DataReductionProxyIOData* io_data, |
49 PrefService* profile_prefs, | 40 PrefService* profile_prefs); |
50 PrefService* local_state_prefs, | |
51 net::URLRequestContextGetter* request_context); | |
52 | 41 |
53 // Gets the client type for the data reduction proxy. | 42 // Gets the client type for the data reduction proxy. |
54 static data_reduction_proxy::Client GetClient(); | 43 static data_reduction_proxy::Client GetClient(); |
55 | 44 |
56 private: | 45 private: |
57 // Registers the DataReductionProxyEnabled synthetic field trial with | 46 // Registers the DataReductionProxyEnabled synthetic field trial with |
58 // the group |data_reduction_proxy_enabled|. | 47 // the group |data_reduction_proxy_enabled|. |
59 void RegisterSyntheticFieldTrial(bool data_reduction_proxy_enabled); | 48 void RegisterSyntheticFieldTrial(bool data_reduction_proxy_enabled); |
60 | 49 |
61 DISALLOW_COPY_AND_ASSIGN(DataReductionProxyChromeSettings); | 50 DISALLOW_COPY_AND_ASSIGN(DataReductionProxyChromeSettings); |
62 }; | 51 }; |
63 | 52 |
64 #endif // CHROME_BROWSER_NET_SPDYPROXY_DATA_REDUCTION_PROXY_CHROME_SETTINGS_H_ | 53 #endif // CHROME_BROWSER_NET_SPDYPROXY_DATA_REDUCTION_PROXY_CHROME_SETTINGS_H_ |
OLD | NEW |