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 16 matching lines...) Expand all Loading... |
27 #ifndef MediaControls_h | 27 #ifndef MediaControls_h |
28 #define MediaControls_h | 28 #define MediaControls_h |
29 | 29 |
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 class TimeRanges; |
37 | 38 |
38 class CORE_EXPORT MediaControls final : public HTMLDivElement { | 39 class CORE_EXPORT MediaControls final : public HTMLDivElement { |
39 public: | 40 public: |
40 static MediaControls* create(HTMLMediaElement&); | 41 static MediaControls* create(HTMLMediaElement&); |
41 | 42 |
42 HTMLMediaElement& mediaElement() const { return *m_mediaElement; } | 43 HTMLMediaElement& mediaElement() const { return *m_mediaElement; } |
43 | 44 |
44 void reset(); | 45 void reset(); |
45 | 46 |
46 void show(); | 47 void show(); |
(...skipping 73 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
120 // Hide elements that don't fit, and show those things that we want which | 121 // Hide elements that don't fit, and show those things that we want which |
121 // do fit. This requires that m_panelWidth is current. | 122 // do fit. This requires that m_panelWidth is current. |
122 void computeWhichControlsFit(); | 123 void computeWhichControlsFit(); |
123 | 124 |
124 // Node | 125 // Node |
125 bool isMediaControls() const override { return true; } | 126 bool isMediaControls() const override { return true; } |
126 bool willRespondToMouseMoveEvents() override { return true; } | 127 bool willRespondToMouseMoveEvents() override { return true; } |
127 void defaultEventHandler(Event*) override; | 128 void defaultEventHandler(Event*) override; |
128 bool containsRelatedTarget(Event*); | 129 bool containsRelatedTarget(Event*); |
129 | 130 |
| 131 void updateTimelinePosition(); |
| 132 void updateBufferedRanges(); |
| 133 void startOrStopBufferedRangesPaintInvalidationTimer(); |
| 134 void bufferedRangesPaintInvalidationTimerFired(TimerBase*); |
| 135 |
130 Member<HTMLMediaElement> m_mediaElement; | 136 Member<HTMLMediaElement> m_mediaElement; |
131 | 137 |
132 // Media control elements. | 138 // Media control elements. |
133 Member<MediaControlOverlayEnclosureElement> m_overlayEnclosure; | 139 Member<MediaControlOverlayEnclosureElement> m_overlayEnclosure; |
134 Member<MediaControlOverlayPlayButtonElement> m_overlayPlayButton; | 140 Member<MediaControlOverlayPlayButtonElement> m_overlayPlayButton; |
135 Member<MediaControlCastButtonElement> m_overlayCastButton; | 141 Member<MediaControlCastButtonElement> m_overlayCastButton; |
136 Member<MediaControlPanelEnclosureElement> m_enclosure; | 142 Member<MediaControlPanelEnclosureElement> m_enclosure; |
137 Member<MediaControlPanelElement> m_panel; | 143 Member<MediaControlPanelElement> m_panel; |
138 Member<MediaControlPlayButtonElement> m_playButton; | 144 Member<MediaControlPlayButtonElement> m_playButton; |
139 Member<MediaControlTimelineElement> m_timeline; | 145 Member<MediaControlTimelineElement> m_timeline; |
140 Member<MediaControlCurrentTimeDisplayElement> m_currentTimeDisplay; | 146 Member<MediaControlCurrentTimeDisplayElement> m_currentTimeDisplay; |
141 Member<MediaControlTimeRemainingDisplayElement> m_durationDisplay; | 147 Member<MediaControlTimeRemainingDisplayElement> m_durationDisplay; |
142 Member<MediaControlMuteButtonElement> m_muteButton; | 148 Member<MediaControlMuteButtonElement> m_muteButton; |
143 Member<MediaControlVolumeSliderElement> m_volumeSlider; | 149 Member<MediaControlVolumeSliderElement> m_volumeSlider; |
144 Member<MediaControlToggleClosedCaptionsButtonElement> m_toggleClosedCaptions
Button; | 150 Member<MediaControlToggleClosedCaptionsButtonElement> m_toggleClosedCaptions
Button; |
145 Member<MediaControlTextTrackListElement> m_textTrackList; | 151 Member<MediaControlTextTrackListElement> m_textTrackList; |
146 Member<MediaControlCastButtonElement> m_castButton; | 152 Member<MediaControlCastButtonElement> m_castButton; |
147 Member<MediaControlFullscreenButtonElement> m_fullScreenButton; | 153 Member<MediaControlFullscreenButtonElement> m_fullScreenButton; |
148 | 154 |
149 Timer<MediaControls> m_hideMediaControlsTimer; | 155 Timer<MediaControls> m_hideMediaControlsTimer; |
150 unsigned m_hideTimerBehaviorFlags; | 156 unsigned m_hideTimerBehaviorFlags; |
151 bool m_isMouseOverControls : 1; | 157 bool m_isMouseOverControls : 1; |
152 bool m_isPausedForScrubbing : 1; | 158 bool m_isPausedForScrubbing : 1; |
153 | 159 |
154 Timer<MediaControls> m_panelWidthChangedTimer; | 160 Timer<MediaControls> m_panelWidthChangedTimer; |
155 int m_panelWidth; | 161 int m_panelWidth; |
156 | 162 |
157 bool m_allowHiddenVolumeControls : 1; | 163 bool m_allowHiddenVolumeControls : 1; |
| 164 |
| 165 Timer<MediaControls> m_bufferedRangesPaintInvalidationTimer; |
| 166 Member<TimeRanges> m_lastBufferedRanges; |
158 }; | 167 }; |
159 | 168 |
160 DEFINE_ELEMENT_TYPE_CASTS(MediaControls, isMediaControls()); | 169 DEFINE_ELEMENT_TYPE_CASTS(MediaControls, isMediaControls()); |
161 | 170 |
162 } // namespace blink | 171 } // namespace blink |
163 | 172 |
164 #endif | 173 #endif |
OLD | NEW |