| OLD | NEW |
| 1 /* | 1 /* |
| 2 * Copyright (C) 2008, 2009, 2010, 2011 Apple Inc. All rights reserved. | 2 * Copyright (C) 2008, 2009, 2010, 2011 Apple Inc. All rights reserved. |
| 3 * Copyright (C) 2012 Google Inc. All rights reserved. | 3 * Copyright (C) 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 * | 8 * |
| 9 * 1. Redistributions of source code must retain the above copyright | 9 * 1. Redistributions of source code must retain the above copyright |
| 10 * notice, this list of conditions and the following disclaimer. | 10 * notice, this list of conditions and the following disclaimer. |
| (...skipping 88 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 99 : MediaControlDivElement(mediaControls, MediaControlsPanel) | 99 : MediaControlDivElement(mediaControls, MediaControlsPanel) |
| 100 , m_isDisplayed(false) | 100 , m_isDisplayed(false) |
| 101 , m_opaque(true) | 101 , m_opaque(true) |
| 102 , m_transitionTimer(this, &MediaControlPanelElement::transitionTimerFired) | 102 , m_transitionTimer(this, &MediaControlPanelElement::transitionTimerFired) |
| 103 { | 103 { |
| 104 } | 104 } |
| 105 | 105 |
| 106 PassRefPtrWillBeRawPtr<MediaControlPanelElement> MediaControlPanelElement::creat
e(MediaControls& mediaControls) | 106 PassRefPtrWillBeRawPtr<MediaControlPanelElement> MediaControlPanelElement::creat
e(MediaControls& mediaControls) |
| 107 { | 107 { |
| 108 RefPtrWillBeRawPtr<MediaControlPanelElement> panel = adoptRefWillBeNoop(new
MediaControlPanelElement(mediaControls)); | 108 RefPtrWillBeRawPtr<MediaControlPanelElement> panel = adoptRefWillBeNoop(new
MediaControlPanelElement(mediaControls)); |
| 109 panel->setShadowPseudoId(AtomicString("-webkit-media-controls-panel", Atomic
String::ConstructFromLiteral)); | 109 panel->setShadowPseudoId(AtomicString("-webkit-media-controls-panel")); |
| 110 return panel.release(); | 110 return panel.release(); |
| 111 } | 111 } |
| 112 | 112 |
| 113 void MediaControlPanelElement::defaultEventHandler(Event* event) | 113 void MediaControlPanelElement::defaultEventHandler(Event* event) |
| 114 { | 114 { |
| 115 // Suppress the media element activation behavior (toggle play/pause) when | 115 // Suppress the media element activation behavior (toggle play/pause) when |
| 116 // any part of the control panel is clicked. | 116 // any part of the control panel is clicked. |
| 117 if (event->type() == EventTypeNames::click) { | 117 if (event->type() == EventTypeNames::click) { |
| 118 event->setDefaultHandled(); | 118 event->setDefaultHandled(); |
| 119 return; | 119 return; |
| (...skipping 76 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 196 | 196 |
| 197 MediaControlPanelEnclosureElement::MediaControlPanelEnclosureElement(MediaContro
ls& mediaControls) | 197 MediaControlPanelEnclosureElement::MediaControlPanelEnclosureElement(MediaContro
ls& mediaControls) |
| 198 // Mapping onto same MediaControlElementType as panel element, since it has
similar properties. | 198 // Mapping onto same MediaControlElementType as panel element, since it has
similar properties. |
| 199 : MediaControlDivElement(mediaControls, MediaControlsPanel) | 199 : MediaControlDivElement(mediaControls, MediaControlsPanel) |
| 200 { | 200 { |
| 201 } | 201 } |
| 202 | 202 |
| 203 PassRefPtrWillBeRawPtr<MediaControlPanelEnclosureElement> MediaControlPanelEnclo
sureElement::create(MediaControls& mediaControls) | 203 PassRefPtrWillBeRawPtr<MediaControlPanelEnclosureElement> MediaControlPanelEnclo
sureElement::create(MediaControls& mediaControls) |
| 204 { | 204 { |
| 205 RefPtrWillBeRawPtr<MediaControlPanelEnclosureElement> enclosure = adoptRefWi
llBeNoop(new MediaControlPanelEnclosureElement(mediaControls)); | 205 RefPtrWillBeRawPtr<MediaControlPanelEnclosureElement> enclosure = adoptRefWi
llBeNoop(new MediaControlPanelEnclosureElement(mediaControls)); |
| 206 enclosure->setShadowPseudoId(AtomicString("-webkit-media-controls-enclosure"
, AtomicString::ConstructFromLiteral)); | 206 enclosure->setShadowPseudoId(AtomicString("-webkit-media-controls-enclosure"
)); |
| 207 return enclosure.release(); | 207 return enclosure.release(); |
| 208 } | 208 } |
| 209 | 209 |
| 210 // ---------------------------- | 210 // ---------------------------- |
| 211 | 211 |
| 212 MediaControlOverlayEnclosureElement::MediaControlOverlayEnclosureElement(MediaCo
ntrols& mediaControls) | 212 MediaControlOverlayEnclosureElement::MediaControlOverlayEnclosureElement(MediaCo
ntrols& mediaControls) |
| 213 // Mapping onto same MediaControlElementType as panel element, since it has
similar properties. | 213 // Mapping onto same MediaControlElementType as panel element, since it has
similar properties. |
| 214 : MediaControlDivElement(mediaControls, MediaControlsPanel) | 214 : MediaControlDivElement(mediaControls, MediaControlsPanel) |
| 215 { | 215 { |
| 216 } | 216 } |
| 217 | 217 |
| 218 PassRefPtrWillBeRawPtr<MediaControlOverlayEnclosureElement> MediaControlOverlayE
nclosureElement::create(MediaControls& mediaControls) | 218 PassRefPtrWillBeRawPtr<MediaControlOverlayEnclosureElement> MediaControlOverlayE
nclosureElement::create(MediaControls& mediaControls) |
| 219 { | 219 { |
| 220 RefPtrWillBeRawPtr<MediaControlOverlayEnclosureElement> enclosure = adoptRef
WillBeNoop(new MediaControlOverlayEnclosureElement(mediaControls)); | 220 RefPtrWillBeRawPtr<MediaControlOverlayEnclosureElement> enclosure = adoptRef
WillBeNoop(new MediaControlOverlayEnclosureElement(mediaControls)); |
| 221 enclosure->setShadowPseudoId(AtomicString("-webkit-media-controls-overlay-en
closure", AtomicString::ConstructFromLiteral)); | 221 enclosure->setShadowPseudoId(AtomicString("-webkit-media-controls-overlay-en
closure")); |
| 222 return enclosure.release(); | 222 return enclosure.release(); |
| 223 } | 223 } |
| 224 | 224 |
| 225 void* MediaControlOverlayEnclosureElement::preDispatchEventHandler(Event* event) | 225 void* MediaControlOverlayEnclosureElement::preDispatchEventHandler(Event* event) |
| 226 { | 226 { |
| 227 // When the media element is clicked or touched we want to make the overlay
cast button visible | 227 // When the media element is clicked or touched we want to make the overlay
cast button visible |
| 228 // (if the other requirements are right) even if JavaScript is doing its own
handling of the event. | 228 // (if the other requirements are right) even if JavaScript is doing its own
handling of the event. |
| 229 // Doing it in preDispatchEventHandler prevents any interference from JavaSc
ript. | 229 // Doing it in preDispatchEventHandler prevents any interference from JavaSc
ript. |
| 230 // Note that we can't simply test for click, since JS handling of touch even
ts can prevent their translation to click events. | 230 // Note that we can't simply test for click, since JS handling of touch even
ts can prevent their translation to click events. |
| 231 if (event && (event->type() == EventTypeNames::click || event->type() == Eve
ntTypeNames::touchstart)) | 231 if (event && (event->type() == EventTypeNames::click || event->type() == Eve
ntTypeNames::touchstart)) |
| 232 mediaControls().showOverlayCastButtonIfNeeded(); | 232 mediaControls().showOverlayCastButtonIfNeeded(); |
| 233 return MediaControlDivElement::preDispatchEventHandler(event); | 233 return MediaControlDivElement::preDispatchEventHandler(event); |
| 234 } | 234 } |
| 235 | 235 |
| 236 | 236 |
| 237 // ---------------------------- | 237 // ---------------------------- |
| 238 | 238 |
| 239 MediaControlMuteButtonElement::MediaControlMuteButtonElement(MediaControls& medi
aControls) | 239 MediaControlMuteButtonElement::MediaControlMuteButtonElement(MediaControls& medi
aControls) |
| 240 : MediaControlInputElement(mediaControls, MediaMuteButton) | 240 : MediaControlInputElement(mediaControls, MediaMuteButton) |
| 241 { | 241 { |
| 242 } | 242 } |
| 243 | 243 |
| 244 PassRefPtrWillBeRawPtr<MediaControlMuteButtonElement> MediaControlMuteButtonElem
ent::create(MediaControls& mediaControls) | 244 PassRefPtrWillBeRawPtr<MediaControlMuteButtonElement> MediaControlMuteButtonElem
ent::create(MediaControls& mediaControls) |
| 245 { | 245 { |
| 246 RefPtrWillBeRawPtr<MediaControlMuteButtonElement> button = adoptRefWillBeNoo
p(new MediaControlMuteButtonElement(mediaControls)); | 246 RefPtrWillBeRawPtr<MediaControlMuteButtonElement> button = adoptRefWillBeNoo
p(new MediaControlMuteButtonElement(mediaControls)); |
| 247 button->ensureUserAgentShadowRoot(); | 247 button->ensureUserAgentShadowRoot(); |
| 248 button->setType(InputTypeNames::button); | 248 button->setType(InputTypeNames::button); |
| 249 button->setShadowPseudoId(AtomicString("-webkit-media-controls-mute-button",
AtomicString::ConstructFromLiteral)); | 249 button->setShadowPseudoId(AtomicString("-webkit-media-controls-mute-button")
); |
| 250 return button.release(); | 250 return button.release(); |
| 251 } | 251 } |
| 252 | 252 |
| 253 void MediaControlMuteButtonElement::defaultEventHandler(Event* event) | 253 void MediaControlMuteButtonElement::defaultEventHandler(Event* event) |
| 254 { | 254 { |
| 255 if (event->type() == EventTypeNames::click) { | 255 if (event->type() == EventTypeNames::click) { |
| 256 mediaElement().setMuted(!mediaElement().muted()); | 256 mediaElement().setMuted(!mediaElement().muted()); |
| 257 event->setDefaultHandled(); | 257 event->setDefaultHandled(); |
| 258 } | 258 } |
| 259 | 259 |
| (...skipping 10 matching lines...) Expand all Loading... |
| 270 MediaControlPlayButtonElement::MediaControlPlayButtonElement(MediaControls& medi
aControls) | 270 MediaControlPlayButtonElement::MediaControlPlayButtonElement(MediaControls& medi
aControls) |
| 271 : MediaControlInputElement(mediaControls, MediaPlayButton) | 271 : MediaControlInputElement(mediaControls, MediaPlayButton) |
| 272 { | 272 { |
| 273 } | 273 } |
| 274 | 274 |
| 275 PassRefPtrWillBeRawPtr<MediaControlPlayButtonElement> MediaControlPlayButtonElem
ent::create(MediaControls& mediaControls) | 275 PassRefPtrWillBeRawPtr<MediaControlPlayButtonElement> MediaControlPlayButtonElem
ent::create(MediaControls& mediaControls) |
| 276 { | 276 { |
| 277 RefPtrWillBeRawPtr<MediaControlPlayButtonElement> button = adoptRefWillBeNoo
p(new MediaControlPlayButtonElement(mediaControls)); | 277 RefPtrWillBeRawPtr<MediaControlPlayButtonElement> button = adoptRefWillBeNoo
p(new MediaControlPlayButtonElement(mediaControls)); |
| 278 button->ensureUserAgentShadowRoot(); | 278 button->ensureUserAgentShadowRoot(); |
| 279 button->setType(InputTypeNames::button); | 279 button->setType(InputTypeNames::button); |
| 280 button->setShadowPseudoId(AtomicString("-webkit-media-controls-play-button",
AtomicString::ConstructFromLiteral)); | 280 button->setShadowPseudoId(AtomicString("-webkit-media-controls-play-button")
); |
| 281 return button.release(); | 281 return button.release(); |
| 282 } | 282 } |
| 283 | 283 |
| 284 void MediaControlPlayButtonElement::defaultEventHandler(Event* event) | 284 void MediaControlPlayButtonElement::defaultEventHandler(Event* event) |
| 285 { | 285 { |
| 286 if (event->type() == EventTypeNames::click) { | 286 if (event->type() == EventTypeNames::click) { |
| 287 mediaElement().togglePlayState(); | 287 mediaElement().togglePlayState(); |
| 288 updateDisplayType(); | 288 updateDisplayType(); |
| 289 event->setDefaultHandled(); | 289 event->setDefaultHandled(); |
| 290 } | 290 } |
| (...skipping 10 matching lines...) Expand all Loading... |
| 301 MediaControlOverlayPlayButtonElement::MediaControlOverlayPlayButtonElement(Media
Controls& mediaControls) | 301 MediaControlOverlayPlayButtonElement::MediaControlOverlayPlayButtonElement(Media
Controls& mediaControls) |
| 302 : MediaControlInputElement(mediaControls, MediaOverlayPlayButton) | 302 : MediaControlInputElement(mediaControls, MediaOverlayPlayButton) |
| 303 { | 303 { |
| 304 } | 304 } |
| 305 | 305 |
| 306 PassRefPtrWillBeRawPtr<MediaControlOverlayPlayButtonElement> MediaControlOverlay
PlayButtonElement::create(MediaControls& mediaControls) | 306 PassRefPtrWillBeRawPtr<MediaControlOverlayPlayButtonElement> MediaControlOverlay
PlayButtonElement::create(MediaControls& mediaControls) |
| 307 { | 307 { |
| 308 RefPtrWillBeRawPtr<MediaControlOverlayPlayButtonElement> button = adoptRefWi
llBeNoop(new MediaControlOverlayPlayButtonElement(mediaControls)); | 308 RefPtrWillBeRawPtr<MediaControlOverlayPlayButtonElement> button = adoptRefWi
llBeNoop(new MediaControlOverlayPlayButtonElement(mediaControls)); |
| 309 button->ensureUserAgentShadowRoot(); | 309 button->ensureUserAgentShadowRoot(); |
| 310 button->setType(InputTypeNames::button); | 310 button->setType(InputTypeNames::button); |
| 311 button->setShadowPseudoId(AtomicString("-webkit-media-controls-overlay-play-
button", AtomicString::ConstructFromLiteral)); | 311 button->setShadowPseudoId(AtomicString("-webkit-media-controls-overlay-play-
button")); |
| 312 return button.release(); | 312 return button.release(); |
| 313 } | 313 } |
| 314 | 314 |
| 315 void MediaControlOverlayPlayButtonElement::defaultEventHandler(Event* event) | 315 void MediaControlOverlayPlayButtonElement::defaultEventHandler(Event* event) |
| 316 { | 316 { |
| 317 if (event->type() == EventTypeNames::click && mediaElement().paused()) { | 317 if (event->type() == EventTypeNames::click && mediaElement().paused()) { |
| 318 mediaElement().play(); | 318 mediaElement().play(); |
| 319 updateDisplayType(); | 319 updateDisplayType(); |
| 320 event->setDefaultHandled(); | 320 event->setDefaultHandled(); |
| 321 } | 321 } |
| (...skipping 15 matching lines...) Expand all Loading... |
| 337 MediaControlToggleClosedCaptionsButtonElement::MediaControlToggleClosedCaptionsB
uttonElement(MediaControls& mediaControls) | 337 MediaControlToggleClosedCaptionsButtonElement::MediaControlToggleClosedCaptionsB
uttonElement(MediaControls& mediaControls) |
| 338 : MediaControlInputElement(mediaControls, MediaShowClosedCaptionsButton) | 338 : MediaControlInputElement(mediaControls, MediaShowClosedCaptionsButton) |
| 339 { | 339 { |
| 340 } | 340 } |
| 341 | 341 |
| 342 PassRefPtrWillBeRawPtr<MediaControlToggleClosedCaptionsButtonElement> MediaContr
olToggleClosedCaptionsButtonElement::create(MediaControls& mediaControls) | 342 PassRefPtrWillBeRawPtr<MediaControlToggleClosedCaptionsButtonElement> MediaContr
olToggleClosedCaptionsButtonElement::create(MediaControls& mediaControls) |
| 343 { | 343 { |
| 344 RefPtrWillBeRawPtr<MediaControlToggleClosedCaptionsButtonElement> button = a
doptRefWillBeNoop(new MediaControlToggleClosedCaptionsButtonElement(mediaControl
s)); | 344 RefPtrWillBeRawPtr<MediaControlToggleClosedCaptionsButtonElement> button = a
doptRefWillBeNoop(new MediaControlToggleClosedCaptionsButtonElement(mediaControl
s)); |
| 345 button->ensureUserAgentShadowRoot(); | 345 button->ensureUserAgentShadowRoot(); |
| 346 button->setType(InputTypeNames::button); | 346 button->setType(InputTypeNames::button); |
| 347 button->setShadowPseudoId(AtomicString("-webkit-media-controls-toggle-closed
-captions-button", AtomicString::ConstructFromLiteral)); | 347 button->setShadowPseudoId(AtomicString("-webkit-media-controls-toggle-closed
-captions-button")); |
| 348 button->setIsWanted(false); | 348 button->setIsWanted(false); |
| 349 return button.release(); | 349 return button.release(); |
| 350 } | 350 } |
| 351 | 351 |
| 352 void MediaControlToggleClosedCaptionsButtonElement::updateDisplayType() | 352 void MediaControlToggleClosedCaptionsButtonElement::updateDisplayType() |
| 353 { | 353 { |
| 354 bool captionsVisible = mediaElement().closedCaptionsVisible(); | 354 bool captionsVisible = mediaElement().closedCaptionsVisible(); |
| 355 setDisplayType(captionsVisible ? MediaHideClosedCaptionsButton : MediaShowCl
osedCaptionsButton); | 355 setDisplayType(captionsVisible ? MediaHideClosedCaptionsButton : MediaShowCl
osedCaptionsButton); |
| 356 setChecked(captionsVisible); | 356 setChecked(captionsVisible); |
| 357 } | 357 } |
| (...skipping 16 matching lines...) Expand all Loading... |
| 374 : MediaControlInputElement(mediaControls, MediaSlider) | 374 : MediaControlInputElement(mediaControls, MediaSlider) |
| 375 { | 375 { |
| 376 } | 376 } |
| 377 | 377 |
| 378 PassRefPtrWillBeRawPtr<MediaControlTimelineElement> MediaControlTimelineElement:
:create(MediaControls& mediaControls) | 378 PassRefPtrWillBeRawPtr<MediaControlTimelineElement> MediaControlTimelineElement:
:create(MediaControls& mediaControls) |
| 379 { | 379 { |
| 380 RefPtrWillBeRawPtr<MediaControlTimelineElement> timeline = adoptRefWillBeNoo
p(new MediaControlTimelineElement(mediaControls)); | 380 RefPtrWillBeRawPtr<MediaControlTimelineElement> timeline = adoptRefWillBeNoo
p(new MediaControlTimelineElement(mediaControls)); |
| 381 timeline->ensureUserAgentShadowRoot(); | 381 timeline->ensureUserAgentShadowRoot(); |
| 382 timeline->setType(InputTypeNames::range); | 382 timeline->setType(InputTypeNames::range); |
| 383 timeline->setAttribute(stepAttr, "any"); | 383 timeline->setAttribute(stepAttr, "any"); |
| 384 timeline->setShadowPseudoId(AtomicString("-webkit-media-controls-timeline",
AtomicString::ConstructFromLiteral)); | 384 timeline->setShadowPseudoId(AtomicString("-webkit-media-controls-timeline"))
; |
| 385 return timeline.release(); | 385 return timeline.release(); |
| 386 } | 386 } |
| 387 | 387 |
| 388 void MediaControlTimelineElement::defaultEventHandler(Event* event) | 388 void MediaControlTimelineElement::defaultEventHandler(Event* event) |
| 389 { | 389 { |
| 390 if (event->isMouseEvent() && toMouseEvent(event)->button() != LeftButton) | 390 if (event->isMouseEvent() && toMouseEvent(event)->button() != LeftButton) |
| 391 return; | 391 return; |
| 392 | 392 |
| 393 if (!inDocument() || !document().isActive()) | 393 if (!inDocument() || !document().isActive()) |
| 394 return; | 394 return; |
| (...skipping 55 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 450 { | 450 { |
| 451 } | 451 } |
| 452 | 452 |
| 453 PassRefPtrWillBeRawPtr<MediaControlVolumeSliderElement> MediaControlVolumeSlider
Element::create(MediaControls& mediaControls) | 453 PassRefPtrWillBeRawPtr<MediaControlVolumeSliderElement> MediaControlVolumeSlider
Element::create(MediaControls& mediaControls) |
| 454 { | 454 { |
| 455 RefPtrWillBeRawPtr<MediaControlVolumeSliderElement> slider = adoptRefWillBeN
oop(new MediaControlVolumeSliderElement(mediaControls)); | 455 RefPtrWillBeRawPtr<MediaControlVolumeSliderElement> slider = adoptRefWillBeN
oop(new MediaControlVolumeSliderElement(mediaControls)); |
| 456 slider->ensureUserAgentShadowRoot(); | 456 slider->ensureUserAgentShadowRoot(); |
| 457 slider->setType(InputTypeNames::range); | 457 slider->setType(InputTypeNames::range); |
| 458 slider->setAttribute(stepAttr, "any"); | 458 slider->setAttribute(stepAttr, "any"); |
| 459 slider->setAttribute(maxAttr, "1"); | 459 slider->setAttribute(maxAttr, "1"); |
| 460 slider->setShadowPseudoId(AtomicString("-webkit-media-controls-volume-slider
", AtomicString::ConstructFromLiteral)); | 460 slider->setShadowPseudoId(AtomicString("-webkit-media-controls-volume-slider
")); |
| 461 return slider.release(); | 461 return slider.release(); |
| 462 } | 462 } |
| 463 | 463 |
| 464 void MediaControlVolumeSliderElement::defaultEventHandler(Event* event) | 464 void MediaControlVolumeSliderElement::defaultEventHandler(Event* event) |
| 465 { | 465 { |
| 466 if (event->isMouseEvent() && toMouseEvent(event)->button() != LeftButton) | 466 if (event->isMouseEvent() && toMouseEvent(event)->button() != LeftButton) |
| 467 return; | 467 return; |
| 468 | 468 |
| 469 if (!inDocument() || !document().isActive()) | 469 if (!inDocument() || !document().isActive()) |
| 470 return; | 470 return; |
| (...skipping 40 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 511 MediaControlFullscreenButtonElement::MediaControlFullscreenButtonElement(MediaCo
ntrols& mediaControls) | 511 MediaControlFullscreenButtonElement::MediaControlFullscreenButtonElement(MediaCo
ntrols& mediaControls) |
| 512 : MediaControlInputElement(mediaControls, MediaEnterFullscreenButton) | 512 : MediaControlInputElement(mediaControls, MediaEnterFullscreenButton) |
| 513 { | 513 { |
| 514 } | 514 } |
| 515 | 515 |
| 516 PassRefPtrWillBeRawPtr<MediaControlFullscreenButtonElement> MediaControlFullscre
enButtonElement::create(MediaControls& mediaControls) | 516 PassRefPtrWillBeRawPtr<MediaControlFullscreenButtonElement> MediaControlFullscre
enButtonElement::create(MediaControls& mediaControls) |
| 517 { | 517 { |
| 518 RefPtrWillBeRawPtr<MediaControlFullscreenButtonElement> button = adoptRefWil
lBeNoop(new MediaControlFullscreenButtonElement(mediaControls)); | 518 RefPtrWillBeRawPtr<MediaControlFullscreenButtonElement> button = adoptRefWil
lBeNoop(new MediaControlFullscreenButtonElement(mediaControls)); |
| 519 button->ensureUserAgentShadowRoot(); | 519 button->ensureUserAgentShadowRoot(); |
| 520 button->setType(InputTypeNames::button); | 520 button->setType(InputTypeNames::button); |
| 521 button->setShadowPseudoId(AtomicString("-webkit-media-controls-fullscreen-bu
tton", AtomicString::ConstructFromLiteral)); | 521 button->setShadowPseudoId(AtomicString("-webkit-media-controls-fullscreen-bu
tton")); |
| 522 button->setIsWanted(false); | 522 button->setIsWanted(false); |
| 523 return button.release(); | 523 return button.release(); |
| 524 } | 524 } |
| 525 | 525 |
| 526 void MediaControlFullscreenButtonElement::defaultEventHandler(Event* event) | 526 void MediaControlFullscreenButtonElement::defaultEventHandler(Event* event) |
| 527 { | 527 { |
| 528 if (event->type() == EventTypeNames::click) { | 528 if (event->type() == EventTypeNames::click) { |
| 529 if (mediaElement().isFullscreen()) | 529 if (mediaElement().isFullscreen()) |
| 530 mediaElement().exitFullscreen(); | 530 mediaElement().exitFullscreen(); |
| 531 else | 531 else |
| (...skipping 37 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 569 mediaElement().requestRemotePlaybackControl(); | 569 mediaElement().requestRemotePlaybackControl(); |
| 570 } else { | 570 } else { |
| 571 mediaElement().requestRemotePlayback(); | 571 mediaElement().requestRemotePlayback(); |
| 572 } | 572 } |
| 573 } | 573 } |
| 574 HTMLInputElement::defaultEventHandler(event); | 574 HTMLInputElement::defaultEventHandler(event); |
| 575 } | 575 } |
| 576 | 576 |
| 577 const AtomicString& MediaControlCastButtonElement::shadowPseudoId() const | 577 const AtomicString& MediaControlCastButtonElement::shadowPseudoId() const |
| 578 { | 578 { |
| 579 DEFINE_STATIC_LOCAL(AtomicString, id_nonOverlay, ("-internal-media-controls-
cast-button", AtomicString::ConstructFromLiteral)); | 579 DEFINE_STATIC_LOCAL(AtomicString, id_nonOverlay, ("-internal-media-controls-
cast-button")); |
| 580 DEFINE_STATIC_LOCAL(AtomicString, id_overlay, ("-internal-media-controls-ove
rlay-cast-button", AtomicString::ConstructFromLiteral)); | 580 DEFINE_STATIC_LOCAL(AtomicString, id_overlay, ("-internal-media-controls-ove
rlay-cast-button")); |
| 581 return m_isOverlayButton ? id_overlay : id_nonOverlay; | 581 return m_isOverlayButton ? id_overlay : id_nonOverlay; |
| 582 } | 582 } |
| 583 | 583 |
| 584 void MediaControlCastButtonElement::setIsPlayingRemotely(bool isPlayingRemotely) | 584 void MediaControlCastButtonElement::setIsPlayingRemotely(bool isPlayingRemotely) |
| 585 { | 585 { |
| 586 if (isPlayingRemotely) { | 586 if (isPlayingRemotely) { |
| 587 if (m_isOverlayButton) { | 587 if (m_isOverlayButton) { |
| 588 setDisplayType(MediaOverlayCastOnButton); | 588 setDisplayType(MediaOverlayCastOnButton); |
| 589 } else { | 589 } else { |
| 590 setDisplayType(MediaCastOnButton); | 590 setDisplayType(MediaCastOnButton); |
| (...skipping 39 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 630 // ---------------------------- | 630 // ---------------------------- |
| 631 | 631 |
| 632 MediaControlTimeRemainingDisplayElement::MediaControlTimeRemainingDisplayElement
(MediaControls& mediaControls) | 632 MediaControlTimeRemainingDisplayElement::MediaControlTimeRemainingDisplayElement
(MediaControls& mediaControls) |
| 633 : MediaControlTimeDisplayElement(mediaControls, MediaTimeRemainingDisplay) | 633 : MediaControlTimeDisplayElement(mediaControls, MediaTimeRemainingDisplay) |
| 634 { | 634 { |
| 635 } | 635 } |
| 636 | 636 |
| 637 PassRefPtrWillBeRawPtr<MediaControlTimeRemainingDisplayElement> MediaControlTime
RemainingDisplayElement::create(MediaControls& mediaControls) | 637 PassRefPtrWillBeRawPtr<MediaControlTimeRemainingDisplayElement> MediaControlTime
RemainingDisplayElement::create(MediaControls& mediaControls) |
| 638 { | 638 { |
| 639 RefPtrWillBeRawPtr<MediaControlTimeRemainingDisplayElement> element = adoptR
efWillBeNoop(new MediaControlTimeRemainingDisplayElement(mediaControls)); | 639 RefPtrWillBeRawPtr<MediaControlTimeRemainingDisplayElement> element = adoptR
efWillBeNoop(new MediaControlTimeRemainingDisplayElement(mediaControls)); |
| 640 element->setShadowPseudoId(AtomicString("-webkit-media-controls-time-remaini
ng-display", AtomicString::ConstructFromLiteral)); | 640 element->setShadowPseudoId(AtomicString("-webkit-media-controls-time-remaini
ng-display")); |
| 641 return element.release(); | 641 return element.release(); |
| 642 } | 642 } |
| 643 | 643 |
| 644 // ---------------------------- | 644 // ---------------------------- |
| 645 | 645 |
| 646 MediaControlCurrentTimeDisplayElement::MediaControlCurrentTimeDisplayElement(Med
iaControls& mediaControls) | 646 MediaControlCurrentTimeDisplayElement::MediaControlCurrentTimeDisplayElement(Med
iaControls& mediaControls) |
| 647 : MediaControlTimeDisplayElement(mediaControls, MediaCurrentTimeDisplay) | 647 : MediaControlTimeDisplayElement(mediaControls, MediaCurrentTimeDisplay) |
| 648 { | 648 { |
| 649 } | 649 } |
| 650 | 650 |
| 651 PassRefPtrWillBeRawPtr<MediaControlCurrentTimeDisplayElement> MediaControlCurren
tTimeDisplayElement::create(MediaControls& mediaControls) | 651 PassRefPtrWillBeRawPtr<MediaControlCurrentTimeDisplayElement> MediaControlCurren
tTimeDisplayElement::create(MediaControls& mediaControls) |
| 652 { | 652 { |
| 653 RefPtrWillBeRawPtr<MediaControlCurrentTimeDisplayElement> element = adoptRef
WillBeNoop(new MediaControlCurrentTimeDisplayElement(mediaControls)); | 653 RefPtrWillBeRawPtr<MediaControlCurrentTimeDisplayElement> element = adoptRef
WillBeNoop(new MediaControlCurrentTimeDisplayElement(mediaControls)); |
| 654 element->setShadowPseudoId(AtomicString("-webkit-media-controls-current-time
-display", AtomicString::ConstructFromLiteral)); | 654 element->setShadowPseudoId(AtomicString("-webkit-media-controls-current-time
-display")); |
| 655 return element.release(); | 655 return element.release(); |
| 656 } | 656 } |
| 657 | 657 |
| 658 } // namespace blink | 658 } // namespace blink |
| OLD | NEW |