| 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 1e2d37e22b6b41441314c1bca25866c3b0bef056..1ec2b78c6c0089c4f50728b931ce20eb51f294e5 100644
|
| --- a/third_party/WebKit/Source/core/html/shadow/MediaControlElements.cpp
|
| +++ b/third_party/WebKit/Source/core/html/shadow/MediaControlElements.cpp
|
| @@ -653,10 +653,23 @@ bool MediaControlDownloadButtonElement::shouldDisplayDownloadButton()
|
| {
|
| const KURL& url = mediaElement().currentSrc();
|
|
|
| - if (!url.isNull() && !url.isEmpty() && !HTMLMediaElement::isMediaStreamURL(url.getString()) && !url.protocolIs("blob") && !HTMLMediaSource::lookup(url)) {
|
| - return true;
|
| - }
|
| - return false;
|
| + // URLs that lead to nowhere are ignored.
|
| + if (url.isNull() || url.isEmpty())
|
| + return false;
|
| +
|
| + // Local files and blobs should not have a download button.
|
| + if (url.isLocalFile() || url.protocolIs("blob"))
|
| + return false;
|
| +
|
| + // MediaStream can't be downloaded.
|
| + if (HTMLMediaElement::isMediaStreamURL(url.getString()))
|
| + return false;
|
| +
|
| + // MediaSource can't be downloaded.
|
| + if (HTMLMediaSource::lookup(url))
|
| + return false;
|
| +
|
| + return true;
|
| }
|
|
|
| void MediaControlDownloadButtonElement::defaultEventHandler(Event* event)
|
|
|