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 "xwalk/runtime/app/android/xwalk_jni_registrar.h"
7 #include "base/android/jni_android.h"
8 #include "base/android/jni_registrar.h"
9 #include "components/navigation_interception/component_jni_registrar.h"
10 #include "components/web_contents_delegate_android/component_jni_registrar.h"
11 #include "xwalk/extensions/common/android/xwalk_extension_android.h"
12 #include "xwalk/runtime/browser/android/cookie_manager.h"
13 #include "xwalk/runtime/browser/android/intercepted_request_data_impl.h"
14 #include "xwalk/runtime/browser/android/net/android_protocol_handler.h"
15 #include "xwalk/runtime/browser/android/net/input_stream_impl.h"
16 #include "xwalk/runtime/browser/android/xwalk_content.h"
17 #include "xwalk/runtime/browser/android/xwalk_contents_client_bridge.h"
18 #include "xwalk/runtime/browser/android/xwalk_contents_io_thread_client_impl.h"
19 #include "xwalk/runtime/browser/android/xwalk_dev_tools_server.h"
20 #include "xwalk/runtime/browser/android/xwalk_http_auth_handler.h"
21 #include "xwalk/runtime/browser/android/xwalk_settings.h"
22 #include "xwalk/runtime/browser/android/xwalk_web_contents_delegate.h"
26 static base::android::RegistrationMethod kXWalkRegisteredMethods[] = {
27 // Register JNI for xwalk classes.
28 { "AndroidProtocolHandler", RegisterAndroidProtocolHandler },
29 { "CookieManager", RegisterCookieManager },
30 { "InputStream", RegisterInputStream },
31 { "InterceptedRequestDataImpl", RegisterInterceptedRequestData },
32 { "NavigationInterception",
33 navigation_interception::RegisterNavigationInterceptionJni },
34 { "WebContentsDelegateAndroid",
35 web_contents_delegate_android::RegisterWebContentsDelegateAndroidJni },
36 { "XWalkContentsClientBridge", RegisterXWalkContentsClientBridge },
37 { "XWalkContentsIoThreadClientImpl",
38 RegisterXWalkContentsIoThreadClientImpl },
39 { "XWalkContent", RegisterXWalkContent },
40 { "XWalkDevToolsServer", RegisterXWalkDevToolsServer },
41 { "XWalkExtensionAndroid", extensions::RegisterXWalkExtensionAndroid },
42 { "XWalkHttpAuthHandler", RegisterXWalkHttpAuthHandler },
43 { "XWalkSettings", RegisterXWalkSettings },
44 { "XWalkWebContentsDelegate", RegisterXWalkWebContentsDelegate },
47 bool RegisterJni(JNIEnv* env) {
48 return RegisterNativeMethods(env,
49 kXWalkRegisteredMethods, arraysize(kXWalkRegisteredMethods));