OLD | NEW |
(Empty) | |
| 1 // Copyright (c) 2013 The Chromium Authors. All rights reserved. |
| 2 // Use of this source code is governed by a BSD-style license that can be |
| 3 // found in the LICENSE file. |
| 4 |
| 5 #ifndef ANDROID_WEBVIEW_NATIVE_AW_CONTENTS_CLIENT_BRIDGE_H_ |
| 6 #define ANDROID_WEBVIEW_NATIVE_AW_CONTENTS_CLIENT_BRIDGE_H_ |
| 7 |
| 8 #include <jni.h> |
| 9 |
| 10 #include "android_webview/browser/aw_certificate_error_handler_base.h" |
| 11 #include "base/android/jni_helper.h" |
| 12 #include "base/android/scoped_java_ref.h" |
| 13 #include "base/callback.h" |
| 14 #include "base/id_map.h" |
| 15 |
| 16 namespace net { |
| 17 class X509Certificate; |
| 18 } |
| 19 |
| 20 namespace android_webview { |
| 21 |
| 22 class AwContentsClientBridge : public AwCertificateErrorHandlerBase { |
| 23 public: |
| 24 AwContentsClientBridge(JNIEnv* env, jobject obj); |
| 25 virtual ~AwContentsClientBridge(); |
| 26 |
| 27 // AwCertificateErrorHandlerBase implementation |
| 28 virtual void AllowCertificateError(int cert_error, |
| 29 net::X509Certificate* cert, |
| 30 const GURL& request_url, |
| 31 const base::Callback<void(bool)>& callback, |
| 32 bool* cancel_request) OVERRIDE; |
| 33 |
| 34 // Methods called from Java. |
| 35 void ProceedSslError(JNIEnv* env, jobject obj, jboolean proceed, jint id); |
| 36 |
| 37 private: |
| 38 JavaObjectWeakGlobalRef java_ref_; |
| 39 |
| 40 typedef const base::Callback<void(bool)> CertErrorCallback; |
| 41 IDMap<CertErrorCallback, IDMapOwnPointer> pending_cert_error_callbacks_; |
| 42 }; |
| 43 |
| 44 bool RegisterAwContentsClientBridge(JNIEnv* env); |
| 45 |
| 46 } // namespace android_webview |
| 47 |
| 48 #endif // ANDROID_WEBVIEW_NATIVE_AW_CONTENTS_CLIENT_BRIDGE_H_ |
OLD | NEW |