| 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_autofill_client.h" | 8 #include "android_webview/native/aw_autofill_client.h" |
| 9 #include "android_webview/native/aw_contents.h" | 9 #include "android_webview/native/aw_contents.h" |
| 10 #include "android_webview/native/aw_contents_client_bridge.h" | 10 #include "android_webview/native/aw_contents_client_bridge.h" |
| 11 #include "android_webview/native/aw_contents_statics.h" | 11 #include "android_webview/native/aw_contents_statics.h" |
| 12 #include "android_webview/native/aw_debug.h" | 12 #include "android_webview/native/aw_debug.h" |
| 13 #include "android_webview/native/aw_devtools_server.h" | 13 #include "android_webview/native/aw_devtools_server.h" |
| 14 #include "android_webview/native/aw_form_database.h" | 14 #include "android_webview/native/aw_form_database.h" |
| 15 #include "android_webview/native/aw_gl_functor.h" | 15 #include "android_webview/native/aw_gl_functor.h" |
| 16 #include "android_webview/native/aw_http_auth_handler.h" | 16 #include "android_webview/native/aw_http_auth_handler.h" |
| 17 #include "android_webview/native/aw_metrics_switch.h" | 17 #include "android_webview/native/aw_metrics_switch.h" |
| 18 #include "android_webview/native/aw_pdf_exporter.h" | 18 #include "android_webview/native/aw_pdf_exporter.h" |
| 19 #include "android_webview/native/aw_picture.h" | 19 #include "android_webview/native/aw_picture.h" |
| 20 #include "android_webview/native/aw_quota_manager_bridge_impl.h" | 20 #include "android_webview/native/aw_quota_manager_bridge_impl.h" |
| 21 #include "android_webview/native/aw_settings.h" | 21 #include "android_webview/native/aw_settings.h" |
| 22 #include "android_webview/native/aw_web_contents_delegate.h" | 22 #include "android_webview/native/aw_web_contents_delegate.h" |
| 23 #include "android_webview/native/cookie_manager.h" | 23 #include "android_webview/native/cookie_manager.h" |
| 24 #include "android_webview/native/permission/aw_permission_request.h" | 24 #include "android_webview/native/permission/aw_permission_request.h" |
| 25 #include "base/android/jni_android.h" | 25 #include "base/android/jni_android.h" |
| 26 #include "base/android/jni_registrar.h" | 26 #include "base/android/jni_registrar.h" |
| 27 #include "base/trace_event/trace_event.h" | 27 #include "base/trace_event/trace_event.h" |
| 28 #include "components/spellcheck/spellcheck_build_features.h" |
| 28 | 29 |
| 29 #if defined(ENABLE_SPELLCHECK) | 30 #if BUILDFLAG(ENABLE_SPELLCHECK) |
| 30 #include "components/spellcheck/browser/android/component_jni_registrar.h" | 31 #include "components/spellcheck/browser/android/component_jni_registrar.h" |
| 31 #endif | 32 #endif |
| 32 | 33 |
| 33 namespace android_webview { | 34 namespace android_webview { |
| 34 | 35 |
| 35 static base::android::RegistrationMethod kWebViewRegisteredMethods[] = { | 36 static base::android::RegistrationMethod kWebViewRegisteredMethods[] = { |
| 36 // Register JNI for android_webview classes. | 37 // Register JNI for android_webview classes. |
| 37 { "AndroidProtocolHandler", RegisterAndroidProtocolHandler }, | 38 { "AndroidProtocolHandler", RegisterAndroidProtocolHandler }, |
| 38 { "AwAutofillClient", RegisterAwAutofillClient }, | 39 { "AwAutofillClient", RegisterAwAutofillClient }, |
| 39 { "AwContents", RegisterAwContents }, | 40 { "AwContents", RegisterAwContents }, |
| 40 { "AwContentsClientBridge", RegisterAwContentsClientBridge }, | 41 { "AwContentsClientBridge", RegisterAwContentsClientBridge }, |
| 41 { "AwContentsStatics", RegisterAwContentsStatics }, | 42 { "AwContentsStatics", RegisterAwContentsStatics }, |
| 42 { "AwDebug", RegisterAwDebug }, | 43 { "AwDebug", RegisterAwDebug }, |
| 43 { "AwDevToolsServer", RegisterAwDevToolsServer }, | 44 { "AwDevToolsServer", RegisterAwDevToolsServer }, |
| 44 { "AwFormDatabase", RegisterAwFormDatabase }, | 45 { "AwFormDatabase", RegisterAwFormDatabase }, |
| 45 { "AwPicture", RegisterAwPicture }, | 46 { "AwPicture", RegisterAwPicture }, |
| 46 { "AwSettings", RegisterAwSettings }, | 47 { "AwSettings", RegisterAwSettings }, |
| 47 { "AwHttpAuthHandler", RegisterAwHttpAuthHandler }, | 48 { "AwHttpAuthHandler", RegisterAwHttpAuthHandler }, |
| 48 { "AwMetricsServiceClient", RegisterAwMetricsServiceClient }, | 49 { "AwMetricsServiceClient", RegisterAwMetricsServiceClient }, |
| 49 { "AwPdfExporter", RegisterAwPdfExporter }, | 50 { "AwPdfExporter", RegisterAwPdfExporter }, |
| 50 { "AwPermissionRequest", RegisterAwPermissionRequest }, | 51 { "AwPermissionRequest", RegisterAwPermissionRequest }, |
| 51 { "AwQuotaManagerBridge", RegisterAwQuotaManagerBridge }, | 52 { "AwQuotaManagerBridge", RegisterAwQuotaManagerBridge }, |
| 52 { "AwWebContentsDelegate", RegisterAwWebContentsDelegate }, | 53 { "AwWebContentsDelegate", RegisterAwWebContentsDelegate }, |
| 53 { "CookieManager", RegisterCookieManager }, | 54 { "CookieManager", RegisterCookieManager }, |
| 54 { "AwGLFunctor", RegisterAwGLFunctor }, | 55 { "AwGLFunctor", RegisterAwGLFunctor }, |
| 55 #if defined(ENABLE_SPELLCHECK) | 56 #if BUILDFLAG(ENABLE_SPELLCHECK) |
| 56 {"SpellCheckerSessionBridge", spellcheck::android::RegisterSpellcheckJni}, | 57 {"SpellCheckerSessionBridge", spellcheck::android::RegisterSpellcheckJni}, |
| 57 #endif | 58 #endif |
| 58 }; | 59 }; |
| 59 | 60 |
| 60 bool RegisterJni(JNIEnv* env) { | 61 bool RegisterJni(JNIEnv* env) { |
| 61 TRACE_EVENT0("startup", "android_webview::RegisterJni"); | 62 TRACE_EVENT0("startup", "android_webview::RegisterJni"); |
| 62 return RegisterNativeMethods(env, | 63 return RegisterNativeMethods(env, |
| 63 kWebViewRegisteredMethods, arraysize(kWebViewRegisteredMethods)); | 64 kWebViewRegisteredMethods, arraysize(kWebViewRegisteredMethods)); |
| 64 } | 65 } |
| 65 | 66 |
| 66 } // namespace android_webview | 67 } // namespace android_webview |
| OLD | NEW |