| Index: android_webview/native/aw_contents_client_bridge.cc
|
| diff --git a/android_webview/native/aw_contents_client_bridge.cc b/android_webview/native/aw_contents_client_bridge.cc
|
| index efb5a8516312a64b05e03c2e900fd6132fe3787d..a241e409f12a36cd397e528f1ed150a32e41613d 100644
|
| --- a/android_webview/native/aw_contents_client_bridge.cc
|
| +++ b/android_webview/native/aw_contents_client_bridge.cc
|
| @@ -5,11 +5,15 @@
|
| #include "android_webview/native/aw_contents_client_bridge.h"
|
|
|
| #include "android_webview/common/devtools_instrumentation.h"
|
| +#include "android_webview/native/aw_contents.h"
|
| #include "base/android/jni_android.h"
|
| #include "base/android/jni_array.h"
|
| #include "base/android/jni_string.h"
|
| #include "base/callback_helpers.h"
|
| #include "content/public/browser/browser_thread.h"
|
| +#include "content/public/browser/render_process_host.h"
|
| +#include "content/public/browser/render_view_host.h"
|
| +#include "content/public/browser/web_contents.h"
|
| #include "jni/AwContentsClientBridge_jni.h"
|
| #include "net/android/keystore_openssl.h"
|
| #include "net/cert/x509_certificate.h"
|
| @@ -42,6 +46,15 @@ void RecordClientCertificateKey(
|
| client_cert.get(), private_key.get());
|
| }
|
|
|
| +void CancelGeolocationPermission(int render_process_id,
|
| + int render_view_id,
|
| + const GURL& requesting_frame) {
|
| + AwContents* aw_contents = AwContents::FromID(
|
| + render_process_id, render_view_id);
|
| + if (aw_contents)
|
| + aw_contents->HideGeolocationPrompt(requesting_frame);
|
| +}
|
| +
|
| } // namespace
|
|
|
| AwContentsClientBridge::AwContentsClientBridge(JNIEnv* env, jobject obj)
|
| @@ -336,6 +349,28 @@ bool AwContentsClientBridge::ShouldOverrideUrlLoading(
|
| jurl.obj());
|
| }
|
|
|
| +void AwContentsClientBridge::RequestGeolocationPermission(
|
| + content::WebContents* web_contents,
|
| + const GURL& requesting_frame,
|
| + base::Callback<void(bool)> result_callback,
|
| + base::Closure* cancel_callback) {
|
| + AwContents* aw_contents = AwContents::FromWebContents(web_contents);
|
| + if (!aw_contents) {
|
| + result_callback.Run(false);
|
| + return;
|
| + }
|
| +
|
| + if (cancel_callback) {
|
| + *cancel_callback = base::Bind(
|
| + CancelGeolocationPermission,
|
| + web_contents->GetRenderProcessHost()->GetID(),
|
| + web_contents->GetRenderViewHost()->GetRoutingID(),
|
| + requesting_frame);
|
| + }
|
| +
|
| + aw_contents->ShowGeolocationPrompt(requesting_frame, result_callback);
|
| +}
|
| +
|
| void AwContentsClientBridge::ConfirmJsResult(JNIEnv* env,
|
| jobject,
|
| int id,
|
|
|