| 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..9fbd3a5a2402bb62a16db374bf18710140696315 100644
|
| --- a/components/data_reduction_proxy/browser/data_reduction_proxy_settings.cc
|
| +++ b/components/data_reduction_proxy/browser/data_reduction_proxy_settings.cc
|
| @@ -131,6 +131,7 @@ void DataReductionProxySettings::InitDataReductionProxySettings(
|
| url_request_context_getter_ = url_request_context_getter;
|
| InitPrefMembers();
|
| RecordDataReductionInit();
|
| +
|
| // Disable the proxy if it is not allowed to be used.
|
| if (!params_->allowed())
|
| return;
|
| @@ -153,6 +154,12 @@ void DataReductionProxySettings::InitDataReductionProxySettings(
|
| SetProxyConfigurator(configurator.Pass());
|
| }
|
|
|
| +void DataReductionProxySettings::SetOnDataReductionEnabledCallback(
|
| + const base::Callback<void(bool)>& on_data_reduction_proxy_enabled) {
|
| + on_data_reduction_proxy_enabled_ = on_data_reduction_proxy_enabled;
|
| + on_data_reduction_proxy_enabled_.Run(IsDataReductionProxyEnabled());
|
| +}
|
| +
|
| void DataReductionProxySettings::SetProxyConfigurator(
|
| scoped_ptr<DataReductionProxyConfigurator> configurator) {
|
| DCHECK(configurator);
|
| @@ -358,6 +365,8 @@ void DataReductionProxySettings::OnIPAddressChanged() {
|
|
|
| void DataReductionProxySettings::OnProxyEnabledPrefChange() {
|
| DCHECK(thread_checker_.CalledOnValidThread());
|
| + if (!on_data_reduction_proxy_enabled_.is_null())
|
| + on_data_reduction_proxy_enabled_.Run(IsDataReductionProxyEnabled());
|
| if (!params_->allowed())
|
| return;
|
| MaybeActivateDataReductionProxy(false);
|
|
|