| 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 "android_webview/browser/aw_safe_browsing_config_helper.h" | 8 #include "android_webview/browser/aw_safe_browsing_config_helper.h" |
| 9 #include "android_webview/browser/net/aw_url_request_context_getter.h" | 9 #include "android_webview/browser/net/aw_url_request_context_getter.h" |
| 10 #include "android_webview/common/aw_version_info_values.h" | 10 #include "android_webview/common/aw_version_info_values.h" |
| 11 #include "android_webview/native/address_parser.h" |
| 11 #include "android_webview/native/aw_contents_io_thread_client_impl.h" | 12 #include "android_webview/native/aw_contents_io_thread_client_impl.h" |
| 12 #include "base/android/jni_string.h" | 13 #include "base/android/jni_string.h" |
| 13 #include "base/android/scoped_java_ref.h" | 14 #include "base/android/scoped_java_ref.h" |
| 14 #include "base/callback.h" | 15 #include "base/callback.h" |
| 15 #include "content/public/browser/browser_thread.h" | 16 #include "content/public/browser/browser_thread.h" |
| 16 #include "content/public/browser/storage_partition.h" | 17 #include "content/public/browser/storage_partition.h" |
| 17 #include "content/public/common/url_constants.h" | 18 #include "content/public/common/url_constants.h" |
| 18 #include "jni/AwContentsStatics_jni.h" | 19 #include "jni/AwContentsStatics_jni.h" |
| 19 #include "net/cert/cert_database.h" | 20 #include "net/cert/cert_database.h" |
| 20 | 21 |
| (...skipping 78 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 99 io_thread_client, browser_context); | 100 io_thread_client, browser_context); |
| 100 } | 101 } |
| 101 | 102 |
| 102 // static | 103 // static |
| 103 void SetCheckClearTextPermitted(JNIEnv* env, | 104 void SetCheckClearTextPermitted(JNIEnv* env, |
| 104 const JavaParamRef<jclass>&, | 105 const JavaParamRef<jclass>&, |
| 105 jboolean permitted) { | 106 jboolean permitted) { |
| 106 AwURLRequestContextGetter::set_check_cleartext_permitted(permitted); | 107 AwURLRequestContextGetter::set_check_cleartext_permitted(permitted); |
| 107 } | 108 } |
| 108 | 109 |
| 110 // static |
| 111 ScopedJavaLocalRef<jstring> FindAddress(JNIEnv* env, |
| 112 const JavaParamRef<jclass>& clazz, |
| 113 const JavaParamRef<jstring>& addr) { |
| 114 base::string16 content_16 = |
| 115 base::android::ConvertJavaStringToUTF16(env, addr); |
| 116 base::string16 result_16; |
| 117 if (android_webview::address_parser::FindAddress(content_16, &result_16)) |
| 118 return base::android::ConvertUTF16ToJavaString(env, result_16); |
| 119 return ScopedJavaLocalRef<jstring>(); |
| 120 } |
| 121 |
| 109 bool RegisterAwContentsStatics(JNIEnv* env) { | 122 bool RegisterAwContentsStatics(JNIEnv* env) { |
| 110 return RegisterNativesImpl(env); | 123 return RegisterNativesImpl(env); |
| 111 } | 124 } |
| 112 | 125 |
| 113 } // namespace android_webview | 126 } // namespace android_webview |
| OLD | NEW |