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

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

Issue 2319863005: Implement new compositor and ContentViewCore reparenting for VR Shell. (Closed)
Patch Set: Created 4 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: 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 e627fcd7611712cccc0a78f09b97a433a233f072..84cc6b1797b20ae385a845a2d56ea00c0d60faf3 100644
--- a/content/browser/android/content_view_core_impl.cc
+++ b/content/browser/android/content_view_core_impl.cc
@@ -275,19 +275,17 @@ void ContentViewCoreImpl::UpdateWindowAndroid(
JNIEnv* env,
const base::android::JavaParamRef<jobject>& obj,
jlong window_android) {
+ if (!window_android || view_.GetWindowAndroid()) {
+ FOR_EACH_OBSERVER(ContentViewCoreImplObserver, observer_list_,
+ OnDetachedFromWindow());
+ view_.RemoveFromParent();
+ }
if (window_android) {
- DCHECK(!view_.GetWindowAndroid());
ui::WindowAndroid* window =
reinterpret_cast<ui::WindowAndroid*>(window_android);
window->AddChild(&view_);
- FOR_EACH_OBSERVER(ContentViewCoreImplObserver,
- observer_list_,
+ FOR_EACH_OBSERVER(ContentViewCoreImplObserver, observer_list_,
OnAttachedToWindow());
- } else {
- FOR_EACH_OBSERVER(ContentViewCoreImplObserver,
- observer_list_,
- OnDetachedFromWindow());
- view_.RemoveFromParent();
}
}

Powered by Google App Engine
This is Rietveld 408576698