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 217 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
228 panel->appendChild(toggleClosedCaptionsButton); | 228 panel->appendChild(toggleClosedCaptionsButton); |
229 | 229 |
230 MediaControlCastButtonElement* castButton = MediaControlCastButtonElement::c
reate(*this, false); | 230 MediaControlCastButtonElement* castButton = MediaControlCastButtonElement::c
reate(*this, false); |
231 m_castButton = castButton; | 231 m_castButton = castButton; |
232 panel->appendChild(castButton); | 232 panel->appendChild(castButton); |
233 | 233 |
234 MediaControlFullscreenButtonElement* fullscreenButton = MediaControlFullscre
enButtonElement::create(*this); | 234 MediaControlFullscreenButtonElement* fullscreenButton = MediaControlFullscre
enButtonElement::create(*this); |
235 m_fullscreenButton = fullscreenButton; | 235 m_fullscreenButton = fullscreenButton; |
236 panel->appendChild(fullscreenButton); | 236 panel->appendChild(fullscreenButton); |
237 | 237 |
238 MediaControlDownloadButtonElement* downloadButton = MediaControlDownloadButt
onElement::create(*this, &document()); | 238 MediaControlDownloadButtonElement* downloadButton = MediaControlDownloadButt
onElement::create(*this); |
239 m_downloadButton = downloadButton; | 239 m_downloadButton = downloadButton; |
240 panel->appendChild(downloadButton); | 240 panel->appendChild(downloadButton); |
241 | 241 |
242 m_panel = panel; | 242 m_panel = panel; |
243 enclosure->appendChild(panel); | 243 enclosure->appendChild(panel); |
244 | 244 |
245 m_enclosure = enclosure; | 245 m_enclosure = enclosure; |
246 appendChild(enclosure); | 246 appendChild(enclosure); |
247 | 247 |
248 MediaControlTextTrackListElement* textTrackList = MediaControlTextTrackListE
lement::create(*this); | 248 MediaControlTextTrackListElement* textTrackList = MediaControlTextTrackListE
lement::create(*this); |
249 m_textTrackList = textTrackList; | 249 m_textTrackList = textTrackList; |
250 appendChild(textTrackList); | 250 appendChild(textTrackList); |
251 | 251 |
252 MediaControlOverflowMenuButtonElement* overflowMenu = MediaControlOverflowMe
nuButtonElement::create(*this); | 252 MediaControlOverflowMenuButtonElement* overflowMenu = MediaControlOverflowMe
nuButtonElement::create(*this); |
253 m_overflowMenu = overflowMenu; | 253 m_overflowMenu = overflowMenu; |
254 panel->appendChild(overflowMenu); | 254 panel->appendChild(overflowMenu); |
255 | 255 |
256 MediaControlOverflowMenuListElement* overflowList = MediaControlOverflowMenu
ListElement::create(*this); | 256 MediaControlOverflowMenuListElement* overflowList = MediaControlOverflowMenu
ListElement::create(*this); |
257 m_overflowList = overflowList; | 257 m_overflowList = overflowList; |
258 appendChild(overflowList); | 258 appendChild(overflowList); |
259 | 259 |
260 // The order in which we append elements to the overflow list does matter. | 260 // The order in which we append elements to the overflow list does matter. |
261 m_overflowList->appendChild(m_muteButton->createOverflowElement(*this, Media
ControlMuteButtonElement::create(*this))); | 261 m_overflowList->appendChild(m_muteButton->createOverflowElement(*this, Media
ControlMuteButtonElement::create(*this))); |
262 m_overflowList->appendChild(m_castButton->createOverflowElement(*this, Media
ControlCastButtonElement::create(*this, false))); | 262 m_overflowList->appendChild(m_castButton->createOverflowElement(*this, Media
ControlCastButtonElement::create(*this, false))); |
263 m_overflowList->appendChild(m_toggleClosedCaptionsButton->createOverflowElem
ent(*this, MediaControlToggleClosedCaptionsButtonElement::create(*this))); | 263 m_overflowList->appendChild(m_toggleClosedCaptionsButton->createOverflowElem
ent(*this, MediaControlToggleClosedCaptionsButtonElement::create(*this))); |
264 m_overflowList->appendChild(m_fullscreenButton->createOverflowElement(*this,
MediaControlFullscreenButtonElement::create(*this))); | 264 m_overflowList->appendChild(m_fullscreenButton->createOverflowElement(*this,
MediaControlFullscreenButtonElement::create(*this))); |
265 m_overflowList->appendChild(m_playButton->createOverflowElement(*this, Media
ControlPlayButtonElement::create(*this))); | 265 m_overflowList->appendChild(m_playButton->createOverflowElement(*this, Media
ControlPlayButtonElement::create(*this))); |
266 m_overflowList->appendChild(m_downloadButton->createOverflowElement(*this, M
ediaControlDownloadButtonElement::create(*this, &document()))); | 266 m_overflowList->appendChild(m_downloadButton->createOverflowElement(*this, M
ediaControlDownloadButtonElement::create(*this))); |
267 } | 267 } |
268 | 268 |
269 void MediaControls::reset() | 269 void MediaControls::reset() |
270 { | 270 { |
271 EventDispatchForbiddenScope::AllowUserAgentEvents allowEventsInShadow; | 271 EventDispatchForbiddenScope::AllowUserAgentEvents allowEventsInShadow; |
272 const bool useNewUi = RuntimeEnabledFeatures::newMediaPlaybackUiEnabled(); | 272 const bool useNewUi = RuntimeEnabledFeatures::newMediaPlaybackUiEnabled(); |
273 BatchedControlUpdate batch(this); | 273 BatchedControlUpdate batch(this); |
274 | 274 |
275 m_allowHiddenVolumeControls = useNewUi; | 275 m_allowHiddenVolumeControls = useNewUi; |
276 | 276 |
(...skipping 590 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
867 visitor->trace(m_enclosure); | 867 visitor->trace(m_enclosure); |
868 visitor->trace(m_textTrackList); | 868 visitor->trace(m_textTrackList); |
869 visitor->trace(m_overflowMenu); | 869 visitor->trace(m_overflowMenu); |
870 visitor->trace(m_overflowList); | 870 visitor->trace(m_overflowList); |
871 visitor->trace(m_castButton); | 871 visitor->trace(m_castButton); |
872 visitor->trace(m_overlayCastButton); | 872 visitor->trace(m_overlayCastButton); |
873 HTMLDivElement::trace(visitor); | 873 HTMLDivElement::trace(visitor); |
874 } | 874 } |
875 | 875 |
876 } // namespace blink | 876 } // namespace blink |
OLD | NEW |