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

Unified Diff: chrome/browser/android/content_view_util.cc

Issue 378743002: Navigation transitions: Place transition page in same process as destination page. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Added tests + refactor. Created 6 years, 5 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: 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..eb37ba4b6eb6b4bee2ac7dc884b0da0748d7f84d 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,21 @@ 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();
+
+ 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 =

Powered by Google App Engine
This is Rietveld 408576698