| 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..ddb13744ad51c2ca36fbc84519a906ff12b96f8e 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) {
|
| 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());
|
| }
|
|
|
| @@ -358,6 +365,7 @@ void DataReductionProxySettings::OnIPAddressChanged() {
|
|
|
| void DataReductionProxySettings::OnProxyEnabledPrefChange() {
|
| DCHECK(thread_checker_.CalledOnValidThread());
|
| + on_data_reduction_proxy_enabled_.Run(IsDataReductionProxyEnabled());
|
| if (!params_->allowed())
|
| return;
|
| MaybeActivateDataReductionProxy(false);
|
|
|