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 68 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
79 // Returns the layout object for the part of the controls that should be | 79 // Returns the layout object for the part of the controls that should be |
80 // used for overlap checking during text track layout. May be null. | 80 // used for overlap checking during text track layout. May be null. |
81 LayoutObject* layoutObjectForTextTrackLayout(); | 81 LayoutObject* layoutObjectForTextTrackLayout(); |
82 | 82 |
83 // Notify us that our controls enclosure has changed width. | 83 // Notify us that our controls enclosure has changed width. |
84 void notifyPanelWidthChanged(const LayoutUnit& newWidth); | 84 void notifyPanelWidthChanged(const LayoutUnit& newWidth); |
85 | 85 |
86 // Notify us that the media element's network state has changed. | 86 // Notify us that the media element's network state has changed. |
87 void networkStateChanged(); | 87 void networkStateChanged(); |
88 | 88 |
89 void toggleOverflowMenu(); | |
90 | |
91 bool overflowMenuVisible(); | |
92 | |
93 // Returns a list of all possible controls that can appear in an overflow | |
94 // menu. | |
95 std::vector<MediaControlInputElement*> getOverflowMenuButtons(); | |
liberato (no reviews please)
2016/08/24 16:44:22
perhaps pass by ref to prevent a copy. const ref
kdsilva
2016/08/26 18:11:03
Acknowledged.
| |
96 | |
89 DECLARE_VIRTUAL_TRACE(); | 97 DECLARE_VIRTUAL_TRACE(); |
90 | 98 |
91 private: | 99 private: |
92 void invalidate(Element*); | 100 void invalidate(Element*); |
93 | 101 |
94 class BatchedControlUpdate; | 102 class BatchedControlUpdate; |
95 | 103 |
96 explicit MediaControls(HTMLMediaElement&); | 104 explicit MediaControls(HTMLMediaElement&); |
97 | 105 |
98 void initializeControls(); | 106 void initializeControls(); |
(...skipping 21 matching lines...) Expand all Loading... | |
120 // Hide elements that don't fit, and show those things that we want which | 128 // Hide elements that don't fit, and show those things that we want which |
121 // do fit. This requires that m_panelWidth is current. | 129 // do fit. This requires that m_panelWidth is current. |
122 void computeWhichControlsFit(); | 130 void computeWhichControlsFit(); |
123 | 131 |
124 // Node | 132 // Node |
125 bool isMediaControls() const override { return true; } | 133 bool isMediaControls() const override { return true; } |
126 bool willRespondToMouseMoveEvents() override { return true; } | 134 bool willRespondToMouseMoveEvents() override { return true; } |
127 void defaultEventHandler(Event*) override; | 135 void defaultEventHandler(Event*) override; |
128 bool containsRelatedTarget(Event*); | 136 bool containsRelatedTarget(Event*); |
129 | 137 |
138 std::vector<MediaControlInputElement*> controlsListOverflow; | |
139 | |
130 Member<HTMLMediaElement> m_mediaElement; | 140 Member<HTMLMediaElement> m_mediaElement; |
131 | 141 |
132 // Media control elements. | 142 // Media control elements. |
133 Member<MediaControlOverlayEnclosureElement> m_overlayEnclosure; | 143 Member<MediaControlOverlayEnclosureElement> m_overlayEnclosure; |
134 Member<MediaControlOverlayPlayButtonElement> m_overlayPlayButton; | 144 Member<MediaControlOverlayPlayButtonElement> m_overlayPlayButton; |
135 Member<MediaControlCastButtonElement> m_overlayCastButton; | 145 Member<MediaControlCastButtonElement> m_overlayCastButton; |
136 Member<MediaControlPanelEnclosureElement> m_enclosure; | 146 Member<MediaControlPanelEnclosureElement> m_enclosure; |
137 Member<MediaControlPanelElement> m_panel; | 147 Member<MediaControlPanelElement> m_panel; |
138 Member<MediaControlPlayButtonElement> m_playButton; | 148 Member<MediaControlPlayButtonElement> m_playButton; |
139 Member<MediaControlTimelineElement> m_timeline; | 149 Member<MediaControlTimelineElement> m_timeline; |
140 Member<MediaControlCurrentTimeDisplayElement> m_currentTimeDisplay; | 150 Member<MediaControlCurrentTimeDisplayElement> m_currentTimeDisplay; |
141 Member<MediaControlTimeRemainingDisplayElement> m_durationDisplay; | 151 Member<MediaControlTimeRemainingDisplayElement> m_durationDisplay; |
142 Member<MediaControlMuteButtonElement> m_muteButton; | 152 Member<MediaControlMuteButtonElement> m_muteButton; |
143 Member<MediaControlVolumeSliderElement> m_volumeSlider; | 153 Member<MediaControlVolumeSliderElement> m_volumeSlider; |
144 Member<MediaControlToggleClosedCaptionsButtonElement> m_toggleClosedCaptions Button; | 154 Member<MediaControlToggleClosedCaptionsButtonElement> m_toggleClosedCaptions Button; |
145 Member<MediaControlTextTrackListElement> m_textTrackList; | 155 Member<MediaControlTextTrackListElement> m_textTrackList; |
156 Member<MediaControlOverflowMenu> m_overflowMenu; | |
157 Member<MediaControlOverflowMenuListElement> m_overflowList; | |
158 Member<MediaControlMuteButtonElement> m_muteOverflowButton; | |
159 Member<MediaControlCastButtonElement> m_castOverflowButton; | |
160 Member<MediaControlToggleClosedCaptionsButtonElement> m_closedCaptionsOverfl owButton; | |
161 Member<MediaControlFullscreenButtonElement> m_fullscreenOverflowButton; | |
162 | |
146 Member<MediaControlCastButtonElement> m_castButton; | 163 Member<MediaControlCastButtonElement> m_castButton; |
147 Member<MediaControlFullscreenButtonElement> m_fullScreenButton; | 164 Member<MediaControlFullscreenButtonElement> m_fullScreenButton; |
148 | 165 |
149 Timer<MediaControls> m_hideMediaControlsTimer; | 166 Timer<MediaControls> m_hideMediaControlsTimer; |
150 unsigned m_hideTimerBehaviorFlags; | 167 unsigned m_hideTimerBehaviorFlags; |
151 bool m_isMouseOverControls : 1; | 168 bool m_isMouseOverControls : 1; |
152 bool m_isPausedForScrubbing : 1; | 169 bool m_isPausedForScrubbing : 1; |
153 | 170 |
154 Timer<MediaControls> m_panelWidthChangedTimer; | 171 Timer<MediaControls> m_panelWidthChangedTimer; |
155 int m_panelWidth; | 172 int m_panelWidth; |
156 | 173 |
157 bool m_allowHiddenVolumeControls : 1; | 174 bool m_allowHiddenVolumeControls : 1; |
158 }; | 175 }; |
159 | 176 |
160 DEFINE_ELEMENT_TYPE_CASTS(MediaControls, isMediaControls()); | 177 DEFINE_ELEMENT_TYPE_CASTS(MediaControls, isMediaControls()); |
161 | 178 |
162 } // namespace blink | 179 } // namespace blink |
163 | 180 |
164 #endif | 181 #endif |
OLD | NEW |