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 MediaControlsWindowEventListener; |
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 67 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
114 }; | 115 }; |
115 | 116 |
116 bool shouldHideMediaControls(unsigned behaviorFlags = 0) const; | 117 bool shouldHideMediaControls(unsigned behaviorFlags = 0) const; |
117 void hideMediaControlsTimerFired(TimerBase*); | 118 void hideMediaControlsTimerFired(TimerBase*); |
118 void startHideMediaControlsTimer(); | 119 void startHideMediaControlsTimer(); |
119 void stopHideMediaControlsTimer(); | 120 void stopHideMediaControlsTimer(); |
120 void resetHideMediaControlsTimer(); | 121 void resetHideMediaControlsTimer(); |
121 | 122 |
122 void panelWidthChangedTimerFired(TimerBase*); | 123 void panelWidthChangedTimerFired(TimerBase*); |
123 | 124 |
| 125 void hideAllMenus(); |
| 126 |
124 // Hide elements that don't fit, and show those things that we want which | 127 // Hide elements that don't fit, and show those things that we want which |
125 // do fit. This requires that m_panelWidth is current. | 128 // do fit. This requires that m_panelWidth is current. |
126 void computeWhichControlsFit(); | 129 void computeWhichControlsFit(); |
127 | 130 |
128 // Node | 131 // Node |
129 bool isMediaControls() const override { return true; } | 132 bool isMediaControls() const override { return true; } |
130 bool willRespondToMouseMoveEvents() override { return true; } | 133 bool willRespondToMouseMoveEvents() override { return true; } |
131 void defaultEventHandler(Event*) override; | 134 void defaultEventHandler(Event*) override; |
132 bool containsRelatedTarget(Event*); | 135 bool containsRelatedTarget(Event*); |
133 | 136 |
(...skipping 14 matching lines...) Expand all Loading... |
148 Member<MediaControlToggleClosedCaptionsButtonElement> | 151 Member<MediaControlToggleClosedCaptionsButtonElement> |
149 m_toggleClosedCaptionsButton; | 152 m_toggleClosedCaptionsButton; |
150 Member<MediaControlTextTrackListElement> m_textTrackList; | 153 Member<MediaControlTextTrackListElement> m_textTrackList; |
151 Member<MediaControlOverflowMenuButtonElement> m_overflowMenu; | 154 Member<MediaControlOverflowMenuButtonElement> m_overflowMenu; |
152 Member<MediaControlOverflowMenuListElement> m_overflowList; | 155 Member<MediaControlOverflowMenuListElement> m_overflowList; |
153 | 156 |
154 Member<MediaControlCastButtonElement> m_castButton; | 157 Member<MediaControlCastButtonElement> m_castButton; |
155 Member<MediaControlFullscreenButtonElement> m_fullscreenButton; | 158 Member<MediaControlFullscreenButtonElement> m_fullscreenButton; |
156 Member<MediaControlDownloadButtonElement> m_downloadButton; | 159 Member<MediaControlDownloadButtonElement> m_downloadButton; |
157 | 160 |
| 161 Member<MediaControlsWindowEventListener> m_windowEventListener; |
| 162 |
158 Timer<MediaControls> m_hideMediaControlsTimer; | 163 Timer<MediaControls> m_hideMediaControlsTimer; |
159 unsigned m_hideTimerBehaviorFlags; | 164 unsigned m_hideTimerBehaviorFlags; |
160 bool m_isMouseOverControls : 1; | 165 bool m_isMouseOverControls : 1; |
161 bool m_isPausedForScrubbing : 1; | 166 bool m_isPausedForScrubbing : 1; |
162 | 167 |
163 Timer<MediaControls> m_panelWidthChangedTimer; | 168 Timer<MediaControls> m_panelWidthChangedTimer; |
164 int m_panelWidth; | 169 int m_panelWidth; |
165 | 170 |
166 bool m_allowHiddenVolumeControls : 1; | 171 bool m_allowHiddenVolumeControls : 1; |
167 }; | 172 }; |
168 | 173 |
169 DEFINE_ELEMENT_TYPE_CASTS(MediaControls, isMediaControls()); | 174 DEFINE_ELEMENT_TYPE_CASTS(MediaControls, isMediaControls()); |
170 | 175 |
171 } // namespace blink | 176 } // namespace blink |
172 | 177 |
173 #endif | 178 #endif |
OLD | NEW |