Chromium Code Reviews| Index: components/data_reduction_proxy/browser/data_reduction_proxy_settings.cc |
| diff --git a/components/data_reduction_proxy/browser/data_reduction_proxy_settings.cc b/components/data_reduction_proxy/browser/data_reduction_proxy_settings.cc |
| index 3f4f0ea1a3d4aa08e601a1dbb7db60c991e6d44b..1409dcfcbdacef4ce8490a17b53b7c726e704630 100644 |
| --- a/components/data_reduction_proxy/browser/data_reduction_proxy_settings.cc |
| +++ b/components/data_reduction_proxy/browser/data_reduction_proxy_settings.cc |
| @@ -121,7 +121,8 @@ void DataReductionProxySettings::InitPrefMembers() { |
| void DataReductionProxySettings::InitDataReductionProxySettings( |
| PrefService* prefs, |
| PrefService* local_state_prefs, |
| - net::URLRequestContextGetter* url_request_context_getter) { |
| + net::URLRequestContextGetter* url_request_context_getter, |
| + const base::Callback<void(bool)>& on_data_reduction_proxy_enabled) { |
|
bengr
2014/07/30 19:08:22
This is fine, but eventually we should move to add
|
| DCHECK(thread_checker_.CalledOnValidThread()); |
| DCHECK(prefs); |
| DCHECK(local_state_prefs); |
| @@ -129,8 +130,12 @@ void DataReductionProxySettings::InitDataReductionProxySettings( |
| prefs_ = prefs; |
| local_state_prefs_ = local_state_prefs; |
| url_request_context_getter_ = url_request_context_getter; |
| + on_data_reduction_proxy_enabled_ = on_data_reduction_proxy_enabled; |
| InitPrefMembers(); |
| RecordDataReductionInit(); |
| + |
| + on_data_reduction_proxy_enabled_.Run(IsDataReductionProxyEnabled()); |
| + |
| // Disable the proxy if it is not allowed to be used. |
| if (!params_->allowed()) |
| return; |
| @@ -146,10 +151,12 @@ void DataReductionProxySettings::InitDataReductionProxySettings( |
| PrefService* prefs, |
| PrefService* local_state_prefs, |
| net::URLRequestContextGetter* url_request_context_getter, |
| - scoped_ptr<DataReductionProxyConfigurator> configurator) { |
| + scoped_ptr<DataReductionProxyConfigurator> configurator, |
| + const base::Callback<void(bool)>& on_data_reduction_proxy_enabled) { |
| InitDataReductionProxySettings(prefs, |
| local_state_prefs, |
| - url_request_context_getter); |
| + url_request_context_getter, |
| + on_data_reduction_proxy_enabled); |
| SetProxyConfigurator(configurator.Pass()); |
| } |
| @@ -180,6 +187,7 @@ void DataReductionProxySettings::SetDataReductionProxyEnabled(bool enabled) { |
| if (spdy_proxy_auth_enabled_.GetValue() != enabled) { |
| spdy_proxy_auth_enabled_.SetValue(enabled); |
| + on_data_reduction_proxy_enabled_.Run(IsDataReductionProxyEnabled()); |
|
bengr
2014/07/30 19:08:22
I think this should be done in OnProxyEnabledPrefC
megjablon
2014/07/30 21:27:07
Done.
|
| OnProxyEnabledPrefChange(); |
| } |
| } |