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

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

Issue 2741933004: [Blink, Media] Added controlsList to HTMLMediaElement (Closed)
Patch Set: 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 8bc5052f76bbfc6dbdc72146772a104c0f6a140d..720b8e0f44b1d644e76865c9f61d24f51a53ca11 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"
@@ -700,6 +701,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