| OLD | NEW |
| 1 /* | 1 /* |
| 2 * Copyright (C) 2011, 2012 Apple Inc. All rights reserved. | 2 * Copyright (C) 2011, 2012 Apple Inc. All rights reserved. |
| 3 * Copyright (C) 2011, 2012 Google Inc. All rights reserved. | 3 * Copyright (C) 2011, 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 * 1. Redistributions of source code must retain the above copyright | 8 * 1. Redistributions of source code must retain the above copyright |
| 9 * notice, this list of conditions and the following disclaimer. | 9 * notice, this list of conditions and the following disclaimer. |
| 10 * 2. Redistributions in binary form must reproduce the above copyright | 10 * 2. Redistributions in binary form must reproduce the above copyright |
| (...skipping 19 matching lines...) Expand all Loading... |
| 30 #include "core/html/HTMLDivElement.h" | 30 #include "core/html/HTMLDivElement.h" |
| 31 #include "core/html/shadow/MediaControlElements.h" | 31 #include "core/html/shadow/MediaControlElements.h" |
| 32 | 32 |
| 33 namespace blink { | 33 namespace blink { |
| 34 | 34 |
| 35 class Event; | 35 class Event; |
| 36 class TextTrackContainer; | 36 class TextTrackContainer; |
| 37 | 37 |
| 38 class CORE_EXPORT MediaControls final : public HTMLDivElement { | 38 class CORE_EXPORT MediaControls final : public HTMLDivElement { |
| 39 public: | 39 public: |
| 40 static PassRefPtrWillBeRawPtr<MediaControls> create(HTMLMediaElement&); | 40 static RawPtr<MediaControls> create(HTMLMediaElement&); |
| 41 | 41 |
| 42 HTMLMediaElement& mediaElement() const { return *m_mediaElement; } | 42 HTMLMediaElement& mediaElement() const { return *m_mediaElement; } |
| 43 | 43 |
| 44 void reset(); | 44 void reset(); |
| 45 | 45 |
| 46 void show(); | 46 void show(); |
| 47 void hide(); | 47 void hide(); |
| 48 | 48 |
| 49 void playbackStarted(); | 49 void playbackStarted(); |
| 50 void playbackProgressed(); | 50 void playbackProgressed(); |
| (...skipping 68 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 119 // Hide elements that don't fit, and show those things that we want which | 119 // Hide elements that don't fit, and show those things that we want which |
| 120 // do fit. This requires that m_panelWidth is current. | 120 // do fit. This requires that m_panelWidth is current. |
| 121 void computeWhichControlsFit(); | 121 void computeWhichControlsFit(); |
| 122 | 122 |
| 123 // Node | 123 // Node |
| 124 bool isMediaControls() const override { return true; } | 124 bool isMediaControls() const override { return true; } |
| 125 bool willRespondToMouseMoveEvents() override { return true; } | 125 bool willRespondToMouseMoveEvents() override { return true; } |
| 126 void defaultEventHandler(Event*) override; | 126 void defaultEventHandler(Event*) override; |
| 127 bool containsRelatedTarget(Event*); | 127 bool containsRelatedTarget(Event*); |
| 128 | 128 |
| 129 RawPtrWillBeMember<HTMLMediaElement> m_mediaElement; | 129 Member<HTMLMediaElement> m_mediaElement; |
| 130 | 130 |
| 131 // Media control elements. | 131 // Media control elements. |
| 132 RawPtrWillBeMember<MediaControlOverlayEnclosureElement> m_overlayEnclosure; | 132 Member<MediaControlOverlayEnclosureElement> m_overlayEnclosure; |
| 133 RawPtrWillBeMember<MediaControlOverlayPlayButtonElement> m_overlayPlayButton
; | 133 Member<MediaControlOverlayPlayButtonElement> m_overlayPlayButton; |
| 134 RawPtrWillBeMember<MediaControlCastButtonElement> m_overlayCastButton; | 134 Member<MediaControlCastButtonElement> m_overlayCastButton; |
| 135 RawPtrWillBeMember<MediaControlPanelEnclosureElement> m_enclosure; | 135 Member<MediaControlPanelEnclosureElement> m_enclosure; |
| 136 RawPtrWillBeMember<MediaControlPanelElement> m_panel; | 136 Member<MediaControlPanelElement> m_panel; |
| 137 RawPtrWillBeMember<MediaControlPlayButtonElement> m_playButton; | 137 Member<MediaControlPlayButtonElement> m_playButton; |
| 138 RawPtrWillBeMember<MediaControlTimelineElement> m_timeline; | 138 Member<MediaControlTimelineElement> m_timeline; |
| 139 RawPtrWillBeMember<MediaControlCurrentTimeDisplayElement> m_currentTimeDispl
ay; | 139 Member<MediaControlCurrentTimeDisplayElement> m_currentTimeDisplay; |
| 140 RawPtrWillBeMember<MediaControlTimeRemainingDisplayElement> m_durationDispla
y; | 140 Member<MediaControlTimeRemainingDisplayElement> m_durationDisplay; |
| 141 RawPtrWillBeMember<MediaControlMuteButtonElement> m_muteButton; | 141 Member<MediaControlMuteButtonElement> m_muteButton; |
| 142 RawPtrWillBeMember<MediaControlVolumeSliderElement> m_volumeSlider; | 142 Member<MediaControlVolumeSliderElement> m_volumeSlider; |
| 143 RawPtrWillBeMember<MediaControlToggleClosedCaptionsButtonElement> m_toggleCl
osedCaptionsButton; | 143 Member<MediaControlToggleClosedCaptionsButtonElement> m_toggleClosedCaptions
Button; |
| 144 RawPtrWillBeMember<MediaControlCastButtonElement> m_castButton; | 144 Member<MediaControlCastButtonElement> m_castButton; |
| 145 RawPtrWillBeMember<MediaControlFullscreenButtonElement> m_fullScreenButton; | 145 Member<MediaControlFullscreenButtonElement> m_fullScreenButton; |
| 146 | 146 |
| 147 Timer<MediaControls> m_hideMediaControlsTimer; | 147 Timer<MediaControls> m_hideMediaControlsTimer; |
| 148 unsigned m_hideTimerBehaviorFlags; | 148 unsigned m_hideTimerBehaviorFlags; |
| 149 bool m_isMouseOverControls : 1; | 149 bool m_isMouseOverControls : 1; |
| 150 bool m_isPausedForScrubbing : 1; | 150 bool m_isPausedForScrubbing : 1; |
| 151 | 151 |
| 152 Timer<MediaControls> m_panelWidthChangedTimer; | 152 Timer<MediaControls> m_panelWidthChangedTimer; |
| 153 int m_panelWidth; | 153 int m_panelWidth; |
| 154 | 154 |
| 155 bool m_allowHiddenVolumeControls : 1; | 155 bool m_allowHiddenVolumeControls : 1; |
| 156 }; | 156 }; |
| 157 | 157 |
| 158 DEFINE_ELEMENT_TYPE_CASTS(MediaControls, isMediaControls()); | 158 DEFINE_ELEMENT_TYPE_CASTS(MediaControls, isMediaControls()); |
| 159 | 159 |
| 160 } // namespace blink | 160 } // namespace blink |
| 161 | 161 |
| 162 #endif | 162 #endif |
| OLD | NEW |