OLD | NEW |
1 // Copyright (c) 2013 The Chromium Authors. All rights reserved. | 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 | 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 #ifndef ANDROID_WEBVIEW_NATIVE_AW_CONTENTS_CLIENT_BRIDGE_H_ | 5 #ifndef ANDROID_WEBVIEW_NATIVE_AW_CONTENTS_CLIENT_BRIDGE_H_ |
6 #define ANDROID_WEBVIEW_NATIVE_AW_CONTENTS_CLIENT_BRIDGE_H_ | 6 #define ANDROID_WEBVIEW_NATIVE_AW_CONTENTS_CLIENT_BRIDGE_H_ |
7 | 7 |
8 #include <jni.h> | 8 #include <jni.h> |
9 | 9 |
10 #include "android_webview/browser/aw_contents_client_bridge_base.h" | 10 #include "android_webview/browser/aw_contents_client_bridge_base.h" |
(...skipping 38 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
49 const base::string16& default_prompt_text, | 49 const base::string16& default_prompt_text, |
50 const content::JavaScriptDialogManager::DialogClosedCallback& callback) | 50 const content::JavaScriptDialogManager::DialogClosedCallback& callback) |
51 override; | 51 override; |
52 void RunBeforeUnloadDialog( | 52 void RunBeforeUnloadDialog( |
53 const GURL& origin_url, | 53 const GURL& origin_url, |
54 const base::string16& message_text, | 54 const base::string16& message_text, |
55 const content::JavaScriptDialogManager::DialogClosedCallback& callback) | 55 const content::JavaScriptDialogManager::DialogClosedCallback& callback) |
56 override; | 56 override; |
57 | 57 |
58 // Methods called from Java. | 58 // Methods called from Java. |
59 void ProceedSslError(JNIEnv* env, jobject obj, jboolean proceed, jint id); | 59 void ProceedSslError(JNIEnv* env, |
60 void ProvideClientCertificateResponse(JNIEnv* env, jobject object, | 60 const base::android::JavaRef<jobject>& obj, |
61 jint request_id, jobjectArray encoded_chain_ref, | 61 jboolean proceed, |
62 jobject private_key_ref); | 62 jint id); |
63 void ConfirmJsResult(JNIEnv*, jobject, int id, jstring prompt); | 63 void ProvideClientCertificateResponse( |
64 void CancelJsResult(JNIEnv*, jobject, int id); | 64 JNIEnv* env, |
| 65 const base::android::JavaRef<jobject>& object, |
| 66 jint request_id, |
| 67 const base::android::JavaRef<jobjectArray>& encoded_chain_ref, |
| 68 const base::android::JavaRef<jobject>& private_key_ref); |
| 69 void ConfirmJsResult(JNIEnv*, |
| 70 const base::android::JavaRef<jobject>&, |
| 71 int id, |
| 72 const base::android::JavaRef<jstring>& prompt); |
| 73 void CancelJsResult(JNIEnv*, const base::android::JavaRef<jobject>&, int id); |
65 | 74 |
66 private: | 75 private: |
67 void HandleErrorInClientCertificateResponse(int id); | 76 void HandleErrorInClientCertificateResponse(int id); |
68 | 77 |
69 JavaObjectWeakGlobalRef java_ref_; | 78 JavaObjectWeakGlobalRef java_ref_; |
70 | 79 |
71 typedef const base::Callback<void(bool)> CertErrorCallback; | 80 typedef const base::Callback<void(bool)> CertErrorCallback; |
72 IDMap<CertErrorCallback, IDMapOwnPointer> pending_cert_error_callbacks_; | 81 IDMap<CertErrorCallback, IDMapOwnPointer> pending_cert_error_callbacks_; |
73 IDMap<content::JavaScriptDialogManager::DialogClosedCallback, IDMapOwnPointer> | 82 IDMap<content::JavaScriptDialogManager::DialogClosedCallback, IDMapOwnPointer> |
74 pending_js_dialog_callbacks_; | 83 pending_js_dialog_callbacks_; |
75 // |pending_client_cert_request_delegates_| owns its pointers, but IDMap | 84 // |pending_client_cert_request_delegates_| owns its pointers, but IDMap |
76 // doesn't provide Release, so ownership is managed manually. | 85 // doesn't provide Release, so ownership is managed manually. |
77 IDMap<content::ClientCertificateDelegate> | 86 IDMap<content::ClientCertificateDelegate> |
78 pending_client_cert_request_delegates_; | 87 pending_client_cert_request_delegates_; |
79 }; | 88 }; |
80 | 89 |
81 bool RegisterAwContentsClientBridge(JNIEnv* env); | 90 bool RegisterAwContentsClientBridge(JNIEnv* env); |
82 | 91 |
83 } // namespace android_webview | 92 } // namespace android_webview |
84 | 93 |
85 #endif // ANDROID_WEBVIEW_NATIVE_AW_CONTENTS_CLIENT_BRIDGE_H_ | 94 #endif // ANDROID_WEBVIEW_NATIVE_AW_CONTENTS_CLIENT_BRIDGE_H_ |
OLD | NEW |