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 36 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
47 const GURL& origin_url, | 47 const GURL& origin_url, |
48 const base::string16& message_text, | 48 const base::string16& message_text, |
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 bool ShouldOverrideUrlLoading(const base::string16& url, | |
58 bool has_user_gesture, | |
59 bool is_redirect) override; | |
60 | 57 |
61 // Methods called from Java. | 58 // Methods called from Java. |
62 void ProceedSslError(JNIEnv* env, jobject obj, jboolean proceed, jint id); | 59 void ProceedSslError(JNIEnv* env, jobject obj, jboolean proceed, jint id); |
63 void ProvideClientCertificateResponse(JNIEnv* env, jobject object, | 60 void ProvideClientCertificateResponse(JNIEnv* env, jobject object, |
64 jint request_id, jobjectArray encoded_chain_ref, | 61 jint request_id, jobjectArray encoded_chain_ref, |
65 jobject private_key_ref); | 62 jobject private_key_ref); |
66 void ConfirmJsResult(JNIEnv*, jobject, int id, jstring prompt); | 63 void ConfirmJsResult(JNIEnv*, jobject, int id, jstring prompt); |
67 void CancelJsResult(JNIEnv*, jobject, int id); | 64 void CancelJsResult(JNIEnv*, jobject, int id); |
68 | 65 |
69 private: | 66 private: |
70 void HandleErrorInClientCertificateResponse(int id); | 67 void HandleErrorInClientCertificateResponse(int id); |
71 | 68 |
72 JavaObjectWeakGlobalRef java_ref_; | 69 JavaObjectWeakGlobalRef java_ref_; |
73 | 70 |
74 typedef const base::Callback<void(bool)> CertErrorCallback; | 71 typedef const base::Callback<void(bool)> CertErrorCallback; |
75 IDMap<CertErrorCallback, IDMapOwnPointer> pending_cert_error_callbacks_; | 72 IDMap<CertErrorCallback, IDMapOwnPointer> pending_cert_error_callbacks_; |
76 IDMap<content::JavaScriptDialogManager::DialogClosedCallback, IDMapOwnPointer> | 73 IDMap<content::JavaScriptDialogManager::DialogClosedCallback, IDMapOwnPointer> |
77 pending_js_dialog_callbacks_; | 74 pending_js_dialog_callbacks_; |
78 // |pending_client_cert_request_delegates_| owns its pointers, but IDMap | 75 // |pending_client_cert_request_delegates_| owns its pointers, but IDMap |
79 // doesn't provide Release, so ownership is managed manually. | 76 // doesn't provide Release, so ownership is managed manually. |
80 IDMap<content::ClientCertificateDelegate> | 77 IDMap<content::ClientCertificateDelegate> |
81 pending_client_cert_request_delegates_; | 78 pending_client_cert_request_delegates_; |
82 }; | 79 }; |
83 | 80 |
84 bool RegisterAwContentsClientBridge(JNIEnv* env); | 81 bool RegisterAwContentsClientBridge(JNIEnv* env); |
85 | 82 |
86 } // namespace android_webview | 83 } // namespace android_webview |
87 | 84 |
88 #endif // ANDROID_WEBVIEW_NATIVE_AW_CONTENTS_CLIENT_BRIDGE_H_ | 85 #endif // ANDROID_WEBVIEW_NATIVE_AW_CONTENTS_CLIENT_BRIDGE_H_ |
OLD | NEW |