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

Unified Diff: android_webview/native/aw_contents_client_bridge.h

Issue 12091111: Implement Webviewclient.onReceivedSslError (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: add a bridge for aw_contents_client Created 7 years, 10 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 side-by-side diff with in-line comments
Download patch
Index: android_webview/native/aw_contents_client_bridge.h
diff --git a/android_webview/native/aw_contents_client_bridge.h b/android_webview/native/aw_contents_client_bridge.h
new file mode 100644
index 0000000000000000000000000000000000000000..e8aedd6860d1065aac3fff9a213bbd8ba2aaefd3
--- /dev/null
+++ b/android_webview/native/aw_contents_client_bridge.h
@@ -0,0 +1,48 @@
+// Copyright (c) 2013 The Chromium Authors. All rights reserved.
+// Use of this source code is governed by a BSD-style license that can be
+// found in the LICENSE file.
+
+#ifndef ANDROID_WEBVIEW_NATIVE_AW_CONTENTS_CLIENT_BRIDGE_H_
+#define ANDROID_WEBVIEW_NATIVE_AW_CONTENTS_CLIENT_BRIDGE_H_
+
+#include <jni.h>
+
+#include "android_webview/browser/aw_certificate_error_handler_base.h"
+#include "base/android/jni_helper.h"
+#include "base/android/scoped_java_ref.h"
+#include "base/callback.h"
+#include "base/id_map.h"
+
+namespace net {
+class X509Certificate;
+}
+
+namespace android_webview {
+
+class AwContentsClientBridge : public AwCertificateErrorHandlerBase {
+ public:
+ AwContentsClientBridge(JNIEnv* env, jobject obj);
+ virtual ~AwContentsClientBridge();
+
+ // AwCertificateErrorHandlerBase implementation
+ virtual void AllowCertificateError(int cert_error,
+ net::X509Certificate* cert,
+ const GURL& request_url,
+ const base::Callback<void(bool)>& callback,
+ bool* cancel_request) OVERRIDE;
+
+ // Methods called from Java.
+ void ProceedSslError(JNIEnv* env, jobject obj, jboolean proceed, jint id);
+
+ private:
+ JavaObjectWeakGlobalRef java_ref_;
+
+ typedef const base::Callback<void(bool)> CertErrorCallback;
+ IDMap<CertErrorCallback, IDMapOwnPointer> pending_cert_error_callbacks_;
+};
+
+bool RegisterAwContentsClientBridge(JNIEnv* env);
+
+} // namespace android_webview
+
+#endif // ANDROID_WEBVIEW_NATIVE_AW_CONTENTS_CLIENT_BRIDGE_H_

Powered by Google App Engine
This is Rietveld 408576698