Index: chrome/browser/net/spdyproxy/data_reduction_proxy_chrome_settings.cc |
diff --git a/chrome/browser/net/spdyproxy/data_reduction_proxy_chrome_settings.cc b/chrome/browser/net/spdyproxy/data_reduction_proxy_chrome_settings.cc |
new file mode 100644 |
index 0000000000000000000000000000000000000000..abdbe4bd60e623134369db81ff2249744cc6cdaf |
--- /dev/null |
+++ b/chrome/browser/net/spdyproxy/data_reduction_proxy_chrome_settings.cc |
@@ -0,0 +1,40 @@ |
+// Copyright 2014 The Chromium Authors. All rights reserved. |
+// Use of this source code is governed by a BSD-style license that can be |
+// found in the LICENSE file. |
+ |
+#include "chrome/browser/net/spdyproxy/data_reduction_proxy_chrome_settings.h" |
+ |
+#include "chrome/browser/browser_process.h" |
+#include "chrome/browser/net/spdyproxy/data_reduction_proxy_chrome_configurator.h" |
+#include "chrome/browser/profiles/profile.h" |
+#include "chrome/browser/profiles/profile_manager.h" |
+#include "components/data_reduction_proxy/browser/data_reduction_proxy_configurator.h" |
+#include "components/data_reduction_proxy/browser/data_reduction_proxy_params.h" |
+#include "components/data_reduction_proxy/browser/data_reduction_proxy_settings.h" |
+ |
+using data_reduction_proxy::DataReductionProxyParams; |
+using data_reduction_proxy::DataReductionProxySettings; |
+ |
+DataReductionProxyChromeSettings::DataReductionProxyChromeSettings( |
+ DataReductionProxyParams* params) : DataReductionProxySettings(params) { |
+} |
+ |
+DataReductionProxyChromeSettings::~DataReductionProxyChromeSettings() { |
+} |
+ |
+void DataReductionProxyChromeSettings::InitDataReductionProxySettings( |
+ Profile* profile) { |
+ DCHECK(profile); |
+ PrefService* prefs = profile->GetPrefs(); |
+ |
+ scoped_ptr<data_reduction_proxy::DataReductionProxyConfigurator> |
+ configurator(new DataReductionProxyChromeConfigurator(prefs)); |
+ SetProxyConfigurator(configurator.Pass()); |
+ DataReductionProxySettings::InitDataReductionProxySettings( |
+ prefs, |
+ g_browser_process->local_state(), |
willchan no longer on Chromium
2014/07/28 15:45:22
Can you pass this in rather than reaching into the
bengr
2014/07/28 20:29:03
Done.
|
+ ProfileManager::GetActiveUserProfile()->GetRequestContext()); |
willchan no longer on Chromium
2014/07/28 15:45:22
Isn't this the same as the profile that's passed i
bengr
2014/07/28 20:29:04
That's old cruft. Done.
|
+ |
+ SetDataReductionProxyAlternativeEnabled( |
+ DataReductionProxyParams::IsIncludedInAlternativeFieldTrial()); |
+} |