Chromium Code Reviews| Index: Source/core/html/shadow/MediaControls.cpp |
| diff --git a/Source/core/html/shadow/MediaControls.cpp b/Source/core/html/shadow/MediaControls.cpp |
| index 59d1a761f8f057338027c3287128b302c6b96a4d..da71a336f7e7a29998135c17e1505d3e2f785795 100644 |
| --- a/Source/core/html/shadow/MediaControls.cpp |
| +++ b/Source/core/html/shadow/MediaControls.cpp |
| @@ -65,6 +65,7 @@ MediaControls::MediaControls(HTMLMediaElement& mediaElement) |
| , m_hideFullscreenControlsTimer(this, &MediaControls::hideFullscreenControlsTimerFired) |
| , m_isFullscreen(false) |
| , m_isMouseOverControls(false) |
| + , m_isPausedForScrubbing(false) |
| { |
| } |
| @@ -176,7 +177,7 @@ void MediaControls::reset() |
| m_durationDisplay->setInnerText(RenderTheme::theme().formatMediaControlsTime(duration), ASSERT_NO_EXCEPTION); |
| m_durationDisplay->setCurrentValue(duration); |
| - m_playButton->updateDisplayType(); |
| + updatePlayState(); |
| updateCurrentTimeDisplay(); |
| @@ -233,9 +234,7 @@ void MediaControls::playbackStarted() |
| m_currentTimeDisplay->show(); |
| m_durationDisplay->hide(); |
| - if (m_overlayPlayButton) |
| - m_overlayPlayButton->updateDisplayType(); |
| - m_playButton->updateDisplayType(); |
| + updatePlayState(); |
| m_timeline->setPosition(mediaControllerInterface().currentTime()); |
| updateCurrentTimeDisplay(); |
| @@ -254,9 +253,7 @@ void MediaControls::playbackProgressed() |
| void MediaControls::playbackStopped() |
| { |
| - if (m_overlayPlayButton) |
| - m_overlayPlayButton->updateDisplayType(); |
| - m_playButton->updateDisplayType(); |
| + updatePlayState(); |
| m_timeline->setPosition(mediaControllerInterface().currentTime()); |
| updateCurrentTimeDisplay(); |
| makeOpaque(); |
| @@ -264,6 +261,32 @@ void MediaControls::playbackStopped() |
| stopHideFullscreenControlsTimer(); |
| } |
| +void MediaControls::updatePlayState() |
| +{ |
| + if (m_isPausedForScrubbing) |
| + return; |
| + |
| + if (m_overlayPlayButton) |
| + m_overlayPlayButton->updateDisplayType(); |
| + m_playButton->updateDisplayType(); |
| +} |
| + |
| +void MediaControls::beginScrubbing() |
| +{ |
| + if (!mediaControllerInterface().paused()) { |
| + m_isPausedForScrubbing = true; |
| + mediaControllerInterface().pause(); |
|
acolwell GONE FROM CHROMIUM
2014/03/20 00:16:35
I have concerns that this doesn't appear to be cal
philipj_slow
2014/03/20 03:01:42
This is the code in question:
if (m_pausedInterna
|
| + } |
| +} |
| + |
| +void MediaControls::endScrubbing() |
| +{ |
| + if (m_isPausedForScrubbing) { |
| + m_isPausedForScrubbing = false; |
| + mediaControllerInterface().play(); |
|
acolwell GONE FROM CHROMIUM
2014/03/21 22:55:47
Should we put a mediaControllerInterface().paused(
philipj_slow
2014/03/23 17:43:41
Done.
|
| + } |
| +} |
| + |
| void MediaControls::updateCurrentTimeDisplay() |
| { |
| double now = mediaControllerInterface().currentTime(); |