| OLD | NEW |
| 1 /* | 1 /* |
| 2 * Copyright (C) 2007, 2008, 2009, 2010, 2011, 2012, 2013 Apple Inc. All rights
reserved. | 2 * Copyright (C) 2007, 2008, 2009, 2010, 2011, 2012, 2013 Apple Inc. All rights
reserved. |
| 3 * | 3 * |
| 4 * Redistribution and use in source and binary forms, with or without | 4 * Redistribution and use in source and binary forms, with or without |
| 5 * modification, are permitted provided that the following conditions | 5 * modification, are permitted provided that the following conditions |
| 6 * are met: | 6 * are met: |
| 7 * 1. Redistributions of source code must retain the above copyright | 7 * 1. Redistributions of source code must retain the above copyright |
| 8 * notice, this list of conditions and the following disclaimer. | 8 * notice, this list of conditions and the following disclaimer. |
| 9 * 2. Redistributions in binary form must reproduce the above copyright | 9 * 2. Redistributions in binary form must reproduce the above copyright |
| 10 * notice, this list of conditions and the following disclaimer in the | 10 * notice, this list of conditions and the following disclaimer in the |
| (...skipping 3292 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 3303 } | 3303 } |
| 3304 | 3304 |
| 3305 return false; | 3305 return false; |
| 3306 } | 3306 } |
| 3307 | 3307 |
| 3308 bool HTMLMediaElement::createMediaControls() | 3308 bool HTMLMediaElement::createMediaControls() |
| 3309 { | 3309 { |
| 3310 if (hasMediaControls()) | 3310 if (hasMediaControls()) |
| 3311 return true; | 3311 return true; |
| 3312 | 3312 |
| 3313 RefPtr<MediaControls> mediaControls = MediaControls::create(document()); | 3313 RefPtr<MediaControls> mediaControls = MediaControls::create(*this); |
| 3314 if (!mediaControls) | 3314 if (!mediaControls) |
| 3315 return false; | 3315 return false; |
| 3316 | 3316 |
| 3317 mediaControls->setMediaController(m_mediaController ? m_mediaController.get(
) : static_cast<MediaControllerInterface*>(this)); | |
| 3318 mediaControls->reset(); | 3317 mediaControls->reset(); |
| 3319 if (isFullscreen()) | 3318 if (isFullscreen()) |
| 3320 mediaControls->enteredFullscreen(); | 3319 mediaControls->enteredFullscreen(); |
| 3321 | 3320 |
| 3322 ensureUserAgentShadowRoot().appendChild(mediaControls); | 3321 ensureUserAgentShadowRoot().appendChild(mediaControls); |
| 3323 | 3322 |
| 3324 if (!controls() || !inDocument()) | 3323 if (!controls() || !inDocument()) |
| 3325 mediaControls->hide(); | 3324 mediaControls->hide(); |
| 3326 | 3325 |
| 3327 return true; | 3326 return true; |
| (...skipping 182 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 3510 { | 3509 { |
| 3511 if (m_mediaController) | 3510 if (m_mediaController) |
| 3512 m_mediaController->removeMediaElement(this); | 3511 m_mediaController->removeMediaElement(this); |
| 3513 | 3512 |
| 3514 m_mediaController = controller; | 3513 m_mediaController = controller; |
| 3515 | 3514 |
| 3516 if (m_mediaController) { | 3515 if (m_mediaController) { |
| 3517 UseCounter::count(document(), UseCounter::HTMLMediaElementControllerNotN
ull); | 3516 UseCounter::count(document(), UseCounter::HTMLMediaElementControllerNotN
ull); |
| 3518 m_mediaController->addMediaElement(this); | 3517 m_mediaController->addMediaElement(this); |
| 3519 } | 3518 } |
| 3520 | |
| 3521 if (hasMediaControls()) | |
| 3522 mediaControls()->setMediaController(m_mediaController ? m_mediaControlle
r.get() : static_cast<MediaControllerInterface*>(this)); | |
| 3523 } | 3519 } |
| 3524 | 3520 |
| 3525 void HTMLMediaElement::updateMediaController() | 3521 void HTMLMediaElement::updateMediaController() |
| 3526 { | 3522 { |
| 3527 if (m_mediaController) | 3523 if (m_mediaController) |
| 3528 m_mediaController->reportControllerState(); | 3524 m_mediaController->reportControllerState(); |
| 3529 } | 3525 } |
| 3530 | 3526 |
| 3531 bool HTMLMediaElement::isBlocked() const | 3527 bool HTMLMediaElement::isBlocked() const |
| 3532 { | 3528 { |
| (...skipping 99 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 3632 { | 3628 { |
| 3633 m_mediaSource->setWebMediaSourceAndOpen(adoptPtr(webMediaSource)); | 3629 m_mediaSource->setWebMediaSourceAndOpen(adoptPtr(webMediaSource)); |
| 3634 } | 3630 } |
| 3635 | 3631 |
| 3636 bool HTMLMediaElement::isInteractiveContent() const | 3632 bool HTMLMediaElement::isInteractiveContent() const |
| 3637 { | 3633 { |
| 3638 return fastHasAttribute(controlsAttr); | 3634 return fastHasAttribute(controlsAttr); |
| 3639 } | 3635 } |
| 3640 | 3636 |
| 3641 } | 3637 } |
| OLD | NEW |