Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(261)

Unified Diff: components/data_reduction_proxy/browser/data_reduction_proxy_settings.cc

Issue 421653005: Adding synthetic field trial for DataReductionProxyEnabled (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@newPltWithCL
Patch Set: Moving set callback out of init Created 6 years, 5 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
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());
bengr 2014/07/30 23:42:07 Is this needed?
megjablon 2014/07/30 23:57:06 Yes, because we want the synthetic field trial set
+}
+
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);

Powered by Google App Engine
This is Rietveld 408576698