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

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

Issue 10968003: Add rendering support to the TestShell. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Rebased on top of test apk changes. Created 8 years, 3 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/tab_android.cc
diff --git a/chrome/browser/android/tab_android.cc b/chrome/browser/android/tab_android.cc
index 1b9345a82a6140472c37d9694a3b5281c0df8573..eaebc5563e555af3f5dde8f5d54ea7b474a81c5d 100644
--- a/chrome/browser/android/tab_android.cc
+++ b/chrome/browser/android/tab_android.cc
@@ -3,6 +3,27 @@
// found in the LICENSE file.
#include "chrome/browser/android/tab_android.h"
+#include "chrome/browser/ui/tab_contents/tab_contents.h"
+#include "content/public/browser/android/content_view_core.h"
+#include "content/public/browser/web_contents.h"
+
+using content::ContentViewCore;
+using content::WebContents;
+
+TabContents* TabAndroid::GetOrCreateTabContents(WebContents* web_contents) {
+ TabContents* tab_contents = TabContents::FromWebContents(web_contents);
+ return tab_contents ? tab_contents : TabContents::Factory::CreateTabContents(
+ web_contents);
+}
+
+TabContents* TabAndroid::InitTabContentsFromView(JNIEnv* env,
+ jobject content_view) {
+ ContentViewCore* content_view_core =
+ ContentViewCore::GetNativeContentViewCore(env, content_view);
+ DCHECK(content_view_core);
+ DCHECK(content_view_core->GetWebContents());
+ return GetOrCreateTabContents(content_view_core->GetWebContents());
+}
TabAndroid::TabAndroid() : tab_id_(-1) {
}

Powered by Google App Engine
This is Rietveld 408576698