summaryrefslogtreecommitdiffstats
path: root/android_webview/lib/main/webview_entry_point.cc
diff options
context:
space:
mode:
Diffstat (limited to 'android_webview/lib/main/webview_entry_point.cc')
-rw-r--r--android_webview/lib/main/webview_entry_point.cc17
1 files changed, 17 insertions, 0 deletions
diff --git a/android_webview/lib/main/webview_entry_point.cc b/android_webview/lib/main/webview_entry_point.cc
index 567161e..a7338b1 100644
--- a/android_webview/lib/main/webview_entry_point.cc
+++ b/android_webview/lib/main/webview_entry_point.cc
@@ -5,9 +5,19 @@
#include "android_webview/lib/main/aw_main_delegate.h"
#include "android_webview/native/android_webview_jni_registrar.h"
#include "base/android/jni_android.h"
+#include "base/android/jni_registrar.h"
+#include "components/web_contents_delegate_android/component_jni_registrar.h"
+#include "content/components/navigation_interception/component_jni_registrar.h"
#include "content/public/app/android_library_loader_hooks.h"
#include "content/public/app/content_main.h"
+static base::android::RegistrationMethod
+kWebViewDependencyRegisteredMethods[] = {
+ { "NavigationInterception", content::RegisterNavigationInterceptionJni },
+ { "WebContentsDelegateAndroid",
+ components::RegisterWebContentsDelegateAndroidJni },
+};
+
// This is called by the VM when the shared library is first loaded.
// Most of the initialization is done in LibraryLoadedOnMainThread(), not here.
JNI_EXPORT jint JNI_OnLoad(JavaVM* vm, void* reserved) {
@@ -16,6 +26,13 @@ JNI_EXPORT jint JNI_OnLoad(JavaVM* vm, void* reserved) {
if (!content::RegisterLibraryLoaderEntryHook(env))
return -1;
+ // Register JNI for components we depend on.
+ if (!RegisterNativeMethods(
+ env,
+ kWebViewDependencyRegisteredMethods,
+ arraysize(kWebViewDependencyRegisteredMethods)))
+ return -1;
+
if (!android_webview::RegisterJni(env))
return -1;