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 #include "chrome/browser/net/spdyproxy/data_reduction_proxy_chrome_settings.h" | 5 #include "chrome/browser/net/spdyproxy/data_reduction_proxy_chrome_settings.h" |
6 | 6 |
| 7 #include "base/memory/scoped_ptr.h" |
| 8 #include "base/prefs/pref_service.h" |
7 #include "chrome/browser/browser_process.h" | 9 #include "chrome/browser/browser_process.h" |
8 #include "chrome/browser/net/spdyproxy/data_reduction_proxy_chrome_configurator.
h" | 10 #include "chrome/browser/net/spdyproxy/data_reduction_proxy_chrome_configurator.
h" |
9 #include "chrome/browser/profiles/profile.h" | 11 #include "chrome/browser/profiles/profile.h" |
10 #include "chrome/browser/profiles/profile_manager.h" | 12 #include "chrome/browser/profiles/profile_manager.h" |
11 #include "components/data_reduction_proxy/browser/data_reduction_proxy_configura
tor.h" | 13 #include "components/data_reduction_proxy/browser/data_reduction_proxy_configura
tor.h" |
12 #include "components/data_reduction_proxy/browser/data_reduction_proxy_params.h" | 14 #include "components/data_reduction_proxy/browser/data_reduction_proxy_params.h" |
13 #include "components/data_reduction_proxy/browser/data_reduction_proxy_settings.
h" | 15 #include "components/data_reduction_proxy/browser/data_reduction_proxy_settings.
h" |
| 16 #include "net/url_request/url_request_context_getter.h" |
14 | 17 |
15 using data_reduction_proxy::DataReductionProxyParams; | 18 using data_reduction_proxy::DataReductionProxyParams; |
16 using data_reduction_proxy::DataReductionProxySettings; | 19 using data_reduction_proxy::DataReductionProxySettings; |
17 | 20 |
18 DataReductionProxyChromeSettings::DataReductionProxyChromeSettings( | 21 DataReductionProxyChromeSettings::DataReductionProxyChromeSettings( |
19 DataReductionProxyParams* params) : DataReductionProxySettings(params) { | 22 DataReductionProxyParams* params) : DataReductionProxySettings(params) { |
20 } | 23 } |
21 | 24 |
22 DataReductionProxyChromeSettings::~DataReductionProxyChromeSettings() { | 25 DataReductionProxyChromeSettings::~DataReductionProxyChromeSettings() { |
23 } | 26 } |
24 | 27 |
25 void DataReductionProxyChromeSettings::InitDataReductionProxySettings( | 28 void DataReductionProxyChromeSettings::InitDataReductionProxySettings( |
26 Profile* profile) { | 29 scoped_ptr<data_reduction_proxy::DataReductionProxyConfigurator> |
27 DCHECK(profile); | 30 configurator, |
28 PrefService* prefs = profile->GetPrefs(); | 31 PrefService* profile_prefs, |
29 | 32 PrefService* local_state_prefs, |
30 scoped_ptr<data_reduction_proxy::DataReductionProxyConfigurator> | 33 net::URLRequestContextGetter* request_context) { |
31 configurator(new DataReductionProxyChromeConfigurator(prefs)); | |
32 SetProxyConfigurator(configurator.Pass()); | 34 SetProxyConfigurator(configurator.Pass()); |
33 DataReductionProxySettings::InitDataReductionProxySettings( | 35 DataReductionProxySettings::InitDataReductionProxySettings( |
34 prefs, | 36 profile_prefs, |
35 g_browser_process->local_state(), | 37 local_state_prefs, |
36 ProfileManager::GetActiveUserProfile()->GetRequestContext()); | 38 request_context); |
37 | |
38 SetDataReductionProxyAlternativeEnabled( | 39 SetDataReductionProxyAlternativeEnabled( |
39 DataReductionProxyParams::IsIncludedInAlternativeFieldTrial()); | 40 DataReductionProxyParams::IsIncludedInAlternativeFieldTrial()); |
40 } | 41 } |
OLD | NEW |