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 15 matching lines...) Expand all Loading... |
26 | 26 |
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 | 37 |
37 class MediaControls final : public HTMLDivElement { | 38 class MediaControls final : public HTMLDivElement { |
38 public: | 39 public: |
39 static PassRefPtrWillBeRawPtr<MediaControls> create(HTMLMediaElement&); | 40 static PassRefPtrWillBeRawPtr<MediaControls> create(HTMLMediaElement&); |
40 | 41 |
41 HTMLMediaElement& mediaElement() const { return *m_mediaElement; } | 42 HTMLMediaElement& mediaElement() const { return *m_mediaElement; } |
42 | 43 |
43 void reset(); | 44 void reset(); |
44 | 45 |
45 void show(); | 46 void show(); |
(...skipping 14 matching lines...) Expand all Loading... |
60 void refreshClosedCaptionsButtonVisibility(); | 61 void refreshClosedCaptionsButtonVisibility(); |
61 | 62 |
62 void enteredFullscreen(); | 63 void enteredFullscreen(); |
63 void exitedFullscreen(); | 64 void exitedFullscreen(); |
64 | 65 |
65 void startedCasting(); | 66 void startedCasting(); |
66 void stoppedCasting(); | 67 void stoppedCasting(); |
67 void refreshCastButtonVisibility(); | 68 void refreshCastButtonVisibility(); |
68 void showOverlayCastButton(); | 69 void showOverlayCastButton(); |
69 | 70 |
70 void updateTextTrackDisplay(); | 71 TextTrackContainer* textTrackContainer(); |
71 | 72 |
72 void mediaElementFocused(); | 73 void mediaElementFocused(); |
73 | 74 |
74 DECLARE_VIRTUAL_TRACE(); | 75 DECLARE_VIRTUAL_TRACE(); |
75 | 76 |
76 private: | 77 private: |
77 explicit MediaControls(HTMLMediaElement&); | 78 explicit MediaControls(HTMLMediaElement&); |
78 | 79 |
79 void initializeControls(); | 80 void initializeControls(); |
80 | 81 |
(...skipping 12 matching lines...) Expand all Loading... |
93 bool shouldHideMediaControls(unsigned behaviorFlags = 0) const; | 94 bool shouldHideMediaControls(unsigned behaviorFlags = 0) const; |
94 void hideMediaControlsTimerFired(Timer<MediaControls>*); | 95 void hideMediaControlsTimerFired(Timer<MediaControls>*); |
95 void startHideMediaControlsTimer(); | 96 void startHideMediaControlsTimer(); |
96 void stopHideMediaControlsTimer(); | 97 void stopHideMediaControlsTimer(); |
97 void resetHideMediaControlsTimer(); | 98 void resetHideMediaControlsTimer(); |
98 | 99 |
99 // Attempts to show the overlay cast button. If it is covered by another | 100 // Attempts to show the overlay cast button. If it is covered by another |
100 // element in the page, it will be hidden. | 101 // element in the page, it will be hidden. |
101 void tryShowOverlayCastButton(); | 102 void tryShowOverlayCastButton(); |
102 | 103 |
103 void createTextTrackDisplay(); | |
104 | |
105 // Node | 104 // Node |
106 virtual bool isMediaControls() const override { return true; } | 105 virtual bool isMediaControls() const override { return true; } |
107 virtual bool willRespondToMouseMoveEvents() override { return true; } | 106 virtual bool willRespondToMouseMoveEvents() override { return true; } |
108 virtual void defaultEventHandler(Event*) override; | 107 virtual void defaultEventHandler(Event*) override; |
109 bool containsRelatedTarget(Event*); | 108 bool containsRelatedTarget(Event*); |
110 | 109 |
111 RawPtrWillBeMember<HTMLMediaElement> m_mediaElement; | 110 RawPtrWillBeMember<HTMLMediaElement> m_mediaElement; |
112 | 111 |
113 // Container for the media control elements. | 112 // Container for the media control elements. |
114 RawPtrWillBeMember<MediaControlPanelElement> m_panel; | 113 RawPtrWillBeMember<MediaControlPanelElement> m_panel; |
115 | 114 |
116 // Container for the text track cues. | 115 // Container for the text track cues. |
117 RawPtrWillBeMember<MediaControlTextTrackContainerElement> m_textDisplayConta
iner; | 116 RawPtrWillBeMember<TextTrackContainer> m_textTrackContainer; |
118 | 117 |
119 // Media control elements. | 118 // Media control elements. |
120 RawPtrWillBeMember<MediaControlOverlayPlayButtonElement> m_overlayPlayButton
; | 119 RawPtrWillBeMember<MediaControlOverlayPlayButtonElement> m_overlayPlayButton
; |
121 RawPtrWillBeMember<MediaControlOverlayEnclosureElement> m_overlayEnclosure; | 120 RawPtrWillBeMember<MediaControlOverlayEnclosureElement> m_overlayEnclosure; |
122 RawPtrWillBeMember<MediaControlPlayButtonElement> m_playButton; | 121 RawPtrWillBeMember<MediaControlPlayButtonElement> m_playButton; |
123 RawPtrWillBeMember<MediaControlCurrentTimeDisplayElement> m_currentTimeDispl
ay; | 122 RawPtrWillBeMember<MediaControlCurrentTimeDisplayElement> m_currentTimeDispl
ay; |
124 RawPtrWillBeMember<MediaControlTimelineElement> m_timeline; | 123 RawPtrWillBeMember<MediaControlTimelineElement> m_timeline; |
125 RawPtrWillBeMember<MediaControlMuteButtonElement> m_muteButton; | 124 RawPtrWillBeMember<MediaControlMuteButtonElement> m_muteButton; |
126 RawPtrWillBeMember<MediaControlVolumeSliderElement> m_volumeSlider; | 125 RawPtrWillBeMember<MediaControlVolumeSliderElement> m_volumeSlider; |
127 RawPtrWillBeMember<MediaControlToggleClosedCaptionsButtonElement> m_toggleCl
osedCaptionsButton; | 126 RawPtrWillBeMember<MediaControlToggleClosedCaptionsButtonElement> m_toggleCl
osedCaptionsButton; |
128 RawPtrWillBeMember<MediaControlFullscreenButtonElement> m_fullScreenButton; | 127 RawPtrWillBeMember<MediaControlFullscreenButtonElement> m_fullScreenButton; |
129 RawPtrWillBeMember<MediaControlCastButtonElement> m_castButton; | 128 RawPtrWillBeMember<MediaControlCastButtonElement> m_castButton; |
130 RawPtrWillBeMember<MediaControlCastButtonElement> m_overlayCastButton; | 129 RawPtrWillBeMember<MediaControlCastButtonElement> m_overlayCastButton; |
131 RawPtrWillBeMember<MediaControlTimeRemainingDisplayElement> m_durationDispla
y; | 130 RawPtrWillBeMember<MediaControlTimeRemainingDisplayElement> m_durationDispla
y; |
132 RawPtrWillBeMember<MediaControlPanelEnclosureElement> m_enclosure; | 131 RawPtrWillBeMember<MediaControlPanelEnclosureElement> m_enclosure; |
133 | 132 |
134 Timer<MediaControls> m_hideMediaControlsTimer; | 133 Timer<MediaControls> m_hideMediaControlsTimer; |
135 unsigned m_hideTimerBehaviorFlags; | 134 unsigned m_hideTimerBehaviorFlags; |
136 bool m_isMouseOverControls : 1; | 135 bool m_isMouseOverControls : 1; |
137 bool m_isPausedForScrubbing : 1; | 136 bool m_isPausedForScrubbing : 1; |
138 }; | 137 }; |
139 | 138 |
140 DEFINE_ELEMENT_TYPE_CASTS(MediaControls, isMediaControls()); | 139 DEFINE_ELEMENT_TYPE_CASTS(MediaControls, isMediaControls()); |
141 | 140 |
142 } | 141 } |
143 | 142 |
144 #endif | 143 #endif |
OLD | NEW |