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
3 // found in the LICENSE file.
5 #include "android_webview/native/android_webview_jni_registrar.h"
7 #include "android_webview/native/android_protocol_handler.h"
8 #include "android_webview/native/aw_autofill_client.h"
9 #include "android_webview/native/aw_contents.h"
10 #include "android_webview/native/aw_contents_client_bridge.h"
11 #include "android_webview/native/aw_contents_io_thread_client_impl.h"
12 #include "android_webview/native/aw_contents_statics.h"
13 #include "android_webview/native/aw_dev_tools_server.h"
14 #include "android_webview/native/aw_form_database.h"
15 #include "android_webview/native/aw_http_auth_handler.h"
16 #include "android_webview/native/aw_message_port_service_impl.h"
17 #include "android_webview/native/aw_pdf_exporter.h"
18 #include "android_webview/native/aw_picture.h"
19 #include "android_webview/native/aw_quota_manager_bridge_impl.h"
20 #include "android_webview/native/aw_resource.h"
21 #include "android_webview/native/aw_settings.h"
22 #include "android_webview/native/aw_web_contents_delegate.h"
23 #include "android_webview/native/aw_web_resource_response_impl.h"
24 #include "android_webview/native/aw_webview_lifecycle_observer.h"
25 #include "android_webview/native/cookie_manager.h"
26 #include "android_webview/native/input_stream_impl.h"
27 #include "android_webview/native/java_browser_view_renderer_helper.h"
28 #include "android_webview/native/permission/aw_permission_request.h"
29 #include "base/android/jni_android.h"
30 #include "base/android/jni_registrar.h"
31 #include "base/trace_event/trace_event.h"
33 namespace android_webview
{
35 static base::android::RegistrationMethod kWebViewRegisteredMethods
[] = {
36 // Register JNI for android_webview classes.
37 { "AndroidProtocolHandler", RegisterAndroidProtocolHandler
},
38 { "AwAutofillClient", RegisterAwAutofillClient
},
39 { "AwContents", RegisterAwContents
},
40 { "AwContentsClientBridge", RegisterAwContentsClientBridge
},
41 { "AwContentsIoThreadClientImpl", RegisterAwContentsIoThreadClientImpl
},
42 { "AwContentsStatics", RegisterAwContentsStatics
},
43 { "AwDevToolsServer", RegisterAwDevToolsServer
},
44 { "AwFormDatabase", RegisterAwFormDatabase
},
45 { "AwPicture", RegisterAwPicture
},
46 { "AwSettings", RegisterAwSettings
},
47 { "AwHttpAuthHandler", RegisterAwHttpAuthHandler
},
48 { "AwPdfExporter", RegisterAwPdfExporter
},
49 { "AwPermissionRequest", RegisterAwPermissionRequest
},
50 { "AwQuotaManagerBridge", RegisterAwQuotaManagerBridge
},
51 { "AwResource", AwResource::RegisterAwResource
},
52 { "AwWebContentsDelegate", RegisterAwWebContentsDelegate
},
53 { "CookieManager", RegisterCookieManager
},
54 { "AwWebResourceResponseImpl", RegisterAwWebResourceResponse
},
55 { "InputStream", RegisterInputStream
},
56 { "JavaBrowserViewRendererHelper", RegisterJavaBrowserViewRendererHelper
},
57 { "AwMessagePortService", RegisterAwMessagePortService
},
58 { "AwWebViewLifecycleObserver", RegisterAwWebViewLifecycleObserver
},
61 bool RegisterJni(JNIEnv
* env
) {
62 TRACE_EVENT0("startup", "android_webview::RegisterJni");
63 return RegisterNativeMethods(env
,
64 kWebViewRegisteredMethods
, arraysize(kWebViewRegisteredMethods
));
67 } // namespace android_webview