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

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

Issue 2400293003: Don't show download button for HLS streams (Closed)
Patch Set: nit 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 unified diff | Download patch
« no previous file with comments | « third_party/WebKit/Source/core/html/HTMLMediaElement.cpp ('k') | no next file » | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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 655 matching lines...) Expand 10 before | Expand all | Expand 10 after
666 return false; 666 return false;
667 667
668 // MediaStream can't be downloaded. 668 // MediaStream can't be downloaded.
669 if (HTMLMediaElement::isMediaStreamURL(url.getString())) 669 if (HTMLMediaElement::isMediaStreamURL(url.getString()))
670 return false; 670 return false;
671 671
672 // MediaSource can't be downloaded. 672 // MediaSource can't be downloaded.
673 if (HTMLMediaSource::lookup(url)) 673 if (HTMLMediaSource::lookup(url))
674 return false; 674 return false;
675 675
676 // HLS stream shouldn't have a download button.
677 if (HTMLMediaElement::isHLSURL(url))
678 return false;
679
676 return true; 680 return true;
677 } 681 }
678 682
679 void MediaControlDownloadButtonElement::defaultEventHandler(Event* event) { 683 void MediaControlDownloadButtonElement::defaultEventHandler(Event* event) {
680 const KURL& url = mediaElement().currentSrc(); 684 const KURL& url = mediaElement().currentSrc();
681 if (event->type() == EventTypeNames::click && 685 if (event->type() == EventTypeNames::click &&
682 !(url.isNull() || url.isEmpty())) { 686 !(url.isNull() || url.isEmpty())) {
683 Platform::current()->recordAction( 687 Platform::current()->recordAction(
684 UserMetricsAction("Media.Controls.Download")); 688 UserMetricsAction("Media.Controls.Download"));
685 if (!m_anchor) { 689 if (!m_anchor) {
(...skipping 339 matching lines...) Expand 10 before | Expand all | Expand 10 after
1025 MediaControlCurrentTimeDisplayElement* 1029 MediaControlCurrentTimeDisplayElement*
1026 MediaControlCurrentTimeDisplayElement::create(MediaControls& mediaControls) { 1030 MediaControlCurrentTimeDisplayElement::create(MediaControls& mediaControls) {
1027 MediaControlCurrentTimeDisplayElement* element = 1031 MediaControlCurrentTimeDisplayElement* element =
1028 new MediaControlCurrentTimeDisplayElement(mediaControls); 1032 new MediaControlCurrentTimeDisplayElement(mediaControls);
1029 element->setShadowPseudoId( 1033 element->setShadowPseudoId(
1030 AtomicString("-webkit-media-controls-current-time-display")); 1034 AtomicString("-webkit-media-controls-current-time-display"));
1031 return element; 1035 return element;
1032 } 1036 }
1033 1037
1034 } // namespace blink 1038 } // namespace blink
OLDNEW
« no previous file with comments | « third_party/WebKit/Source/core/html/HTMLMediaElement.cpp ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698