Chromium Code Reviews| Index: chrome/browser/android/content_view_util.cc |
| diff --git a/chrome/browser/android/content_view_util.cc b/chrome/browser/android/content_view_util.cc |
| index 898affb93910b178b28f69846de3e8cd1fb4351e..bcd8089517df886ec96519664f78d52f165de8f9 100644 |
| --- a/chrome/browser/android/content_view_util.cc |
| +++ b/chrome/browser/android/content_view_util.cc |
| @@ -8,6 +8,7 @@ |
| #include "chrome/browser/browser_process.h" |
| #include "chrome/browser/profiles/profile.h" |
| #include "chrome/browser/profiles/profile_manager.h" |
| +#include "content/public/browser/android/content_view_core.h" |
| #include "content/public/browser/web_contents.h" |
| #include "jni/ContentViewUtil_jni.h" |
| @@ -22,6 +23,23 @@ static jlong CreateNativeWebContents( |
| return reinterpret_cast<intptr_t>(content::WebContents::Create(params)); |
| } |
| +static jlong CreateNativeWebContentsWithSharedSiteInstance( |
| + JNIEnv* env, |
| + jclass clazz, |
| + jobject jcontent_view_core) { |
| + Profile* profile = g_browser_process->profile_manager()->GetLastUsedProfile(); |
|
David Trainor- moved to gerrit
2014/07/31 00:48:47
Not sure, but should we be grabbing the profile fo
shatch
2014/07/31 18:41:34
Not sure either, but that sounds reasonable. Made
|
| + |
| + content::ContentViewCore* content_view_core = |
| + content::ContentViewCore::GetNativeContentViewCore(env, |
| + jcontent_view_core); |
| + CHECK(content_view_core); |
| + |
| + content::WebContents::CreateParams params( |
| + profile, content_view_core->GetWebContents()->GetSiteInstance()); |
| + |
| + return reinterpret_cast<intptr_t>(content::WebContents::Create(params)); |
| +} |
| + |
| static void DestroyNativeWebContents( |
| JNIEnv* env, jclass clazz, jlong web_contents_ptr) { |
| content::WebContents* web_contents = |