Index: android_webview/native/aw_certificate_error_handler_base.cc |
diff --git a/android_webview/native/aw_certificate_error_handler_base.cc b/android_webview/native/aw_certificate_error_handler_base.cc |
new file mode 100644 |
index 0000000000000000000000000000000000000000..6a1657d955a09f76669e664f7542924ed92a0c4b |
--- /dev/null |
+++ b/android_webview/native/aw_certificate_error_handler_base.cc |
@@ -0,0 +1,31 @@ |
+// 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. |
+ |
+#include "android_webview/browser/aw_certificate_error_handler_base.h" |
+ |
+#include "android_webview/native/aw_contents.h" |
+#include "content/public/browser/render_view_host.h" |
+#include "content/public/browser/web_contents.h" |
+ |
+namespace android_webview { |
+ |
+AwCertificateErrorHandlerBase::~AwCertificateErrorHandlerBase() { |
boliu
2013/02/01 23:07:13
This needs to be in browser/ in the matching .cc f
sgurun-gerrit only
2013/02/02 01:01:10
I have chatted with Martin this morning and we ske
sgurun-gerrit only
2013/02/02 01:08:11
actually thinking about this again, I think cc and
|
+} |
+ |
+//static |
+AwCertificateErrorHandlerBase* AwCertificateErrorHandlerBase::FromID( |
boliu
2013/02/01 23:07:13
Total stylistic issue:
Normally we would put this
sgurun-gerrit only
2013/02/02 01:01:10
see above.
On 2013/02/01 23:07:13, boliu wrote:
boliu
2013/02/02 01:10:42
Oh, if Martin already looked over the layering pro
sgurun-gerrit only
2013/02/02 03:16:10
Done.
|
+ int render_process_id, |
+ int render_view_id) { |
+ |
+ const content::RenderViewHost* host = |
+ content::RenderViewHost::FromID(render_process_id, render_view_id); |
+ DCHECK(host); |
boliu
2013/02/01 23:07:13
Sorry to turn this around on you again, but now th
sgurun-gerrit only
2013/02/02 01:01:10
I have seen this pattern in multiple places, and I
|
+ content::WebContents* web_contents = |
+ content::WebContents::FromRenderViewHost(host); |
+ DCHECK(web_contents); |
+ return static_cast<AwCertificateErrorHandlerBase*> |
+ (AwContents::FromWebContents(web_contents)); |
+} |
+ |
+} // namespace android_webview |