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 21cea2dee9930a09636a566424bfddf015f5bc85..e8320df1a16e692edb6ee72aff9f097485eaeeb6 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")) { |
|
DaleCurtis
2017/03/09 18:45:48
Do you really want callers to have to know about t
whywhat
2017/03/09 19:56:45
Good suggestion! Done.
|
| + 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,12 @@ void MediaControls::reset() { |
| onVolumeChange(); |
| onTextTracksAddedOrRemoved(); |
| + onControlsListUpdated(); |
| +} |
| + |
| +void MediaControls::onControlsListUpdated() { |
| + BatchedControlUpdate batch(this); |
| + |
| m_fullscreenButton->setIsWanted(shouldShowFullscreenButton(mediaElement())); |
| refreshCastButtonVisibilityWithoutUpdate(); |