DescriptionWhen we switch tabs in chrome, the tab being switched away from gets hidden/shown/hidden.
This occurs in the NativeViewHostAura::NativeViewDetaching code path where we first remove the
clipping window which is the intermediate parent of the web contents view. The clipping window
is hidden which causes the RWHVA::Hide function to get called which initiates the hiding sequence.
Then the web contents view is reparented to the main view which is still visible. Now the RWHVA::Show
function is called which initiates the show sequence. Eventually the main view is hidden, which then
initiates the hide sequence.
Addressed this with the following changes.
1. WebView::AttachWebContents and WebView::DetachWebContents
now show and hide the webcontents native view. The
WebContents is shown and hidden as before in
WebContentsNativeViewAura::OnWindowVisibilityChanged.
2. Removed the WebContentsNativeViewAura::OnWindowParentChanged function.
This function was present to show and hide the webcontents if the window was visible.
This should not be needed with the change in #1 above.
3. Added a new file webview_unittest.cc. This contains the unittest WebViewUnitTest.TestWebViewAttachDetachWebContents
This is run as part of unit_tests.exe.
BUG=412989
R=sky
Committed: https://crrev.com/99941773a742f62892fc9aad1a1ebfb7cc967164
Cr-Commit-Position: refs/heads/master@{#294962}
Patch Set 1 #Patch Set 2 : Added unittest #Patch Set 3 : Fixed RemoveClippingWindowOrder views test #
Total comments: 6
Patch Set 4 : Moved the RemoveClippingWindow call to the end of the NativeViewDetaching function #Patch Set 5 : Fixed NativeViewHierarchyChanged test #Patch Set 6 : NULL root window check #
Total comments: 2
Patch Set 7 : Added code to hide the WC in browserview during active tab switch #Patch Set 8 : Reverted previous changes #Patch Set 9 : Added code to show and hide the wc view in AttachWebContents and DetachWebContents #Patch Set 10 : Removed unnecessary include #Patch Set 11 : Updated DEPS #Patch Set 12 : Fixed build errors #Patch Set 13 : Fixed flash fullscreen browser tests #
Total comments: 2
Patch Set 14 : Added comments #
Messages
Total messages: 43 (11 generated)
|