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

Unified Diff: third_party/WebKit/Source/core/html/shadow/MediaControls.cpp

Issue 2692903002: Don't show media controls when there is a persistent video. (Closed)
Patch Set: rebase Created 3 years, 10 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/core/html/shadow/MediaControls.cpp
diff --git a/third_party/WebKit/Source/core/html/shadow/MediaControls.cpp b/third_party/WebKit/Source/core/html/shadow/MediaControls.cpp
index ad9607accff4eecd9e1c52ca347c46f62c5da3fd..cefa6bbe58aaa2700d79db8002164b7c78d8f0cf 100644
--- a/third_party/WebKit/Source/core/html/shadow/MediaControls.cpp
+++ b/third_party/WebKit/Source/core/html/shadow/MediaControls.cpp
@@ -71,8 +71,16 @@ static bool shouldShowFullscreenButton(const HTMLMediaElement& mediaElement) {
}
static bool shouldShowCastButton(HTMLMediaElement& mediaElement) {
- return !mediaElement.fastHasAttribute(HTMLNames::disableremoteplaybackAttr) &&
- mediaElement.hasRemoteRoutes();
+ if (mediaElement.fastHasAttribute(HTMLNames::disableremoteplaybackAttr))
+ return false;
+
+ // Explicitly do not show cast button when the mediaControlsEnabled setting is
+ // false to make sure the overlay does not appear.
+ Document& document = mediaElement.document();
+ if (document.settings() && !document.settings()->getMediaControlsEnabled())
+ return false;
+
+ return mediaElement.hasRemoteRoutes();
}
static bool preferHiddenVolumeControls(const Document& document) {

Powered by Google App Engine
This is Rietveld 408576698