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 cb8efeffd7bb3e843c17fa3f5debc2591e0afc5f..7a341fddc3bc803f0ee6d62fa188ce4f4145b278 100644 |
--- a/third_party/WebKit/Source/web/FullscreenController.cpp |
+++ b/third_party/WebKit/Source/web/FullscreenController.cpp |
@@ -31,6 +31,7 @@ |
#include "web/FullscreenController.h" |
#include "core/dom/Document.h" |
+#include "core/dom/ElementTraversal.h" |
#include "core/dom/Fullscreen.h" |
#include "core/frame/FrameView.h" |
#include "core/frame/LocalFrame.h" |
@@ -86,6 +87,12 @@ void FullscreenController::didEnterFullscreen() { |
if (videoElement->usesOverlayFullscreenVideo() && |
m_webViewImpl->layerTreeView()) |
m_webViewImpl->layerTreeView()->setHasTransparentBackground(true); |
+ } else { |
+ for (HTMLVideoElement& videoElement : |
+ Traversal<HTMLVideoElement>::descendantsOf(*element)) { |
+ if (videoElement.webMediaPlayer()) |
+ videoElement.webMediaPlayer()->ancestorEnteredFullscreen(); |
+ } |
} |
} |
@@ -120,6 +127,13 @@ void FullscreenController::didExitFullscreen() { |
m_needsScrollAndScaleRestore = true; |
fullscreen->didExitFullscreen(); |
+ if (!isHTMLVideoElement(element)) { |
+ for (HTMLVideoElement& videoElement : |
+ Traversal<HTMLVideoElement>::descendantsOf(*element)) { |
+ if (videoElement.webMediaPlayer()) |
+ videoElement.webMediaPlayer()->ancestorExitedFullscreen(); |
+ } |
+ } |
} |
} |
} |