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

Side by Side 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 unified diff | Download patch
OLDNEW
1 /* 1 /*
2 * Copyright (C) 2008, 2009, 2010, 2011 Apple Inc. All rights reserved. 2 * Copyright (C) 2008, 2009, 2010, 2011 Apple Inc. All rights reserved.
3 * Copyright (C) 2012 Google Inc. All rights reserved. 3 * Copyright (C) 2012 Google Inc. All rights reserved.
4 * 4 *
5 * Redistribution and use in source and binary forms, with or without 5 * Redistribution and use in source and binary forms, with or without
6 * modification, are permitted provided that the following conditions 6 * modification, are permitted provided that the following conditions
7 * are met: 7 * are met:
8 * 8 *
9 * 1. Redistributions of source code must retain the above copyright 9 * 1. Redistributions of source code must retain the above copyright
10 * notice, this list of conditions and the following disclaimer. 10 * notice, this list of conditions and the following disclaimer.
(...skipping 661 matching lines...) Expand 10 before | Expand all | Expand 10 after
672 const KURL& url = mediaElement().currentSrc(); 672 const KURL& url = mediaElement().currentSrc();
673 673
674 // Check page settings to see if download is disabled. 674 // Check page settings to see if download is disabled.
675 if (document().page() && document().page()->settings().getHideDownloadUI()) 675 if (document().page() && document().page()->settings().getHideDownloadUI())
676 return false; 676 return false;
677 677
678 // URLs that lead to nowhere are ignored. 678 // URLs that lead to nowhere are ignored.
679 if (url.isNull() || url.isEmpty()) 679 if (url.isNull() || url.isEmpty())
680 return false; 680 return false;
681 681
682 // If we have no source, we can't download.
683 if (mediaElement().getNetworkState() == HTMLMediaElement::kNetworkEmpty ||
684 mediaElement().getNetworkState() == HTMLMediaElement::kNetworkNoSource) {
685 return false;
686 }
687
682 // Local files and blobs (including MSE) should not have a download button. 688 // Local files and blobs (including MSE) should not have a download button.
683 if (url.isLocalFile() || url.protocolIs("blob")) 689 if (url.isLocalFile() || url.protocolIs("blob"))
684 return false; 690 return false;
685 691
686 // MediaStream can't be downloaded. 692 // MediaStream can't be downloaded.
687 if (HTMLMediaElement::isMediaStreamURL(url.getString())) 693 if (HTMLMediaElement::isMediaStreamURL(url.getString()))
688 return false; 694 return false;
689 695
690 // MediaSource can't be downloaded. 696 // MediaSource can't be downloaded.
691 if (HTMLMediaSource::lookup(url)) 697 if (HTMLMediaSource::lookup(url))
(...skipping 386 matching lines...) Expand 10 before | Expand all | Expand 10 after
1078 MediaControlCurrentTimeDisplayElement* 1084 MediaControlCurrentTimeDisplayElement*
1079 MediaControlCurrentTimeDisplayElement::create(MediaControls& mediaControls) { 1085 MediaControlCurrentTimeDisplayElement::create(MediaControls& mediaControls) {
1080 MediaControlCurrentTimeDisplayElement* element = 1086 MediaControlCurrentTimeDisplayElement* element =
1081 new MediaControlCurrentTimeDisplayElement(mediaControls); 1087 new MediaControlCurrentTimeDisplayElement(mediaControls);
1082 element->setShadowPseudoId( 1088 element->setShadowPseudoId(
1083 AtomicString("-webkit-media-controls-current-time-display")); 1089 AtomicString("-webkit-media-controls-current-time-display"));
1084 return element; 1090 return element;
1085 } 1091 }
1086 1092
1087 } // namespace blink 1093 } // namespace blink
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698