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 f9a769e38e3d3288e2079948a0fec80f6adb5875..e7ce5d145bc14d93ad406e44fc4fd105c920d1a0 100644 |
--- a/third_party/WebKit/Source/core/html/shadow/MediaControlElements.cpp |
+++ b/third_party/WebKit/Source/core/html/shadow/MediaControlElements.cpp |
@@ -36,6 +36,7 @@ |
#include "core/dom/shadow/ShadowRoot.h" |
#include "core/events/MouseEvent.h" |
#include "core/frame/LocalFrame.h" |
+#include "core/frame/Settings.h" |
#include "core/html/HTMLAnchorElement.h" |
#include "core/html/HTMLLabelElement.h" |
#include "core/html/HTMLMediaSource.h" |
@@ -46,6 +47,7 @@ |
#include "core/html/track/TextTrackList.h" |
#include "core/input/EventHandler.h" |
#include "core/layout/api/LayoutSliderItem.h" |
+#include "core/page/Page.h" |
#include "platform/EventDispatchForbiddenScope.h" |
#include "platform/Histogram.h" |
#include "platform/RuntimeEnabledFeatures.h" |
@@ -656,6 +658,10 @@ MediaControlDownloadButtonElement::getOverflowStringName() { |
bool MediaControlDownloadButtonElement::shouldDisplayDownloadButton() { |
const KURL& url = mediaElement().currentSrc(); |
+ // Check page settings to see if download is disabled. |
+ if (document().page() && document().page()->settings().hideDownloadUI()) |
+ return false; |
+ |
// URLs that lead to nowhere are ignored. |
if (url.isNull() || url.isEmpty()) |
return false; |