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/io_thread.h" |
11 #include "chrome/browser/metrics/chrome_metrics_service_accessor.h" | 12 #include "chrome/browser/metrics/chrome_metrics_service_accessor.h" |
12 #include "chrome/browser/prefs/proxy_prefs.h" | 13 #include "chrome/browser/prefs/proxy_prefs.h" |
13 #include "chrome/browser/profiles/profile.h" | 14 #include "chrome/browser/profiles/profile.h" |
14 #include "chrome/browser/profiles/profile_manager.h" | 15 #include "chrome/browser/profiles/profile_manager.h" |
15 #include "chrome/common/pref_names.h" | 16 #include "chrome/common/pref_names.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_auth
_request_handler.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_conf
igurator.h" |
18 #include "components/data_reduction_proxy/core/browser/data_reduction_proxy_io_d
ata.h" | 19 #include "components/data_reduction_proxy/core/browser/data_reduction_proxy_io_d
ata.h" |
19 #include "components/data_reduction_proxy/core/browser/data_reduction_proxy_sett
ings.h" | 20 #include "components/data_reduction_proxy/core/browser/data_reduction_proxy_sett
ings.h" |
20 #include "components/data_reduction_proxy/core/common/data_reduction_proxy_param
s.h" | 21 #include "components/data_reduction_proxy/core/common/data_reduction_proxy_param
s.h" |
(...skipping 42 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
63 : DataReductionProxySettings(params.Pass()) { | 64 : DataReductionProxySettings(params.Pass()) { |
64 } | 65 } |
65 | 66 |
66 DataReductionProxyChromeSettings::~DataReductionProxyChromeSettings() { | 67 DataReductionProxyChromeSettings::~DataReductionProxyChromeSettings() { |
67 } | 68 } |
68 | 69 |
69 void DataReductionProxyChromeSettings::InitDataReductionProxySettings( | 70 void DataReductionProxyChromeSettings::InitDataReductionProxySettings( |
70 data_reduction_proxy::DataReductionProxyIOData* io_data, | 71 data_reduction_proxy::DataReductionProxyIOData* io_data, |
71 PrefService* profile_prefs, | 72 PrefService* profile_prefs, |
72 PrefService* local_state_prefs, | 73 PrefService* local_state_prefs, |
73 net::URLRequestContextGetter* request_context) { | 74 net::URLRequestContextGetter* request_context, |
| 75 bool quic_enabled_for_proxies) { |
74 SetProxyConfigurator(io_data->configurator()); | 76 SetProxyConfigurator(io_data->configurator()); |
75 DataReductionProxySettings::InitDataReductionProxySettings( | 77 DataReductionProxySettings::InitDataReductionProxySettings( |
76 profile_prefs, | 78 profile_prefs, request_context, io_data->net_log(), |
77 request_context, | 79 io_data->event_store(), quic_enabled_for_proxies); |
78 io_data->net_log(), | 80 |
79 io_data->event_store()); | |
80 DataReductionProxySettings::SetOnDataReductionEnabledCallback( | 81 DataReductionProxySettings::SetOnDataReductionEnabledCallback( |
81 base::Bind(&DataReductionProxyChromeSettings::RegisterSyntheticFieldTrial, | 82 base::Bind(&DataReductionProxyChromeSettings::RegisterSyntheticFieldTrial, |
82 base::Unretained(this))); | 83 base::Unretained(this))); |
83 SetDataReductionProxyAlternativeEnabled( | 84 SetDataReductionProxyAlternativeEnabled( |
84 DataReductionProxyParams::IsIncludedInAlternativeFieldTrial()); | 85 DataReductionProxyParams::IsIncludedInAlternativeFieldTrial()); |
85 // TODO(bengr): Remove after M46. See http://crbug.com/445599. | 86 // TODO(bengr): Remove after M46. See http://crbug.com/445599. |
86 MigrateDataReductionProxyOffProxyPrefs(profile_prefs); | 87 MigrateDataReductionProxyOffProxyPrefs(profile_prefs); |
87 } | 88 } |
88 | 89 |
89 void DataReductionProxyChromeSettings::RegisterSyntheticFieldTrial( | 90 void DataReductionProxyChromeSettings::RegisterSyntheticFieldTrial( |
(...skipping 22 matching lines...) Expand all Loading... |
112 #elif defined(OS_OPENBSD) | 113 #elif defined(OS_OPENBSD) |
113 return Client::CHROME_OPENBSD; | 114 return Client::CHROME_OPENBSD; |
114 #elif defined(OS_SOLARIS) | 115 #elif defined(OS_SOLARIS) |
115 return Client::CHROME_SOLARIS; | 116 return Client::CHROME_SOLARIS; |
116 #elif defined(OS_QNX) | 117 #elif defined(OS_QNX) |
117 return Client::CHROME_QNX; | 118 return Client::CHROME_QNX; |
118 #else | 119 #else |
119 return Client::UNKNOWN; | 120 return Client::UNKNOWN; |
120 #endif | 121 #endif |
121 } | 122 } |
OLD | NEW |