| 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 609 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 620 | 620 |
| 621 void MediaControlOverflowMenuListElement::defaultEventHandler(Event* event) | 621 void MediaControlOverflowMenuListElement::defaultEventHandler(Event* event) |
| 622 { | 622 { |
| 623 if (event->type() == EventTypeNames::click) | 623 if (event->type() == EventTypeNames::click) |
| 624 event->setDefaultHandled(); | 624 event->setDefaultHandled(); |
| 625 | 625 |
| 626 MediaControlDivElement::defaultEventHandler(event); | 626 MediaControlDivElement::defaultEventHandler(event); |
| 627 } | 627 } |
| 628 | 628 |
| 629 // ---------------------------- | 629 // ---------------------------- |
| 630 MediaControlDownloadButtonElement::MediaControlDownloadButtonElement(MediaContro
ls& mediaControls) |
| 631 : MediaControlInputElement(mediaControls, MediaDownloadButton) |
| 632 { |
| 633 } |
| 634 |
| 635 MediaControlDownloadButtonElement* MediaControlDownloadButtonElement::create(Med
iaControls& mediaControls, Document* document) |
| 636 { |
| 637 MediaControlDownloadButtonElement* button = new MediaControlDownloadButtonEl
ement(mediaControls); |
| 638 button->ensureUserAgentShadowRoot(); |
| 639 button->setType(InputTypeNames::button); |
| 640 button->setShadowPseudoId(AtomicString("-internal-download-button")); |
| 641 button->setIsWanted(false); |
| 642 return button; |
| 643 } |
| 644 |
| 645 WebLocalizedString::Name MediaControlDownloadButtonElement::getOverflowStringNam
e() |
| 646 { |
| 647 return WebLocalizedString::OverflowMenuDownload; |
| 648 } |
| 649 |
| 650 bool MediaControlDownloadButtonElement::shouldDisplayDownloadButton() |
| 651 { |
| 652 const KURL& url = mediaElement().currentSrc(); |
| 653 if (!HTMLMediaElement::isMediaStreamURL(url.getString()) && !url.protocolIs(
"blob") && !HTMLMediaSource::lookup(url)) { |
| 654 return true; |
| 655 } |
| 656 return false; |
| 657 } |
| 658 |
| 659 void MediaControlDownloadButtonElement::defaultEventHandler(Event* event) |
| 660 { |
| 661 // TODO(kdsilva): The implementation will be finished as part of |
| 662 // https://crbug.com/601247 |
| 663 } |
| 664 |
| 665 // ---------------------------- |
| 630 | 666 |
| 631 MediaControlTimelineElement::MediaControlTimelineElement(MediaControls& mediaCon
trols) | 667 MediaControlTimelineElement::MediaControlTimelineElement(MediaControls& mediaCon
trols) |
| 632 : MediaControlInputElement(mediaControls, MediaSlider) | 668 : MediaControlInputElement(mediaControls, MediaSlider) |
| 633 { | 669 { |
| 634 } | 670 } |
| 635 | 671 |
| 636 MediaControlTimelineElement* MediaControlTimelineElement::create(MediaControls&
mediaControls) | 672 MediaControlTimelineElement* MediaControlTimelineElement::create(MediaControls&
mediaControls) |
| 637 { | 673 { |
| 638 MediaControlTimelineElement* timeline = new MediaControlTimelineElement(medi
aControls); | 674 MediaControlTimelineElement* timeline = new MediaControlTimelineElement(medi
aControls); |
| 639 timeline->ensureUserAgentShadowRoot(); | 675 timeline->ensureUserAgentShadowRoot(); |
| (...skipping 300 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 940 } | 976 } |
| 941 | 977 |
| 942 MediaControlCurrentTimeDisplayElement* MediaControlCurrentTimeDisplayElement::cr
eate(MediaControls& mediaControls) | 978 MediaControlCurrentTimeDisplayElement* MediaControlCurrentTimeDisplayElement::cr
eate(MediaControls& mediaControls) |
| 943 { | 979 { |
| 944 MediaControlCurrentTimeDisplayElement* element = new MediaControlCurrentTime
DisplayElement(mediaControls); | 980 MediaControlCurrentTimeDisplayElement* element = new MediaControlCurrentTime
DisplayElement(mediaControls); |
| 945 element->setShadowPseudoId(AtomicString("-webkit-media-controls-current-time
-display")); | 981 element->setShadowPseudoId(AtomicString("-webkit-media-controls-current-time
-display")); |
| 946 return element; | 982 return element; |
| 947 } | 983 } |
| 948 | 984 |
| 949 } // namespace blink | 985 } // namespace blink |
| OLD | NEW |