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

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

Issue 2394653002: Disable download for overlay panel content (Closed)
Patch Set: rebase Created 4 years, 2 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/frame/Settings.in ('k') | third_party/WebKit/Source/web/WebSettingsImpl.h » ('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/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;
« no previous file with comments | « third_party/WebKit/Source/core/frame/Settings.in ('k') | third_party/WebKit/Source/web/WebSettingsImpl.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698