OLD | NEW |
1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. | 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 | 2 // Use of this source code is governed by a BSD-style license that can be |
3 // found in the LICENSE file. | 3 // found in the LICENSE file. |
4 | 4 |
5 #include "android_webview/lib/main/aw_main_delegate.h" | 5 #include "android_webview/lib/main/aw_main_delegate.h" |
6 #include "android_webview/native/android_webview_jni_registrar.h" | 6 #include "android_webview/native/android_webview_jni_registrar.h" |
7 #include "base/android/jni_android.h" | 7 #include "base/android/jni_android.h" |
8 #include "base/android/jni_registrar.h" | 8 #include "base/android/jni_registrar.h" |
9 #include "base/android/jni_utils.h" | |
10 #include "base/android/library_loader/library_loader_hooks.h" | 9 #include "base/android/library_loader/library_loader_hooks.h" |
11 #include "components/navigation_interception/component_jni_registrar.h" | 10 #include "components/navigation_interception/component_jni_registrar.h" |
12 #include "components/web_contents_delegate_android/component_jni_registrar.h" | 11 #include "components/web_contents_delegate_android/component_jni_registrar.h" |
13 #include "content/public/app/android_library_loader_hooks.h" | 12 #include "content/public/app/android_library_loader_hooks.h" |
14 #include "content/public/app/content_main.h" | 13 #include "content/public/app/content_main.h" |
15 #include "url/url_util.h" | 14 #include "url/url_util.h" |
16 | 15 |
17 static base::android::RegistrationMethod | 16 static base::android::RegistrationMethod |
18 kWebViewDependencyRegisteredMethods[] = { | 17 kWebViewDependencyRegisteredMethods[] = { |
19 { "NavigationInterception", | 18 { "NavigationInterception", |
(...skipping 21 matching lines...) Expand all Loading... |
41 // Register JNI for components we depend on. | 40 // Register JNI for components we depend on. |
42 if (!RegisterNativeMethods( | 41 if (!RegisterNativeMethods( |
43 env, | 42 env, |
44 kWebViewDependencyRegisteredMethods, | 43 kWebViewDependencyRegisteredMethods, |
45 arraysize(kWebViewDependencyRegisteredMethods))) | 44 arraysize(kWebViewDependencyRegisteredMethods))) |
46 return -1; | 45 return -1; |
47 | 46 |
48 if (!android_webview::RegisterJni(env)) | 47 if (!android_webview::RegisterJni(env)) |
49 return -1; | 48 return -1; |
50 | 49 |
51 base::android::InitReplacementClassLoader(env, | |
52 base::android::GetClassLoader(env)); | |
53 | |
54 content::SetContentMainDelegate(new android_webview::AwMainDelegate()); | 50 content::SetContentMainDelegate(new android_webview::AwMainDelegate()); |
55 | 51 |
56 // Initialize url lib here while we are still single-threaded, in case we use | 52 // Initialize url lib here while we are still single-threaded, in case we use |
57 // CookieManager before initializing Chromium (which would normally have done | 53 // CookieManager before initializing Chromium (which would normally have done |
58 // this). It's safe to call this multiple times. | 54 // this). It's safe to call this multiple times. |
59 url::Initialize(); | 55 url::Initialize(); |
60 | 56 |
61 return JNI_VERSION_1_4; | 57 return JNI_VERSION_1_4; |
62 } | 58 } |
OLD | NEW |