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

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

Issue 2728193003: Show download button even when preload=none (Closed)
Patch Set: mlamouri feedback 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..f1f5eedabc2b18706323f9b519ff7fea1b2e8430 100644
--- a/third_party/WebKit/Source/core/html/shadow/MediaControlElements.cpp
+++ b/third_party/WebKit/Source/core/html/shadow/MediaControlElements.cpp
@@ -679,6 +679,12 @@ 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;
+ }
+
// 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