| 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..0c808b0ce995f808b6d8f2a52eb87a3aaadf60b2 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();
|
| }
|
|
|
| @@ -397,6 +411,12 @@ void MediaControls::reset() {
|
| onVolumeChange();
|
| onTextTracksAddedOrRemoved();
|
|
|
| + onControlsListUpdated();
|
| +}
|
| +
|
| +void MediaControls::onControlsListUpdated() {
|
| + BatchedControlUpdate batch(this);
|
| +
|
| m_fullscreenButton->setIsWanted(shouldShowFullscreenButton(mediaElement()));
|
|
|
| refreshCastButtonVisibilityWithoutUpdate();
|
|
|