Support changing the window tree from aura::WindowDelegate::OnWindowOcclusionChanged.
Some code in Chrome needs to change the window tree in response to a change of visibility for a WebContents (e.g. close zoom bubble, create a new RenderWidgetHostViewAura). Because of that, we need to allow changes to the window tree from aura::WindowDelegate::OnWindowOcclusionChanged(). With this CL, aura::Window::SetOcclusionState() is not called immediately when the occlusion of a tracked window is computed. Instead, we compute occlusion for all tracked windows. Then, we call aura::Window::SetOcclusionState() on all tracked windows. Having separate phases ensures that the window tree is not modified while occlusion is being computed. If a call to aura::Window::SetOcclusionState() in the 2nd phase changes the window tree in a way that could affect occlusion, we go back to phase 1. There is a hard cap of 2 iterations, after which we crash. Bug: 668690, 813076 Change-Id: I61e5cdbb605343a5b587aeb96effcbd8dc07de33 Reviewed-on: https://chromium-review.googlesource.com/861953 Commit-Queue: François Doray <fdoray@chromium.org> Reviewed-by:Sadrul Chowdhury <sadrul@chromium.org> Cr-Commit-Position: refs/heads/master@{#537310}
Showing
This diff is collapsed.
Please register or sign in to comment