OLD | NEW |
1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2012 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/android_webview_jni_registrar.h" | 5 #include "android_webview/native/android_webview_jni_registrar.h" |
6 | 6 |
7 #include "android_webview/native/android_protocol_handler.h" | 7 #include "android_webview/native/android_protocol_handler.h" |
8 #include "android_webview/native/aw_contents.h" | 8 #include "android_webview/native/aw_contents.h" |
9 #include "android_webview/native/aw_contents_io_thread_client_impl.h" | 9 #include "android_webview/native/aw_contents_io_thread_client_impl.h" |
10 #include "android_webview/native/aw_http_auth_handler.h" | 10 #include "android_webview/native/aw_http_auth_handler.h" |
11 #include "android_webview/native/aw_resource.h" | 11 #include "android_webview/native/aw_resource.h" |
12 #include "android_webview/native/aw_web_contents_delegate.h" | 12 #include "android_webview/native/aw_web_contents_delegate.h" |
13 #include "android_webview/native/cookie_manager.h" | 13 #include "android_webview/native/cookie_manager.h" |
14 #include "android_webview/native/input_stream_impl.h" | 14 #include "android_webview/native/input_stream_impl.h" |
15 #include "android_webview/native/intercepted_request_data_impl.h" | 15 #include "android_webview/native/intercepted_request_data_impl.h" |
16 #include "android_webview/native/js_result_handler.h" | 16 #include "android_webview/native/js_result_handler.h" |
17 #include "base/android/jni_android.h" | 17 #include "base/android/jni_android.h" |
18 #include "base/android/jni_registrar.h" | 18 #include "base/android/jni_registrar.h" |
19 #include "content/components/navigation_interception/component_jni_registrar.h" | |
20 #include "content/components/web_contents_delegate_android/component_jni_registr
ar.h" | |
21 | 19 |
22 namespace android_webview { | 20 namespace android_webview { |
23 | 21 |
24 static base::android::RegistrationMethod kWebViewRegisteredMethods[] = { | 22 static base::android::RegistrationMethod kWebViewRegisteredMethods[] = { |
25 // Register JNI for components we depend on. | |
26 { "navigation_interception", content::RegisterNavigationInterceptionJni }, | |
27 { "web_contents_delegate_android", | |
28 content::RegisterWebContentsDelegateAndroidJni }, | |
29 // Register JNI for android_webview classes. | 23 // Register JNI for android_webview classes. |
30 { "AndroidProtocolHandler", RegisterAndroidProtocolHandler }, | 24 { "AndroidProtocolHandler", RegisterAndroidProtocolHandler }, |
31 { "AwContents", RegisterAwContents }, | 25 { "AwContents", RegisterAwContents }, |
32 { "AwContentsIoThreadClientImpl", RegisterAwContentsIoThreadClientImpl}, | 26 { "AwContentsIoThreadClientImpl", RegisterAwContentsIoThreadClientImpl}, |
33 { "AwHttpAuthHandler", RegisterAwHttpAuthHandler }, | 27 { "AwHttpAuthHandler", RegisterAwHttpAuthHandler }, |
34 { "AwResource", AwResource::RegisterAwResource }, | 28 { "AwResource", AwResource::RegisterAwResource }, |
35 { "AwWebContentsDelegate", RegisterAwWebContentsDelegate }, | 29 { "AwWebContentsDelegate", RegisterAwWebContentsDelegate }, |
36 { "CookieManager", RegisterCookieManager }, | 30 { "CookieManager", RegisterCookieManager }, |
37 { "InterceptedRequestDataImpl", RegisterInterceptedRequestData }, | 31 { "InterceptedRequestDataImpl", RegisterInterceptedRequestData }, |
38 { "InputStream", RegisterInputStream }, | 32 { "InputStream", RegisterInputStream }, |
39 { "JsResultHandler", RegisterJsResultHandler }, | 33 { "JsResultHandler", RegisterJsResultHandler }, |
40 }; | 34 }; |
41 | 35 |
42 bool RegisterJni(JNIEnv* env) { | 36 bool RegisterJni(JNIEnv* env) { |
43 return RegisterNativeMethods(env, | 37 return RegisterNativeMethods(env, |
44 kWebViewRegisteredMethods, arraysize(kWebViewRegisteredMethods)); | 38 kWebViewRegisteredMethods, arraysize(kWebViewRegisteredMethods)); |
45 } | 39 } |
46 | 40 |
47 } // namespace android_webview | 41 } // namespace android_webview |
OLD | NEW |