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_BROWSER_AW_CONTENTS_CLIENT_BRIDGE_BASE_H_ |
| 6 #define ANDROID_WEBVIEW_BROWSER_AW_CONTENTS_CLIENT_BRIDGE_BASE_H_ |
| 7 |
| 8 #include "base/callback_forward.h" |
| 9 #include "base/supports_user_data.h" |
| 10 |
| 11 class GURL; |
| 12 |
| 13 namespace content { |
| 14 class WebContents; |
| 15 } |
| 16 |
| 17 namespace net { |
| 18 class X509Certificate; |
| 19 } |
| 20 |
| 21 namespace android_webview { |
| 22 |
| 23 // browser/ layer interface for AwContensClientBridge, as DEPS prevents this |
| 24 // layer from depending on native/ where the implementation lives. The |
| 25 // implementor of the base class plumbs the request to the Java side and |
| 26 // eventually to the webviewclient. This layering hides the details of |
| 27 // native/ from browser/ layer. |
| 28 class AwContentsClientBridgeBase { |
| 29 public: |
| 30 // Adds the handler to the UserData registry. |
| 31 static void Associate(content::WebContents* web_contents, |
| 32 AwContentsClientBridgeBase* handler); |
| 33 static AwContentsClientBridgeBase* FromWebContents( |
| 34 content::WebContents* web_contents); |
| 35 static AwContentsClientBridgeBase* FromID(int render_process_id, |
| 36 int render_view_id); |
| 37 |
| 38 virtual ~AwContentsClientBridgeBase(); |
| 39 |
| 40 virtual void AllowCertificateError(int cert_error, |
| 41 net::X509Certificate* cert, |
| 42 const GURL& request_url, |
| 43 const base::Callback<void(bool)>& callback, |
| 44 bool* cancel_request) = 0; |
| 45 }; |
| 46 |
| 47 } // namespace android_webview |
| 48 |
| 49 #endif // ANDROID_WEBVIEW_BROWSER_AW_CONTENTS_CLIENT_BRIDGE_BASE_H_ |
OLD | NEW |