Index: android_webview/native/aw_contents_statics.cc |
diff --git a/android_webview/native/aw_contents_statics.cc b/android_webview/native/aw_contents_statics.cc |
index 2b38d798b0e32ca29b8b8a71f1d95bc9b6038488..b89195cbf38fd7c2ca13e7fbc7bf6e0ed6e084f0 100644 |
--- a/android_webview/native/aw_contents_statics.cc |
+++ b/android_webview/native/aw_contents_statics.cc |
@@ -4,8 +4,10 @@ |
#include "android_webview/native/aw_contents_statics.h" |
+#include "android_webview/browser/aw_browser_context.h" |
#include "base/android/scoped_java_ref.h" |
#include "base/callback.h" |
+#include "components/data_reduction_proxy/browser/data_reduction_proxy_settings.h" |
#include "content/public/browser/browser_thread.h" |
#include "jni/AwContentsStatics_jni.h" |
#include "net/cert/cert_database.h" |
@@ -13,6 +15,7 @@ |
using base::android::AttachCurrentThread; |
using base::android::ScopedJavaGlobalRef; |
using content::BrowserThread; |
+using data_reduction_proxy::DataReductionProxySettings; |
namespace android_webview { |
@@ -43,6 +46,16 @@ void ClearClientCertPreferences(JNIEnv* env, jclass, jobject callback) { |
base::Bind(&ClientCertificatesCleared, base::Owned(j_callback))); |
} |
+// static |
+void SetDataReductionProxyEnabled(JNIEnv* env, jclass, jboolean enabled) { |
+ AwBrowserContext* context = AwBrowserContext::GetDefault(); |
+ if (context == NULL) return; |
boliu
2014/05/06 23:38:04
return on new line (don't need brackets) here and
|
+ DataReductionProxySettings* proxy_settings = |
+ context->GetDataReductionProxySettings(); |
+ if (proxy_settings == NULL) return; |
+ proxy_settings->SetDataReductionProxyEnabled(enabled); |
+} |
+ |
bool RegisterAwContentsStatics(JNIEnv* env) { |
return RegisterNativesImpl(env); |
} |