Chromium Code Reviews| Index: android_webview/native/aw_contents.cc |
| diff --git a/android_webview/native/aw_contents.cc b/android_webview/native/aw_contents.cc |
| index f170e4927ac7041ee9ce4006daaf45e2d441da1d..3918d5b0de87007db2c66662ed0d6f991e2d8859 100644 |
| --- a/android_webview/native/aw_contents.cc |
| +++ b/android_webview/native/aw_contents.cc |
| @@ -35,6 +35,7 @@ |
| #include "content/public/browser/cert_store.h" |
| #include "content/public/browser/navigation_entry.h" |
| #include "content/public/browser/render_process_host.h" |
| +#include "content/public/browser/render_view_host.h" |
| #include "content/public/browser/web_contents.h" |
| #include "content/public/common/ssl_status.h" |
| #include "jni/AwContents_jni.h" |
| @@ -115,6 +116,17 @@ AwContents* AwContents::FromWebContents(WebContents* web_contents) { |
| return AwContentsUserData::GetContents(web_contents); |
| } |
| +// static |
| +AwContents* AwContents::FromID(int render_process_id, int render_view_id) { |
| + const content::RenderViewHost* rvh = |
|
Kristian Monsen
2013/02/07 03:30:55
Should this only be used on the UI thread? In that
sgurun-gerrit only
2013/02/07 03:37:32
One of the methods that the FromID calls already c
|
| + content::RenderViewHost::FromID(render_process_id, render_view_id); |
| + if (!rvh) return NULL; |
| + content::WebContents* web_contents = |
| + content::WebContents::FromRenderViewHost(rvh); |
| + if (!web_contents) return NULL; |
| + return FromWebContents(web_contents); |
| +} |
| + |
| AwContents::AwContents(JNIEnv* env, |
| jobject obj, |
| jobject web_contents_delegate) |