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

Unified Diff: content/browser/android/content_view_core_impl.cc

Issue 2136373002: Make WindowAndroid a ViewAndroid (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@view3
Patch Set: Make WindowAndroid a ViewAndroid Created 4 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
« no previous file with comments | « no previous file | content/browser/renderer_host/compositor_impl_android.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: content/browser/android/content_view_core_impl.cc
diff --git a/content/browser/android/content_view_core_impl.cc b/content/browser/android/content_view_core_impl.cc
index dc9de518de161fe882fbe74f5e3d2b92d9c05788..b5b4cdebca838eb48b78746ae3ae9db0cee5379b 100644
--- a/content/browser/android/content_view_core_impl.cc
+++ b/content/browser/android/content_view_core_impl.cc
@@ -218,7 +218,7 @@ ContentViewCoreImpl::ContentViewCoreImpl(
jobject java_bridge_retained_object_set)
: WebContentsObserver(web_contents),
java_ref_(env, obj),
- view_(view_android_delegate, window_android),
+ view_(view_android_delegate),
web_contents_(static_cast<WebContentsImpl*>(web_contents)),
page_scale_(1),
dpi_scale_(ui::GetScaleFactorForNativeView(&view_)),
@@ -228,6 +228,7 @@ ContentViewCoreImpl::ContentViewCoreImpl(
"A ContentViewCoreImpl should be created with a valid WebContents.";
DCHECK(window_android);
DCHECK(!view_android_delegate.is_null());
+ window_android->AddChild(&view_);
view_.SetLayer(cc::SolidColorLayer::Create());
view_.GetLayer()->SetBackgroundColor(GetBackgroundColor(env, obj));
gfx::Size physical_size(
@@ -285,8 +286,9 @@ void ContentViewCoreImpl::UpdateWindowAndroid(
jlong window_android) {
if (window_android) {
DCHECK(!view_.GetWindowAndroid());
- view_.SetWindowAndroid(
- reinterpret_cast<ui::WindowAndroid*>(window_android));
+ ui::WindowAndroid* window =
+ reinterpret_cast<ui::WindowAndroid*>(window_android);
+ window->AddChild(&view_);
FOR_EACH_OBSERVER(ContentViewCoreImplObserver,
observer_list_,
OnAttachedToWindow());
@@ -294,7 +296,7 @@ void ContentViewCoreImpl::UpdateWindowAndroid(
FOR_EACH_OBSERVER(ContentViewCoreImplObserver,
observer_list_,
OnDetachedFromWindow());
- view_.SetWindowAndroid(nullptr);
+ view_.RemoveFromParent();
}
}
« no previous file with comments | « no previous file | content/browser/renderer_host/compositor_impl_android.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698