| OLD | NEW |
| 1 // Copyright 2014 The Chromium Authors. All rights reserved. | 1 // Copyright 2014 The Chromium Authors. All rights reserved. |
| 2 // Use of this source code is governed by a BSD-style license that can be | 2 // Use of this source code is governed by a BSD-style license that can be |
| 3 // found in the LICENSE file. | 3 // found in the LICENSE file. |
| 4 | 4 |
| 5 #include "android_webview/native/aw_contents_statics.h" | 5 #include "android_webview/native/aw_contents_statics.h" |
| 6 | 6 |
| 7 #include "android_webview/browser/aw_browser_context.h" | 7 #include "android_webview/browser/aw_browser_context.h" |
| 8 #include "base/android/jni_string.h" | 8 #include "base/android/jni_string.h" |
| 9 #include "base/android/scoped_java_ref.h" | 9 #include "base/android/scoped_java_ref.h" |
| 10 #include "base/callback.h" | 10 #include "base/callback.h" |
| (...skipping 36 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 47 base::Bind(&NotifyClientCertificatesChanged), | 47 base::Bind(&NotifyClientCertificatesChanged), |
| 48 base::Bind(&ClientCertificatesCleared, base::Owned(j_callback))); | 48 base::Bind(&ClientCertificatesCleared, base::Owned(j_callback))); |
| 49 } | 49 } |
| 50 | 50 |
| 51 // static | 51 // static |
| 52 void SetDataReductionProxyKey(JNIEnv* env, jclass, jstring key) { | 52 void SetDataReductionProxyKey(JNIEnv* env, jclass, jstring key) { |
| 53 AwBrowserContext* browser_context = AwBrowserContext::GetDefault(); | 53 AwBrowserContext* browser_context = AwBrowserContext::GetDefault(); |
| 54 DCHECK(browser_context); | 54 DCHECK(browser_context); |
| 55 DataReductionProxySettings* drp_settings = | 55 DataReductionProxySettings* drp_settings = |
| 56 browser_context->GetDataReductionProxySettings(); | 56 browser_context->GetDataReductionProxySettings(); |
| 57 DCHECK(drp_settings); | 57 if (drp_settings) |
| 58 drp_settings->set_key(ConvertJavaStringToUTF8(env, key)); | 58 drp_settings->params()->set_key(ConvertJavaStringToUTF8(env, key)); |
| 59 } | 59 } |
| 60 | 60 |
| 61 // static | 61 // static |
| 62 void SetDataReductionProxyEnabled(JNIEnv* env, jclass, jboolean enabled) { | 62 void SetDataReductionProxyEnabled(JNIEnv* env, jclass, jboolean enabled) { |
| 63 AwBrowserContext::SetDataReductionProxyEnabled(enabled); | 63 AwBrowserContext::SetDataReductionProxyEnabled(enabled); |
| 64 } | 64 } |
| 65 | 65 |
| 66 bool RegisterAwContentsStatics(JNIEnv* env) { | 66 bool RegisterAwContentsStatics(JNIEnv* env) { |
| 67 return RegisterNativesImpl(env); | 67 return RegisterNativesImpl(env); |
| 68 } | 68 } |
| 69 | 69 |
| 70 } // namespace android_webview | 70 } // namespace android_webview |
| OLD | NEW |