Chromium Code Reviews| Index: third_party/WebKit/Source/web/FullscreenController.cpp |
| diff --git a/third_party/WebKit/Source/web/FullscreenController.cpp b/third_party/WebKit/Source/web/FullscreenController.cpp |
| index 4380a01fb2d69c41051ae38c536576db7c821aac..c6a12fd7a65086fa20ee73073c0fe68a7a2c0747 100644 |
| --- a/third_party/WebKit/Source/web/FullscreenController.cpp |
| +++ b/third_party/WebKit/Source/web/FullscreenController.cpp |
| @@ -182,6 +182,10 @@ void FullscreenController::fullscreenElementChanged(Element* fromElement, |
| Element* toElement) { |
| DCHECK_NE(fromElement, toElement); |
| + // Restore transparency if old fullscreen element changed it. |
| + if (m_needsTransparencyRestore) |
| + m_webViewImpl->setIsTransparent(m_initialTransparency); |
| + |
| if (toElement) { |
| DCHECK(Fullscreen::isCurrentFullScreenElement(*toElement)); |
| @@ -191,9 +195,10 @@ void FullscreenController::fullscreenElementChanged(Element* fromElement, |
| // If the video uses overlay fullscreen mode, make the background |
| // transparent. |
| - if (videoElement.usesOverlayFullscreenVideo() && |
| - m_webViewImpl->layerTreeView()) { |
| - m_webViewImpl->layerTreeView()->setHasTransparentBackground(true); |
| + if (videoElement.usesOverlayFullscreenVideo()) { |
| + m_initialTransparency = m_webViewImpl->isTransparent(); |
|
chrishtr
2017/03/01 16:16:53
For m_initialPageScaleFactor, it is "reset" in Ful
Eric Seckler
2017/03/07 18:00:46
This stuff changed a bit now, but I still restore
|
| + m_needsTransparencyRestore = true; |
| + m_webViewImpl->setIsTransparent(true); |
| } |
| } |
| } |
| @@ -202,12 +207,6 @@ void FullscreenController::fullscreenElementChanged(Element* fromElement, |
| DCHECK(!Fullscreen::isCurrentFullScreenElement(*fromElement)); |
| if (isHTMLVideoElement(*fromElement)) { |
| - // If the video used overlay fullscreen mode, restore the transparency. |
| - if (m_webViewImpl->layerTreeView()) { |
| - m_webViewImpl->layerTreeView()->setHasTransparentBackground( |
| - m_webViewImpl->isTransparent()); |
| - } |
| - |
| HTMLVideoElement& videoElement = toHTMLVideoElement(*fromElement); |
| videoElement.didExitFullscreen(); |
| } |