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" | 7 #include "base/memory/scoped_ptr.h" |
8 #include "base/prefs/pref_service.h" | 8 #include "base/prefs/pref_service.h" |
9 #include "base/prefs/scoped_user_pref_update.h" | 9 #include "base/prefs/scoped_user_pref_update.h" |
10 #include "chrome/browser/browser_process.h" | 10 #include "chrome/browser/browser_process.h" |
11 #include "chrome/browser/metrics/chrome_metrics_service_accessor.h" | 11 #include "chrome/browser/metrics/chrome_metrics_service_accessor.h" |
12 #include "chrome/browser/prefs/proxy_prefs.h" | 12 #include "chrome/browser/prefs/proxy_prefs.h" |
13 #include "chrome/browser/profiles/profile.h" | 13 #include "chrome/browser/profiles/profile.h" |
14 #include "chrome/browser/profiles/profile_manager.h" | 14 #include "chrome/browser/profiles/profile_manager.h" |
15 #include "chrome/common/pref_names.h" | 15 #include "chrome/common/pref_names.h" |
16 #include "components/data_reduction_proxy/core/browser/data_reduction_proxy_auth
_request_handler.h" | 16 #include "components/data_reduction_proxy/core/browser/data_reduction_proxy_auth
_request_handler.h" |
17 #include "components/data_reduction_proxy/core/browser/data_reduction_proxy_conf
igurator.h" | 17 #include "components/data_reduction_proxy/core/browser/data_reduction_proxy_conf
igurator.h" |
| 18 #include "components/data_reduction_proxy/core/browser/data_reduction_proxy_io_d
ata.h" |
18 #include "components/data_reduction_proxy/core/browser/data_reduction_proxy_sett
ings.h" | 19 #include "components/data_reduction_proxy/core/browser/data_reduction_proxy_sett
ings.h" |
19 #include "components/data_reduction_proxy/core/common/data_reduction_proxy_param
s.h" | 20 #include "components/data_reduction_proxy/core/common/data_reduction_proxy_param
s.h" |
20 #include "net/url_request/url_request_context_getter.h" | 21 #include "net/url_request/url_request_context_getter.h" |
21 | 22 |
22 using data_reduction_proxy::Client; | 23 using data_reduction_proxy::Client; |
23 using data_reduction_proxy::DataReductionProxyParams; | 24 using data_reduction_proxy::DataReductionProxyParams; |
24 using data_reduction_proxy::DataReductionProxySettings; | 25 using data_reduction_proxy::DataReductionProxySettings; |
25 | 26 |
26 // The Data Reduction Proxy has been turned into a "best effort" proxy, | 27 // The Data Reduction Proxy has been turned into a "best effort" proxy, |
27 // meaning it is used only if the effective proxy configuration resolves to | 28 // meaning it is used only if the effective proxy configuration resolves to |
(...skipping 23 matching lines...) Expand all Loading... |
51 } | 52 } |
52 | 53 |
53 DataReductionProxyChromeSettings::DataReductionProxyChromeSettings( | 54 DataReductionProxyChromeSettings::DataReductionProxyChromeSettings( |
54 DataReductionProxyParams* params) : DataReductionProxySettings(params) { | 55 DataReductionProxyParams* params) : DataReductionProxySettings(params) { |
55 } | 56 } |
56 | 57 |
57 DataReductionProxyChromeSettings::~DataReductionProxyChromeSettings() { | 58 DataReductionProxyChromeSettings::~DataReductionProxyChromeSettings() { |
58 } | 59 } |
59 | 60 |
60 void DataReductionProxyChromeSettings::InitDataReductionProxySettings( | 61 void DataReductionProxyChromeSettings::InitDataReductionProxySettings( |
61 data_reduction_proxy::DataReductionProxyConfigurator* configurator, | 62 data_reduction_proxy::DataReductionProxyIOData* io_data, |
62 PrefService* profile_prefs, | 63 PrefService* profile_prefs, |
63 PrefService* local_state_prefs, | 64 PrefService* local_state_prefs, |
64 net::URLRequestContextGetter* request_context, | 65 net::URLRequestContextGetter* request_context) { |
65 net::NetLog* net_log, | 66 SetProxyConfigurator(io_data->configurator()); |
66 data_reduction_proxy::DataReductionProxyEventStore* event_store) { | |
67 SetProxyConfigurator(configurator); | |
68 DataReductionProxySettings::InitDataReductionProxySettings( | 67 DataReductionProxySettings::InitDataReductionProxySettings( |
69 profile_prefs, | 68 profile_prefs, |
70 request_context, | 69 request_context, |
71 net_log, | 70 io_data->net_log(), |
72 event_store); | 71 io_data->event_store()); |
73 DataReductionProxySettings::SetOnDataReductionEnabledCallback( | 72 DataReductionProxySettings::SetOnDataReductionEnabledCallback( |
74 base::Bind(&DataReductionProxyChromeSettings::RegisterSyntheticFieldTrial, | 73 base::Bind(&DataReductionProxyChromeSettings::RegisterSyntheticFieldTrial, |
75 base::Unretained(this))); | 74 base::Unretained(this))); |
76 SetDataReductionProxyAlternativeEnabled( | 75 SetDataReductionProxyAlternativeEnabled( |
77 DataReductionProxyParams::IsIncludedInAlternativeFieldTrial()); | 76 DataReductionProxyParams::IsIncludedInAlternativeFieldTrial()); |
78 // TODO(bengr): Remove after M46. See http://crbug.com/445599. | 77 // TODO(bengr): Remove after M46. See http://crbug.com/445599. |
79 MigrateDataReductionProxyOffProxyPrefs(profile_prefs); | 78 MigrateDataReductionProxyOffProxyPrefs(profile_prefs); |
80 } | 79 } |
81 | 80 |
82 void DataReductionProxyChromeSettings::RegisterSyntheticFieldTrial( | 81 void DataReductionProxyChromeSettings::RegisterSyntheticFieldTrial( |
(...skipping 22 matching lines...) Expand all Loading... |
105 #elif defined(OS_OPENBSD) | 104 #elif defined(OS_OPENBSD) |
106 return Client::CHROME_OPENBSD; | 105 return Client::CHROME_OPENBSD; |
107 #elif defined(OS_SOLARIS) | 106 #elif defined(OS_SOLARIS) |
108 return Client::CHROME_SOLARIS; | 107 return Client::CHROME_SOLARIS; |
109 #elif defined(OS_QNX) | 108 #elif defined(OS_QNX) |
110 return Client::CHROME_QNX; | 109 return Client::CHROME_QNX; |
111 #else | 110 #else |
112 return Client::UNKNOWN; | 111 return Client::UNKNOWN; |
113 #endif | 112 #endif |
114 } | 113 } |
OLD | NEW |