Chromium Code Reviews| 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_CERTIFICATE_ERROR_HANDLER_BASE_H_ | |
| 6 #define ANDROID_WEBVIEW_BROWSER_AW_CERTIFICATE_ERROR_HANDLER_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 AwCertificateErrorHandler, which is implemented | |
| 24 // in the native/ layer, due to layering. The implementor of the base class | |
| 25 // plumbs the request to the Java side and eventually to the webviewclient. This | |
| 26 // layering hides the details of native/ from browser/ layer. | |
| 27 class AwCertificateErrorHandlerBase { | |
|
joth
2013/02/22 23:12:41
I thought we agreed to expand this to being a AwCo
sgurun-gerrit only
2013/02/23 00:16:14
unintentional. just forgotten.
On 2013/02/22 23:1
| |
| 28 public: | |
| 29 static AwCertificateErrorHandlerBase* FromID(int render_process_id, | |
| 30 int render_view_id); | |
| 31 | |
| 32 // This class is invented so that the UserData registry that we inject the | |
| 33 // AwCertificateErrorHandlerBase object does now own and destroy it. | |
| 34 class UserData : public base::SupportsUserData::Data { | |
|
joth
2013/02/22 23:12:41
Lets make this class internal to the .cc file.
Ju
sgurun-gerrit only
2013/02/23 00:16:14
Sure. FromID is a already established name though,
| |
| 35 public: | |
| 36 static const void* kAwCertificateErrorHandlerBase; | |
| 37 static AwCertificateErrorHandlerBase* GetContents( | |
| 38 content::WebContents* web_contents); | |
| 39 | |
| 40 explicit UserData(AwCertificateErrorHandlerBase* ptr); | |
| 41 private: | |
| 42 AwCertificateErrorHandlerBase* contents_; | |
| 43 | |
| 44 DISALLOW_COPY_AND_ASSIGN(UserData); | |
| 45 }; | |
| 46 | |
| 47 virtual ~AwCertificateErrorHandlerBase(); | |
| 48 | |
| 49 virtual void AllowCertificateError(int cert_error, | |
| 50 net::X509Certificate* cert, | |
| 51 const GURL& request_url, | |
| 52 const base::Callback<void(bool)>& callback, | |
| 53 bool* cancel_request) = 0; | |
| 54 }; | |
| 55 | |
| 56 } // namespace android_webview | |
| 57 | |
| 58 #endif // ANDROID_WEBVIEW_BROWSER_AW_CERTIFICATE_ERROR_HANDLER_BASE_H_ | |
| OLD | NEW |