| 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_BROWSER_AW_CONTENTS_CLIENT_BRIDGE_BASE_H_ | 5 #ifndef ANDROID_WEBVIEW_BROWSER_AW_CONTENTS_CLIENT_BRIDGE_BASE_H_ |
| 6 #define ANDROID_WEBVIEW_BROWSER_AW_CONTENTS_CLIENT_BRIDGE_BASE_H_ | 6 #define ANDROID_WEBVIEW_BROWSER_AW_CONTENTS_CLIENT_BRIDGE_BASE_H_ |
| 7 | 7 |
| 8 #include "base/memory/scoped_ptr.h" | 8 #include "base/memory/scoped_ptr.h" |
| 9 #include "base/supports_user_data.h" | 9 #include "base/supports_user_data.h" |
| 10 #include "content/public/browser/javascript_dialog_manager.h" | 10 #include "content/public/browser/javascript_dialog_manager.h" |
| (...skipping 17 matching lines...) Expand all Loading... |
| 28 // implementor of the base class plumbs the request to the Java side and | 28 // implementor of the base class plumbs the request to the Java side and |
| 29 // eventually to the webviewclient. This layering hides the details of | 29 // eventually to the webviewclient. This layering hides the details of |
| 30 // native/ from browser/ layer. | 30 // native/ from browser/ layer. |
| 31 class AwContentsClientBridgeBase { | 31 class AwContentsClientBridgeBase { |
| 32 public: | 32 public: |
| 33 // Adds the handler to the UserData registry. | 33 // Adds the handler to the UserData registry. |
| 34 static void Associate(content::WebContents* web_contents, | 34 static void Associate(content::WebContents* web_contents, |
| 35 AwContentsClientBridgeBase* handler); | 35 AwContentsClientBridgeBase* handler); |
| 36 static AwContentsClientBridgeBase* FromWebContents( | 36 static AwContentsClientBridgeBase* FromWebContents( |
| 37 content::WebContents* web_contents); | 37 content::WebContents* web_contents); |
| 38 static AwContentsClientBridgeBase* FromID(int render_process_id, |
| 39 int render_frame_id); |
| 38 | 40 |
| 39 virtual ~AwContentsClientBridgeBase(); | 41 virtual ~AwContentsClientBridgeBase(); |
| 40 | 42 |
| 41 virtual void AllowCertificateError(int cert_error, | 43 virtual void AllowCertificateError(int cert_error, |
| 42 net::X509Certificate* cert, | 44 net::X509Certificate* cert, |
| 43 const GURL& request_url, | 45 const GURL& request_url, |
| 44 const base::Callback<void(bool)>& callback, | 46 const base::Callback<void(bool)>& callback, |
| 45 bool* cancel_request) = 0; | 47 bool* cancel_request) = 0; |
| 46 virtual void SelectClientCertificate( | 48 virtual void SelectClientCertificate( |
| 47 net::SSLCertRequestInfo* cert_request_info, | 49 net::SSLCertRequestInfo* cert_request_info, |
| 48 scoped_ptr<content::ClientCertificateDelegate> delegate) = 0; | 50 scoped_ptr<content::ClientCertificateDelegate> delegate) = 0; |
| 49 | 51 |
| 50 virtual void RunJavaScriptDialog( | 52 virtual void RunJavaScriptDialog( |
| 51 content::JavaScriptMessageType message_type, | 53 content::JavaScriptMessageType message_type, |
| 52 const GURL& origin_url, | 54 const GURL& origin_url, |
| 53 const base::string16& message_text, | 55 const base::string16& message_text, |
| 54 const base::string16& default_prompt_text, | 56 const base::string16& default_prompt_text, |
| 55 const content::JavaScriptDialogManager::DialogClosedCallback& callback) | 57 const content::JavaScriptDialogManager::DialogClosedCallback& callback) |
| 56 = 0; | 58 = 0; |
| 57 | 59 |
| 58 virtual void RunBeforeUnloadDialog( | 60 virtual void RunBeforeUnloadDialog( |
| 59 const GURL& origin_url, | 61 const GURL& origin_url, |
| 60 const base::string16& message_text, | 62 const base::string16& message_text, |
| 61 const content::JavaScriptDialogManager::DialogClosedCallback& callback) | 63 const content::JavaScriptDialogManager::DialogClosedCallback& callback) |
| 62 = 0; | 64 = 0; |
| 65 |
| 66 virtual bool ShouldOverrideUrlLoading(const base::string16& url, |
| 67 bool has_user_gesture, |
| 68 bool is_redirect, |
| 69 bool is_main_frame) = 0; |
| 63 }; | 70 }; |
| 64 | 71 |
| 65 } // namespace android_webview | 72 } // namespace android_webview |
| 66 | 73 |
| 67 #endif // ANDROID_WEBVIEW_BROWSER_AW_CONTENTS_CLIENT_BRIDGE_BASE_H_ | 74 #endif // ANDROID_WEBVIEW_BROWSER_AW_CONTENTS_CLIENT_BRIDGE_BASE_H_ |
| OLD | NEW |