Upstream version 6.35.131.0
[platform/framework/web/crosswalk.git] / src / xwalk / runtime / app / android / xwalk_jni_registrar.cc
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.
4
5 #include "xwalk/runtime/app/android/xwalk_jni_registrar.h"
6
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_view_delegate.h"
23 #include "xwalk/runtime/browser/android/xwalk_web_contents_delegate.h"
24
25 namespace xwalk {
26
27 static base::android::RegistrationMethod kXWalkRegisteredMethods[] = {
28   // Register JNI for xwalk classes.
29   { "AndroidProtocolHandler", RegisterAndroidProtocolHandler },
30   { "CookieManager", RegisterCookieManager },
31   { "InputStream", RegisterInputStream },
32   { "InterceptedRequestDataImpl", RegisterInterceptedRequestData },
33   { "NavigationInterception",
34       navigation_interception::RegisterNavigationInterceptionJni },
35   { "WebContentsDelegateAndroid",
36       web_contents_delegate_android::RegisterWebContentsDelegateAndroidJni },
37   { "XWalkContentsClientBridge", RegisterXWalkContentsClientBridge },
38   { "XWalkContentsIoThreadClientImpl",
39       RegisterXWalkContentsIoThreadClientImpl },
40   { "XWalkContent", RegisterXWalkContent },
41   { "XWalkDevToolsServer", RegisterXWalkDevToolsServer },
42   { "XWalkExtensionAndroid", extensions::RegisterXWalkExtensionAndroid },
43   { "XWalkHttpAuthHandler", RegisterXWalkHttpAuthHandler },
44   { "XWalkSettings", RegisterXWalkSettings },
45   { "XWalkViewDelegate", RegisterXWalkViewDelegate },
46   { "XWalkWebContentsDelegate", RegisterXWalkWebContentsDelegate },
47 };
48
49 bool RegisterJni(JNIEnv* env) {
50   return RegisterNativeMethods(env,
51     kXWalkRegisteredMethods, arraysize(kXWalkRegisteredMethods));
52 }
53
54 }  // namespace xwalk