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