| Index: third_party/WebKit/Source/core/html/shadow/MediaControls.cpp
|
| diff --git a/third_party/WebKit/Source/core/html/shadow/MediaControls.cpp b/third_party/WebKit/Source/core/html/shadow/MediaControls.cpp
|
| index bcd0d7c4fd5a72c48714ddd2ae41fb5732adb989..5b4b0b7b707d21ec773acb1c80f361aa5d401624 100644
|
| --- a/third_party/WebKit/Source/core/html/shadow/MediaControls.cpp
|
| +++ b/third_party/WebKit/Source/core/html/shadow/MediaControls.cpp
|
| @@ -419,32 +419,6 @@ bool MediaControls::shouldHideMediaControls(unsigned behaviorFlags) const {
|
| return true;
|
| }
|
|
|
| -void MediaControls::playbackStarted() {
|
| - BatchedControlUpdate batch(this);
|
| - updatePlayState();
|
| - m_timeline->setPosition(mediaElement().currentTime());
|
| - updateCurrentTimeDisplay();
|
| -
|
| - startHideMediaControlsTimer();
|
| -}
|
| -
|
| -void MediaControls::playbackProgressed() {
|
| - m_timeline->setPosition(mediaElement().currentTime());
|
| - updateCurrentTimeDisplay();
|
| -
|
| - if (isVisible() && shouldHideMediaControls())
|
| - makeTransparent();
|
| -}
|
| -
|
| -void MediaControls::playbackStopped() {
|
| - updatePlayState();
|
| - m_timeline->setPosition(mediaElement().currentTime());
|
| - updateCurrentTimeDisplay();
|
| - makeOpaque();
|
| -
|
| - stopHideMediaControlsTimer();
|
| -}
|
| -
|
| void MediaControls::updatePlayState() {
|
| if (m_isPausedForScrubbing)
|
| return;
|
| @@ -718,6 +692,38 @@ void MediaControls::onFocusIn() {
|
| resetHideMediaControlsTimer();
|
| }
|
|
|
| +void MediaControls::onTimeUpdate() {
|
| + m_timeline->setPosition(mediaElement().currentTime());
|
| + updateCurrentTimeDisplay();
|
| +
|
| + // 'timeupdate' might be called in a paused state. The controls should not
|
| + // become transparent in that case.
|
| + if (mediaElement().paused()) {
|
| + makeOpaque();
|
| + return;
|
| + }
|
| +
|
| + if (isVisible() && shouldHideMediaControls())
|
| + makeTransparent();
|
| +}
|
| +
|
| +void MediaControls::onPlay() {
|
| + updatePlayState();
|
| + m_timeline->setPosition(mediaElement().currentTime());
|
| + updateCurrentTimeDisplay();
|
| +
|
| + startHideMediaControlsTimer();
|
| +}
|
| +
|
| +void MediaControls::onPause() {
|
| + updatePlayState();
|
| + m_timeline->setPosition(mediaElement().currentTime());
|
| + updateCurrentTimeDisplay();
|
| + makeOpaque();
|
| +
|
| + stopHideMediaControlsTimer();
|
| +}
|
| +
|
| void MediaControls::notifyPanelWidthChanged(const LayoutUnit& newWidth) {
|
| // Don't bother to do any work if this matches the most recent panel
|
| // width, since we're called after layout.
|
|
|