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) { |