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

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

Issue 2728193003: Show download button even when preload=none (Closed)
Patch Set: Fix incorrect download button unit test and rebase 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..46370c8be04fd122a748fafa4cd3931596f1d814 100644
--- a/third_party/WebKit/Source/core/html/shadow/MediaControlElements.cpp
+++ b/third_party/WebKit/Source/core/html/shadow/MediaControlElements.cpp
@@ -679,6 +679,11 @@ bool MediaControlDownloadButtonElement::shouldDisplayDownloadButton() {
if (url.isNull() || url.isEmpty())
return false;
+ // If we have no source, we can't download.
+ if (mediaElement().getNetworkState() == HTMLMediaElement::kNetworkEmpty ||
+ mediaElement().getNetworkState() == HTMLMediaElement::kNetworkNoSource)
+ return false;
mlamouri (slow - plz ping) 2017/03/07 11:23:07 style: you need { }
steimel 2017/03/07 15:26:21 Done.
+
// Local files and blobs (including MSE) should not have a download button.
if (url.isLocalFile() || url.protocolIs("blob"))
return false;

Powered by Google App Engine
This is Rietveld 408576698