Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(115)

Side by Side Diff: android_webview/lib/main/webview_jni_onload.cc

Issue 1890203002: Implement Web Restrictions in WebView. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Respond to comments, and fix a possible race in displaying error page Created 4 years, 7 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
OLDNEW
1 // Copyright 2015 The Chromium Authors. All rights reserved. 1 // Copyright 2015 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/webview_jni_onload.h" 5 #include "android_webview/lib/main/webview_jni_onload.h"
6 6
7 #include "android_webview/common/aw_version_info_values.h" 7 #include "android_webview/common/aw_version_info_values.h"
8 #include "android_webview/lib/main/aw_main_delegate.h" 8 #include "android_webview/lib/main/aw_main_delegate.h"
9 #include "android_webview/native/android_webview_jni_registrar.h" 9 #include "android_webview/native/android_webview_jni_registrar.h"
10 #include "base/android/jni_android.h" 10 #include "base/android/jni_android.h"
11 #include "base/android/jni_registrar.h" 11 #include "base/android/jni_registrar.h"
12 #include "base/android/library_loader/library_loader_hooks.h" 12 #include "base/android/library_loader/library_loader_hooks.h"
13 #include "base/bind.h" 13 #include "base/bind.h"
14 #include "components/external_video_surface/component_jni_registrar.h" 14 #include "components/external_video_surface/component_jni_registrar.h"
15 #include "components/navigation_interception/component_jni_registrar.h" 15 #include "components/navigation_interception/component_jni_registrar.h"
16 #include "components/web_contents_delegate_android/component_jni_registrar.h" 16 #include "components/web_contents_delegate_android/component_jni_registrar.h"
17 #include "components/web_restrictions/browser/web_restrictions_client.h"
18 #include "components/web_restrictions/browser/web_restrictions_client_result.h"
17 #include "content/public/app/content_jni_onload.h" 19 #include "content/public/app/content_jni_onload.h"
18 #include "content/public/app/content_main.h" 20 #include "content/public/app/content_main.h"
19 #include "url/url_util.h" 21 #include "url/url_util.h"
20 22
21 namespace android_webview { 23 namespace android_webview {
22 24
23 namespace { 25 namespace {
24 26
25 static base::android::RegistrationMethod 27 static base::android::RegistrationMethod
26 kWebViewDependencyRegisteredMethods[] = { 28 kWebViewDependencyRegisteredMethods[] = {
27 #if defined(VIDEO_HOLE) 29 #if defined(VIDEO_HOLE)
28 { "ExternalVideoSurfaceContainer", 30 { "ExternalVideoSurfaceContainer",
29 external_video_surface::RegisterExternalVideoSurfaceJni }, 31 external_video_surface::RegisterExternalVideoSurfaceJni },
30 #endif 32 #endif
31 { "NavigationInterception", 33 { "NavigationInterception",
32 navigation_interception::RegisterNavigationInterceptionJni }, 34 navigation_interception::RegisterNavigationInterceptionJni },
33 { "WebContentsDelegateAndroid", 35 { "WebContentsDelegateAndroid",
34 web_contents_delegate_android::RegisterWebContentsDelegateAndroidJni }, 36 web_contents_delegate_android::RegisterWebContentsDelegateAndroidJni },
37 { "WebRestrictionsClient",
38 web_restrictions::WebRestrictionsClient::Register},
39 { "WebRestrictionsResult",
40 web_restrictions::WebRestrictionsClientResult::Register},
35 }; 41 };
36 42
37 bool RegisterJNI(JNIEnv* env) { 43 bool RegisterJNI(JNIEnv* env) {
38 // Register JNI for components we depend on. 44 // Register JNI for components we depend on.
39 if (!RegisterNativeMethods( 45 if (!RegisterNativeMethods(
40 env, 46 env,
41 kWebViewDependencyRegisteredMethods, 47 kWebViewDependencyRegisteredMethods,
42 arraysize(kWebViewDependencyRegisteredMethods)) || 48 arraysize(kWebViewDependencyRegisteredMethods)) ||
43 !android_webview::RegisterJni(env)) { 49 !android_webview::RegisterJni(env)) {
44 return false; 50 return false;
(...skipping 20 matching lines...) Expand all
65 return content::android::OnJNIOnLoadRegisterJNI(vm, register_callbacks); 71 return content::android::OnJNIOnLoadRegisterJNI(vm, register_callbacks);
66 } 72 }
67 73
68 bool OnJNIOnLoadInit() { 74 bool OnJNIOnLoadInit() {
69 std::vector<base::android::InitCallback> init_callbacks; 75 std::vector<base::android::InitCallback> init_callbacks;
70 init_callbacks.push_back(base::Bind(&Init)); 76 init_callbacks.push_back(base::Bind(&Init));
71 return content::android::OnJNIOnLoadInit(init_callbacks); 77 return content::android::OnJNIOnLoadInit(init_callbacks);
72 } 78 }
73 79
74 } // android_webview 80 } // android_webview
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698