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

Unified Diff: third_party/WebKit/Source/web/FullscreenController.cpp

Issue 2204673004: WIP - WebMediaPlayer switch media renderer. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Addressed comments. 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: 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 3d30b85fd62502e88d3945bb4ada075ecc7bd6cf..281ae216e956ba2dcbecbac83c5eb158f53b4e6e 100644
--- a/third_party/WebKit/Source/web/FullscreenController.cpp
+++ b/third_party/WebKit/Source/web/FullscreenController.cpp
@@ -41,6 +41,7 @@
#include "platform/RuntimeEnabledFeatures.h"
#include "public/platform/WebLayerTreeView.h"
#include "public/web/WebFrameClient.h"
+#include "third_party/WebKit/Source/core/dom/TagCollection.h"
#include "web/WebLocalFrameImpl.h"
#include "web/WebSettingsImpl.h"
#include "web/WebViewImpl.h"
@@ -89,6 +90,12 @@ void FullscreenController::didEnterFullscreen()
HTMLVideoElement* videoElement = toHTMLVideoElement(element);
if (videoElement->usesOverlayFullscreenVideo() && m_webViewImpl->layerTreeView())
m_webViewImpl->layerTreeView()->setHasTransparentBackground(true);
+ } else {
+ // Notify all the video descendants that an ancestor enters full screen.
+ for (HTMLVideoElement& videoElement : Traversal<HTMLVideoElement>::descendantsOf(*element)) {
+ if (videoElement.webMediaPlayer())
+ videoElement.webMediaPlayer()->ancestorEnteredFullscreen();
+ }
}
}
@@ -121,6 +128,13 @@ void FullscreenController::didExitFullscreen()
m_needsScrollAndScaleRestore = true;
fullscreen->didExitFullscreen();
+ if (!isHTMLVideoElement(element)) {
+ // Notify all the video descendants that an anecestor exits full screen.
+ for (HTMLVideoElement& videoElement : Traversal<HTMLVideoElement>::descendantsOf(*element)) {
+ if (videoElement.webMediaPlayer())
+ videoElement.webMediaPlayer()->ancestorExitedFullscreen();
+ }
+ }
}
}
}

Powered by Google App Engine
This is Rietveld 408576698