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/cookie_manager.h"
25 #include "android_webview/native/external_video_surface_container_impl.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 "android_webview/native/public/aw_assets.h"
30 #include "base/android/jni_android.h"
31 #include "base/android/jni_registrar.h"
32 #include "base/trace_event/trace_event.h"
34 namespace android_webview
{
36 static base::android::RegistrationMethod kWebViewRegisteredMethods
[] = {
37 // Register JNI for android_webview classes.
38 { "AndroidProtocolHandler", RegisterAndroidProtocolHandler
},
39 { "AwAutofillClient", RegisterAwAutofillClient
},
40 { "AwAssets", RegisterAwAssets
},
41 { "AwContents", RegisterAwContents
},
42 { "AwContentsClientBridge", RegisterAwContentsClientBridge
},
43 { "AwContentsIoThreadClientImpl", RegisterAwContentsIoThreadClientImpl
},
44 { "AwContentsStatics", RegisterAwContentsStatics
},
45 { "AwDevToolsServer", RegisterAwDevToolsServer
},
46 { "AwFormDatabase", RegisterAwFormDatabase
},
47 { "AwPicture", RegisterAwPicture
},
48 { "AwSettings", RegisterAwSettings
},
49 { "AwHttpAuthHandler", RegisterAwHttpAuthHandler
},
50 { "AwPdfExporter", RegisterAwPdfExporter
},
51 { "AwPermissionRequest", RegisterAwPermissionRequest
},
52 { "AwQuotaManagerBridge", RegisterAwQuotaManagerBridge
},
53 { "AwResource", AwResource::RegisterAwResource
},
54 { "AwWebContentsDelegate", RegisterAwWebContentsDelegate
},
55 { "CookieManager", RegisterCookieManager
},
56 #if defined(VIDEO_HOLE)
57 { "ExternalVideoSurfaceContainer", RegisterExternalVideoSurfaceContainer
},
59 { "AwWebResourceResponseImpl", RegisterAwWebResourceResponse
},
60 { "InputStream", RegisterInputStream
},
61 { "JavaBrowserViewRendererHelper", RegisterJavaBrowserViewRendererHelper
},
62 { "AwMessagePortService", RegisterAwMessagePortService
},
65 bool RegisterJni(JNIEnv
* env
) {
66 TRACE_EVENT0("startup", "android_webview::RegisterJni");
67 return RegisterNativeMethods(env
,
68 kWebViewRegisteredMethods
, arraysize(kWebViewRegisteredMethods
));
71 } // namespace android_webview