OLD | NEW |
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 23 matching lines...) Expand all Loading... |
34 #include "core/dom/ClientRect.h" | 34 #include "core/dom/ClientRect.h" |
35 #include "core/dom/TaskRunnerHelper.h" | 35 #include "core/dom/TaskRunnerHelper.h" |
36 #include "core/dom/Text.h" | 36 #include "core/dom/Text.h" |
37 #include "core/dom/shadow/ShadowRoot.h" | 37 #include "core/dom/shadow/ShadowRoot.h" |
38 #include "core/events/MouseEvent.h" | 38 #include "core/events/MouseEvent.h" |
39 #include "core/frame/LocalFrame.h" | 39 #include "core/frame/LocalFrame.h" |
40 #include "core/frame/Settings.h" | 40 #include "core/frame/Settings.h" |
41 #include "core/frame/UseCounter.h" | 41 #include "core/frame/UseCounter.h" |
42 #include "core/html/HTMLAnchorElement.h" | 42 #include "core/html/HTMLAnchorElement.h" |
43 #include "core/html/HTMLLabelElement.h" | 43 #include "core/html/HTMLLabelElement.h" |
44 #include "core/html/HTMLMediaSource.h" | |
45 #include "core/html/HTMLSpanElement.h" | 44 #include "core/html/HTMLSpanElement.h" |
46 #include "core/html/HTMLVideoElement.h" | 45 #include "core/html/HTMLVideoElement.h" |
47 #include "core/html/TimeRanges.h" | 46 #include "core/html/TimeRanges.h" |
| 47 #include "core/html/media/HTMLMediaElementControlsList.h" |
| 48 #include "core/html/media/HTMLMediaSource.h" |
48 #include "core/html/shadow/MediaControls.h" | 49 #include "core/html/shadow/MediaControls.h" |
49 #include "core/html/track/TextTrackList.h" | 50 #include "core/html/track/TextTrackList.h" |
50 #include "core/input/EventHandler.h" | 51 #include "core/input/EventHandler.h" |
51 #include "core/layout/api/LayoutSliderItem.h" | 52 #include "core/layout/api/LayoutSliderItem.h" |
52 #include "core/page/Page.h" | 53 #include "core/page/Page.h" |
53 #include "platform/EventDispatchForbiddenScope.h" | 54 #include "platform/EventDispatchForbiddenScope.h" |
54 #include "platform/Histogram.h" | 55 #include "platform/Histogram.h" |
55 #include "platform/RuntimeEnabledFeatures.h" | 56 #include "platform/RuntimeEnabledFeatures.h" |
56 #include "platform/text/PlatformLocale.h" | 57 #include "platform/text/PlatformLocale.h" |
57 #include "public/platform/Platform.h" | 58 #include "public/platform/Platform.h" |
(...skipping 643 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
701 // HLS stream shouldn't have a download button. | 702 // HLS stream shouldn't have a download button. |
702 if (HTMLMediaElement::isHLSURL(url)) | 703 if (HTMLMediaElement::isHLSURL(url)) |
703 return false; | 704 return false; |
704 | 705 |
705 // Infinite streams don't have a clear end at which to finish the download | 706 // Infinite streams don't have a clear end at which to finish the download |
706 // (would require adding UI to prompt for the duration to download). | 707 // (would require adding UI to prompt for the duration to download). |
707 if (mediaElement().duration() == std::numeric_limits<double>::infinity()) | 708 if (mediaElement().duration() == std::numeric_limits<double>::infinity()) |
708 return false; | 709 return false; |
709 | 710 |
710 // The attribute disables the download button. | 711 // The attribute disables the download button. |
711 if (mediaElement().controlsList()->shouldHideDownload()) { | 712 if (mediaElement().controlsListInternal()->shouldHideDownload()) { |
712 UseCounter::count(mediaElement().document(), | 713 UseCounter::count(mediaElement().document(), |
713 UseCounter::HTMLMediaElementControlsListNoDownload); | 714 UseCounter::HTMLMediaElementControlsListNoDownload); |
714 return false; | 715 return false; |
715 } | 716 } |
716 | 717 |
717 return true; | 718 return true; |
718 } | 719 } |
719 | 720 |
720 void MediaControlDownloadButtonElement::setIsWanted(bool wanted) { | 721 void MediaControlDownloadButtonElement::setIsWanted(bool wanted) { |
721 MediaControlElement::setIsWanted(wanted); | 722 MediaControlElement::setIsWanted(wanted); |
(...skipping 376 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1098 MediaControlCurrentTimeDisplayElement* | 1099 MediaControlCurrentTimeDisplayElement* |
1099 MediaControlCurrentTimeDisplayElement::create(MediaControls& mediaControls) { | 1100 MediaControlCurrentTimeDisplayElement::create(MediaControls& mediaControls) { |
1100 MediaControlCurrentTimeDisplayElement* element = | 1101 MediaControlCurrentTimeDisplayElement* element = |
1101 new MediaControlCurrentTimeDisplayElement(mediaControls); | 1102 new MediaControlCurrentTimeDisplayElement(mediaControls); |
1102 element->setShadowPseudoId( | 1103 element->setShadowPseudoId( |
1103 AtomicString("-webkit-media-controls-current-time-display")); | 1104 AtomicString("-webkit-media-controls-current-time-display")); |
1104 return element; | 1105 return element; |
1105 } | 1106 } |
1106 | 1107 |
1107 } // namespace blink | 1108 } // namespace blink |
OLD | NEW |