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

Unified Diff: third_party/WebKit/Source/core/html/shadow/MediaControlElements.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
Index: third_party/WebKit/Source/core/html/shadow/MediaControlElements.cpp
diff --git a/third_party/WebKit/Source/core/html/shadow/MediaControlElements.cpp b/third_party/WebKit/Source/core/html/shadow/MediaControlElements.cpp
index 167398c27bd78a92c8a038f5cfa1cd85c8adb935..5eb7dca7dbbfbfa765006b4af262346fdcd9a2d3 100644
--- a/third_party/WebKit/Source/core/html/shadow/MediaControlElements.cpp
+++ b/third_party/WebKit/Source/core/html/shadow/MediaControlElements.cpp
@@ -38,6 +38,7 @@
#include "core/events/MouseEvent.h"
#include "core/frame/LocalFrame.h"
#include "core/frame/Settings.h"
+#include "core/frame/UseCounter.h"
#include "core/html/HTMLAnchorElement.h"
#include "core/html/HTMLLabelElement.h"
#include "core/html/HTMLMediaSource.h"
@@ -706,6 +707,13 @@ bool MediaControlDownloadButtonElement::shouldDisplayDownloadButton() {
if (mediaElement().duration() == std::numeric_limits<double>::infinity())
return false;
+ // The attribute disables the download button.
+ if (mediaElement().controlsList()->shouldHideDownload()) {
+ UseCounter::count(mediaElement().document(),
+ UseCounter::HTMLMediaElementControlsListNoDownload);
+ return false;
+ }
+
return true;
}

Powered by Google App Engine
This is Rietveld 408576698