Chromium Code Reviews| 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 be254c189d6f550806ce1b75e1f249092ae3b1e8..8eb44fa93d348cc1aa0f81861dd03432ffe406ac 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()->tokens().contains("nofullscreen")) { |
| + 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()->tokens().contains("noremoteplayback")) { |
| + UseCounter::count(mediaElement.document(), |
| + UseCounter::HTMLMediaElementControlsListNoRemotePlayback); |
| + return false; |
| + } |
| + |
| return mediaElement.hasRemoteRoutes(); |
| } |
| @@ -397,6 +411,13 @@ void MediaControls::reset() { |
| onVolumeChange(); |
| onTextTracksAddedOrRemoved(); |
| + onControlsListUpdated(); |
| +} |
| + |
| +void MediaControls::onControlsListUpdated() { |
| + EventDispatchForbiddenScope::AllowUserAgentEvents allowEventsInShadow; |
|
mlamouri (slow - plz ping)
2017/03/09 16:45:45
I think you can drop that
whywhat
2017/03/09 16:59:43
Done.
|
| + BatchedControlUpdate batch(this); |
| + |
| m_fullscreenButton->setIsWanted(shouldShowFullscreenButton(mediaElement())); |
| refreshCastButtonVisibilityWithoutUpdate(); |