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

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

Issue 2319863005: Implement new compositor and ContentViewCore reparenting for VR Shell. (Closed)
Patch Set: Rebase onto ToT 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 be027f541172061ac5d0a9d1764e53febe0f8cc1..4b1bdb7dae1ca2bbe796f6a93e25ac63ca060f18 100644
--- a/content/browser/android/content_view_core_impl.cc
+++ b/content/browser/android/content_view_core_impl.cc
@@ -276,19 +276,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_,
Ted C 2016/09/20 19:57:07 per my other comment, let's try to avoid this by s
mthiesse 2016/09/20 20:56:08 Done.
+ 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