| 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 34 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 45 , m_textDisplayContainer(nullptr) | 45 , m_textDisplayContainer(nullptr) |
| 46 , m_overlayPlayButton(nullptr) | 46 , m_overlayPlayButton(nullptr) |
| 47 , m_overlayEnclosure(nullptr) | 47 , m_overlayEnclosure(nullptr) |
| 48 , m_playButton(nullptr) | 48 , m_playButton(nullptr) |
| 49 , m_currentTimeDisplay(nullptr) | 49 , m_currentTimeDisplay(nullptr) |
| 50 , m_timeline(nullptr) | 50 , m_timeline(nullptr) |
| 51 , m_muteButton(nullptr) | 51 , m_muteButton(nullptr) |
| 52 , m_volumeSlider(nullptr) | 52 , m_volumeSlider(nullptr) |
| 53 , m_toggleClosedCaptionsButton(nullptr) | 53 , m_toggleClosedCaptionsButton(nullptr) |
| 54 , m_fullScreenButton(nullptr) | 54 , m_fullScreenButton(nullptr) |
| 55 , m_castButton(nullptr) |
| 55 , m_durationDisplay(nullptr) | 56 , m_durationDisplay(nullptr) |
| 56 , m_enclosure(nullptr) | 57 , m_enclosure(nullptr) |
| 57 , m_hideMediaControlsTimer(this, &MediaControls::hideMediaControlsTimerFired
) | 58 , m_hideMediaControlsTimer(this, &MediaControls::hideMediaControlsTimerFired
) |
| 58 , m_isMouseOverControls(false) | 59 , m_isMouseOverControls(false) |
| 59 , m_isPausedForScrubbing(false) | 60 , m_isPausedForScrubbing(false) |
| 60 { | 61 { |
| 61 } | 62 } |
| 62 | 63 |
| 63 PassRefPtrWillBeRawPtr<MediaControls> MediaControls::create(HTMLMediaElement& me
diaElement) | 64 PassRefPtrWillBeRawPtr<MediaControls> MediaControls::create(HTMLMediaElement& me
diaElement) |
| 64 { | 65 { |
| (...skipping 64 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 129 panel->appendChild(slider.release(), exceptionState); | 130 panel->appendChild(slider.release(), exceptionState); |
| 130 if (exceptionState.hadException()) | 131 if (exceptionState.hadException()) |
| 131 return false; | 132 return false; |
| 132 | 133 |
| 133 RefPtrWillBeRawPtr<MediaControlToggleClosedCaptionsButtonElement> toggleClos
edCaptionsButton = MediaControlToggleClosedCaptionsButtonElement::create(*this); | 134 RefPtrWillBeRawPtr<MediaControlToggleClosedCaptionsButtonElement> toggleClos
edCaptionsButton = MediaControlToggleClosedCaptionsButtonElement::create(*this); |
| 134 m_toggleClosedCaptionsButton = toggleClosedCaptionsButton.get(); | 135 m_toggleClosedCaptionsButton = toggleClosedCaptionsButton.get(); |
| 135 panel->appendChild(toggleClosedCaptionsButton.release(), exceptionState); | 136 panel->appendChild(toggleClosedCaptionsButton.release(), exceptionState); |
| 136 if (exceptionState.hadException()) | 137 if (exceptionState.hadException()) |
| 137 return false; | 138 return false; |
| 138 | 139 |
| 140 RefPtrWillBeRawPtr<MediaControlCastOffButtonElement> castButton = MediaContr
olCastOffButtonElement::create(*this); |
| 141 m_castButton = castButton.get(); |
| 142 panel->appendChild(castButton.release(), exceptionState); |
| 143 if (exceptionState.hadException()) |
| 144 return false; |
| 145 |
| 139 RefPtrWillBeRawPtr<MediaControlFullscreenButtonElement> fullscreenButton = M
ediaControlFullscreenButtonElement::create(*this); | 146 RefPtrWillBeRawPtr<MediaControlFullscreenButtonElement> fullscreenButton = M
ediaControlFullscreenButtonElement::create(*this); |
| 140 m_fullScreenButton = fullscreenButton.get(); | 147 m_fullScreenButton = fullscreenButton.get(); |
| 141 panel->appendChild(fullscreenButton.release(), exceptionState); | 148 panel->appendChild(fullscreenButton.release(), exceptionState); |
| 142 if (exceptionState.hadException()) | 149 if (exceptionState.hadException()) |
| 143 return false; | 150 return false; |
| 144 | 151 |
| 145 m_panel = panel.get(); | 152 m_panel = panel.get(); |
| 146 enclosure->appendChild(panel.release(), exceptionState); | 153 enclosure->appendChild(panel.release(), exceptionState); |
| 147 if (exceptionState.hadException()) | 154 if (exceptionState.hadException()) |
| 148 return false; | 155 return false; |
| (...skipping 25 matching lines...) Expand all Loading... |
| 174 m_volumeSlider->show(); | 181 m_volumeSlider->show(); |
| 175 updateVolume(); | 182 updateVolume(); |
| 176 | 183 |
| 177 refreshClosedCaptionsButtonVisibility(); | 184 refreshClosedCaptionsButtonVisibility(); |
| 178 | 185 |
| 179 if (mediaElement().hasVideo()) | 186 if (mediaElement().hasVideo()) |
| 180 m_fullScreenButton->show(); | 187 m_fullScreenButton->show(); |
| 181 else | 188 else |
| 182 m_fullScreenButton->hide(); | 189 m_fullScreenButton->hide(); |
| 183 | 190 |
| 191 m_castButton->show(); |
| 192 |
| 184 makeOpaque(); | 193 makeOpaque(); |
| 185 } | 194 } |
| 186 | 195 |
| 187 void MediaControls::show() | 196 void MediaControls::show() |
| 188 { | 197 { |
| 189 makeOpaque(); | 198 makeOpaque(); |
| 190 m_panel->setIsDisplayed(true); | 199 m_panel->setIsDisplayed(true); |
| 191 m_panel->show(); | 200 m_panel->show(); |
| 192 } | 201 } |
| 193 | 202 |
| (...skipping 257 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 451 visitor->trace(m_muteButton); | 460 visitor->trace(m_muteButton); |
| 452 visitor->trace(m_volumeSlider); | 461 visitor->trace(m_volumeSlider); |
| 453 visitor->trace(m_toggleClosedCaptionsButton); | 462 visitor->trace(m_toggleClosedCaptionsButton); |
| 454 visitor->trace(m_fullScreenButton); | 463 visitor->trace(m_fullScreenButton); |
| 455 visitor->trace(m_durationDisplay); | 464 visitor->trace(m_durationDisplay); |
| 456 visitor->trace(m_enclosure); | 465 visitor->trace(m_enclosure); |
| 457 HTMLDivElement::trace(visitor); | 466 HTMLDivElement::trace(visitor); |
| 458 } | 467 } |
| 459 | 468 |
| 460 } | 469 } |
| OLD | NEW |