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 087b1013c313014963936a4221c8eedf8a6e6212..7beee133d98058136d467b67b04061a1d71f300a 100644 |
--- a/third_party/WebKit/Source/core/html/shadow/MediaControls.cpp |
+++ b/third_party/WebKit/Source/core/html/shadow/MediaControls.cpp |
@@ -32,6 +32,7 @@ |
#include "core/dom/TaskRunnerHelper.h" |
#include "core/events/MouseEvent.h" |
#include "core/frame/Settings.h" |
+#include "core/frame/UseCounter.h" |
#include "core/html/HTMLMediaElement.h" |
#include "core/html/HTMLVideoElement.h" |
#include "core/html/shadow/MediaControlsMediaEventListener.h" |
@@ -67,6 +68,12 @@ static bool shouldShowFullscreenButton(const HTMLMediaElement& mediaElement) { |
if (!Fullscreen::fullscreenEnabled(mediaElement.document())) |
return false; |
+ if (mediaElement.controlsList()->shouldHideFullscreen()) { |
+ UseCounter::count(mediaElement.document(), |
+ UseCounter::HTMLMediaElementControlsListNoFullscreen); |
+ return false; |
+ } |
+ |
return true; |
} |
@@ -80,6 +87,13 @@ static bool shouldShowCastButton(HTMLMediaElement& mediaElement) { |
if (document.settings() && !document.settings()->getMediaControlsEnabled()) |
return false; |
+ // The page disabled the button via the attribute. |
+ if (mediaElement.controlsList()->shouldHideRemotePlayback()) { |
+ UseCounter::count(mediaElement.document(), |
+ UseCounter::HTMLMediaElementControlsListNoRemotePlayback); |
+ return false; |
+ } |
+ |
return mediaElement.hasRemoteRoutes(); |
} |
@@ -369,6 +383,12 @@ void MediaControls::reset() { |
onVolumeChange(); |
onTextTracksAddedOrRemoved(); |
+ onControlsListUpdated(); |
+} |
+ |
+void MediaControls::onControlsListUpdated() { |
+ BatchedControlUpdate batch(this); |
+ |
m_fullscreenButton->setIsWanted(shouldShowFullscreenButton(mediaElement())); |
refreshCastButtonVisibilityWithoutUpdate(); |