Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(611)

Unified Diff: android_webview/browser/aw_certificate_error_handler_base.h

Issue 12091111: Implement Webviewclient.onReceivedSslError (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: code review from joth Created 7 years, 10 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
Index: android_webview/browser/aw_certificate_error_handler_base.h
diff --git a/android_webview/browser/aw_certificate_error_handler_base.h b/android_webview/browser/aw_certificate_error_handler_base.h
new file mode 100644
index 0000000000000000000000000000000000000000..c4f51e37cfc7858659e65a18191dd6ddfb48cc3c
--- /dev/null
+++ b/android_webview/browser/aw_certificate_error_handler_base.h
@@ -0,0 +1,58 @@
+// Copyright (c) 2013 The Chromium Authors. All rights reserved.
+// Use of this source code is governed by a BSD-style license that can be
+// found in the LICENSE file.
+
+#ifndef ANDROID_WEBVIEW_BROWSER_AW_CERTIFICATE_ERROR_HANDLER_BASE_H_
+#define ANDROID_WEBVIEW_BROWSER_AW_CERTIFICATE_ERROR_HANDLER_BASE_H_
+
+#include "base/callback_forward.h"
+#include "base/supports_user_data.h"
+
+class GURL;
+
+namespace content {
+class WebContents;
+}
+
+namespace net {
+class X509Certificate;
+}
+
+namespace android_webview {
+
+// browser/ layer interface for AwCertificateErrorHandler, which is implemented
+// in the native/ layer, due to layering. The implementor of the base class
+// plumbs the request to the Java side and eventually to the webviewclient. This
+// layering hides the details of native/ from browser/ layer.
+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
+ public:
+ static AwCertificateErrorHandlerBase* FromID(int render_process_id,
+ int render_view_id);
+
+ // This class is invented so that the UserData registry that we inject the
+ // AwCertificateErrorHandlerBase object does now own and destroy it.
+ 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,
+ public:
+ static const void* kAwCertificateErrorHandlerBase;
+ static AwCertificateErrorHandlerBase* GetContents(
+ content::WebContents* web_contents);
+
+ explicit UserData(AwCertificateErrorHandlerBase* ptr);
+ private:
+ AwCertificateErrorHandlerBase* contents_;
+
+ DISALLOW_COPY_AND_ASSIGN(UserData);
+ };
+
+ virtual ~AwCertificateErrorHandlerBase();
+
+ virtual void AllowCertificateError(int cert_error,
+ net::X509Certificate* cert,
+ const GURL& request_url,
+ const base::Callback<void(bool)>& callback,
+ bool* cancel_request) = 0;
+};
+
+} // namespace android_webview
+
+#endif // ANDROID_WEBVIEW_BROWSER_AW_CERTIFICATE_ERROR_HANDLER_BASE_H_

Powered by Google App Engine
This is Rietveld 408576698