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

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

Issue 908093003: Revert of Add support for ContentViewCore helpers on Tab (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 5 years, 10 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
« no previous file with comments | « chrome/browser/android/tab_android.h ('k') | content/browser/android/content_view_core_impl.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: chrome/browser/android/tab_android.cc
diff --git a/chrome/browser/android/tab_android.cc b/chrome/browser/android/tab_android.cc
index ed5094f94f9f08d7c1153d65fb4dcac1a2020199..b36830d8aa290eda14c8d6d7ceacc38b33af271a 100644
--- a/chrome/browser/android/tab_android.cc
+++ b/chrome/browser/android/tab_android.cc
@@ -9,9 +9,7 @@
#include "base/android/jni_string.h"
#include "base/metrics/histogram.h"
#include "base/trace_event/trace_event.h"
-#include "cc/layers/layer.h"
#include "chrome/browser/android/chrome_web_contents_delegate_android.h"
-#include "chrome/browser/android/compositor/tab_content_manager.h"
#include "chrome/browser/android/uma_utils.h"
#include "chrome/browser/browser_about_handler.h"
#include "chrome/browser/chrome_notification_types.h"
@@ -112,14 +110,11 @@
TabAndroid::TabAndroid(JNIEnv* env, jobject obj)
: weak_java_tab_(env, obj),
- content_layer_(cc::Layer::Create()),
- tab_content_manager_(NULL),
synced_tab_delegate_(new browser_sync::SyncedTabDelegateAndroid(this)) {
Java_Tab_setNativePtr(env, obj, reinterpret_cast<intptr_t>(this));
}
TabAndroid::~TabAndroid() {
- GetContentLayer()->RemoveAllChildren();
JNIEnv* env = base::android::AttachCurrentThread();
Java_Tab_clearNativePtr(env, weak_java_tab_.get(env).obj());
}
@@ -127,10 +122,6 @@
base::android::ScopedJavaLocalRef<jobject> TabAndroid::GetJavaObject() {
JNIEnv* env = base::android::AttachCurrentThread();
return weak_java_tab_.get(env);
-}
-
-scoped_refptr<cc::Layer> TabAndroid::GetContentLayer() const {
- return content_layer_;
}
int TabAndroid::GetAndroidId() const {
@@ -448,18 +439,12 @@
InstantServiceFactory::GetForProfile(GetProfile());
if (instant_service)
instant_service->AddObserver(this);
-
- content_layer_->InsertChild(content_view_core->GetLayer(), 0);
}
void TabAndroid::DestroyWebContents(JNIEnv* env,
jobject obj,
jboolean delete_native) {
DCHECK(web_contents());
-
- content::ContentViewCore* content_view_core = GetContentViewCore();
- if (content_view_core)
- content_view_core->GetLayer()->RemoveFromParent();
notification_registrar_.Remove(
this,
@@ -757,45 +742,6 @@
make_scoped_ptr(new ChromeInterceptNavigationDelegate(env, delegate)));
}
-void TabAndroid::AttachToTabContentManager(JNIEnv* env,
- jobject obj,
- jobject jtab_content_manager) {
- chrome::android::TabContentManager* tab_content_manager =
- chrome::android::TabContentManager::FromJavaObject(jtab_content_manager);
- if (tab_content_manager == tab_content_manager_)
- return;
-
- if (tab_content_manager_)
- tab_content_manager_->DetachLiveLayer(GetAndroidId(), GetContentLayer());
- tab_content_manager_ = tab_content_manager;
- if (tab_content_manager_)
- tab_content_manager_->AttachLiveLayer(GetAndroidId(), GetContentLayer());
-}
-
-void TabAndroid::AttachOverlayContentViewCore(JNIEnv* env,
- jobject obj,
- jobject jcontent_view_core,
- jboolean visible) {
- content::ContentViewCore* content_view_core =
- content::ContentViewCore::GetNativeContentViewCore(env,
- jcontent_view_core);
- DCHECK(content_view_core);
-
- content_view_core->GetLayer()->SetHideLayerAndSubtree(!visible);
- content_layer_->AddChild(content_view_core->GetLayer());
-}
-
-void TabAndroid::DetachOverlayContentViewCore(JNIEnv* env,
- jobject obj,
- jobject jcontent_view_core) {
- content::ContentViewCore* content_view_core =
- content::ContentViewCore::GetNativeContentViewCore(env,
- jcontent_view_core);
- DCHECK(content_view_core);
-
- content_view_core->GetLayer()->RemoveFromParent();
-}
-
static void Init(JNIEnv* env, jobject obj) {
TRACE_EVENT0("native", "TabAndroid::Init");
// This will automatically bind to the Java object and pass ownership there.
« no previous file with comments | « chrome/browser/android/tab_android.h ('k') | content/browser/android/content_view_core_impl.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698