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

Side by Side 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: 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 unified diff | Download patch | Annotate | Revision Log
OLDNEW
1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. 1 // Copyright (c) 2012 The Chromium Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be 2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file. 3 // found in the LICENSE file.
4 4
5 #include "chrome/browser/android/tab_android.h" 5 #include "chrome/browser/android/tab_android.h"
6 #include "chrome/browser/ui/tab_contents/tab_contents.h"
7 #include "content/public/browser/android/content_view_core.h"
8 #include "content/public/browser/web_contents.h"
9
10 using content::ContentViewCore;
11 using content::WebContents;
12
13 TabContents* TabAndroid::GetOrCreateTabContents(WebContents* web_contents) {
14 TabContents* tab_contents = TabContents::FromWebContents(web_contents);
15 return tab_contents ? tab_contents : TabContents::Factory::CreateTabContents(
16 web_contents);
17 }
18
19 TabContents* TabAndroid::InitTabContentsFromView(JNIEnv* env,
20 jobject content_view) {
21 ContentViewCore* content_view_core =
22 ContentViewCore::GetNativeContentViewCore(env, content_view);
23 DCHECK(content_view_core);
24 DCHECK(content_view_core->GetWebContents());
25 return GetOrCreateTabContents(content_view_core->GetWebContents());
26 }
6 27
7 TabAndroid::TabAndroid() : tab_id_(-1) { 28 TabAndroid::TabAndroid() : tab_id_(-1) {
8 } 29 }
9 30
10 TabAndroid::~TabAndroid() { 31 TabAndroid::~TabAndroid() {
11 } 32 }
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698