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" |
11 #include "components/data_reduction_proxy/browser/data_reduction_proxy_settings.
h" | 11 #include "components/data_reduction_proxy/browser/data_reduction_proxy_settings.
h" |
12 #include "content/public/browser/browser_thread.h" | 12 #include "content/public/browser/browser_thread.h" |
| 13 #include "content/public/common/url_constants.h" |
13 #include "jni/AwContentsStatics_jni.h" | 14 #include "jni/AwContentsStatics_jni.h" |
14 #include "net/cert/cert_database.h" | 15 #include "net/cert/cert_database.h" |
15 | 16 |
16 using base::android::AttachCurrentThread; | 17 using base::android::AttachCurrentThread; |
17 using base::android::ConvertJavaStringToUTF8; | 18 using base::android::ConvertJavaStringToUTF8; |
18 using base::android::ScopedJavaGlobalRef; | 19 using base::android::ScopedJavaGlobalRef; |
19 using content::BrowserThread; | 20 using content::BrowserThread; |
20 using data_reduction_proxy::DataReductionProxySettings; | 21 using data_reduction_proxy::DataReductionProxySettings; |
21 | 22 |
22 namespace android_webview { | 23 namespace android_webview { |
(...skipping 33 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
56 browser_context->GetDataReductionProxySettings(); | 57 browser_context->GetDataReductionProxySettings(); |
57 if (drp_settings) | 58 if (drp_settings) |
58 drp_settings->params()->set_key(ConvertJavaStringToUTF8(env, key)); | 59 drp_settings->params()->set_key(ConvertJavaStringToUTF8(env, key)); |
59 } | 60 } |
60 | 61 |
61 // static | 62 // static |
62 void SetDataReductionProxyEnabled(JNIEnv* env, jclass, jboolean enabled) { | 63 void SetDataReductionProxyEnabled(JNIEnv* env, jclass, jboolean enabled) { |
63 AwBrowserContext::SetDataReductionProxyEnabled(enabled); | 64 AwBrowserContext::SetDataReductionProxyEnabled(enabled); |
64 } | 65 } |
65 | 66 |
| 67 // static |
| 68 jstring GetUnreachableWebDataUrl(JNIEnv* env, jclass) { |
| 69 return base::android::ConvertUTF8ToJavaString( |
| 70 env, content::kUnreachableWebDataURL).Release(); |
| 71 } |
| 72 |
66 bool RegisterAwContentsStatics(JNIEnv* env) { | 73 bool RegisterAwContentsStatics(JNIEnv* env) { |
67 return RegisterNativesImpl(env); | 74 return RegisterNativesImpl(env); |
68 } | 75 } |
69 | 76 |
70 } // namespace android_webview | 77 } // namespace android_webview |
OLD | NEW |