Chromium Code Reviews| Index: chrome/browser/net/spdyproxy/data_reduction_proxy_chrome_configurator.cc |
| diff --git a/chrome/browser/net/spdyproxy/data_reduction_proxy_chrome_configurator.cc b/chrome/browser/net/spdyproxy/data_reduction_proxy_chrome_configurator.cc |
| index cb9e788a19141c70da51ee1a9136e3174f006b5a..3dff1ad452f3cdcb343695ffe224470ee29b8586 100644 |
| --- a/chrome/browser/net/spdyproxy/data_reduction_proxy_chrome_configurator.cc |
| +++ b/chrome/browser/net/spdyproxy/data_reduction_proxy_chrome_configurator.cc |
| @@ -67,6 +67,7 @@ void DataReductionProxyChromeConfigurator::Enable( |
| dict->SetString("server", server); |
| dict->SetString("mode", ProxyModeToString(ProxyPrefs::MODE_FIXED_SERVERS)); |
| dict->SetString("bypass_list", JoinString(bypass_rules_, ", ")); |
| + dict->SetBoolean("is_data_reduction_proxy", true); |
|
bengr
2014/10/27 23:28:01
How about "use_with_off_the_record", false
Not at Google. Contact bengr
2014/10/28 19:51:03
Discussed in person. Odd to use a label which is n
|
| net::ProxyConfig config; |
| config.proxy_rules().ParseFromString(server); |
| @@ -86,18 +87,23 @@ void DataReductionProxyChromeConfigurator::Enable( |
| void DataReductionProxyChromeConfigurator::Disable() { |
| DCHECK(prefs_); |
| - DictionaryPrefUpdate update(prefs_, prefs::kProxy); |
| - base::DictionaryValue* dict = update.Get(); |
| - dict->SetString("mode", ProxyModeToString(ProxyPrefs::MODE_SYSTEM)); |
| - dict->SetString("server", ""); |
| - dict->SetString("bypass_list", ""); |
| - net::ProxyConfig config = net::ProxyConfig::CreateDirect(); |
| - network_task_runner_->PostTask( |
| - FROM_HERE, |
| - base::Bind( |
| - &DataReductionProxyChromeConfigurator::UpdateProxyConfigOnIO, |
| - base::Unretained(this), |
| - config)); |
| + DictionaryPrefUpdate update(prefs_, prefs::kProxy); |
| + base::DictionaryValue* dict = update.Get(); |
| + bool is_data_reduction_proxy = false; |
| + dict->GetBoolean("is_data_reduction_proxy", &is_data_reduction_proxy); |
|
bengr
2014/10/27 23:28:01
Please verify (and add a test) that this will get
Not at Google. Contact bengr
2014/10/28 19:51:03
This approach does not work since the dictionary d
|
| + if (is_data_reduction_proxy) { |
|
bengr
2014/10/27 23:28:01
if (!is_data_reduction_proxy)
return;
Not at Google. Contact bengr
2014/10/28 19:51:03
Done.
|
| + dict->SetString("mode", ProxyModeToString(ProxyPrefs::MODE_SYSTEM)); |
| + dict->SetString("server", ""); |
| + dict->SetString("bypass_list", ""); |
| + dict->SetBoolean("is_data_reduction_proxy", false); |
| + net::ProxyConfig config = net::ProxyConfig::CreateDirect(); |
| + network_task_runner_->PostTask( |
| + FROM_HERE, |
| + base::Bind( |
| + &DataReductionProxyChromeConfigurator::UpdateProxyConfigOnIO, |
| + base::Unretained(this), |
| + config)); |
| + } |
| } |
| void DataReductionProxyChromeConfigurator::AddHostPatternToBypass( |