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; |
} |