Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(214)

Unified Diff: third_party/WebKit/Source/core/html/shadow/MediaControls.cpp

Issue 2657723002: [Blink, Media] Added controlsList to HTMLMediaElement (Closed)
Patch Set: Added a link to the spec. Created 3 years, 9 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « third_party/WebKit/Source/core/html/shadow/MediaControls.h ('k') | tools/metrics/histograms/histograms.xml » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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();
« no previous file with comments | « third_party/WebKit/Source/core/html/shadow/MediaControls.h ('k') | tools/metrics/histograms/histograms.xml » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698