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 bd04ac6ae8d41c0d3a59898d537b5670bfb522cc..cf3539469d4f9f068c93a132891d347f771c49ca 100644 |
| --- a/Source/core/html/shadow/MediaControls.cpp |
| +++ b/Source/core/html/shadow/MediaControls.cpp |
| @@ -65,6 +65,7 @@ MediaControls::MediaControls(HTMLMediaElement& mediaElement) |
| , m_durationDisplay(nullptr) |
| , m_enclosure(nullptr) |
| , m_hideMediaControlsTimer(this, &MediaControls::hideMediaControlsTimerFired) |
| + , m_hideTimerBehaviorFlags(IgnoreNone) |
| , m_isMouseOverControls(false) |
| , m_isPausedForScrubbing(false) |
| , m_wasLastEventTouch(false) |
| @@ -441,6 +442,10 @@ void MediaControls::defaultEventHandler(Event* event) |
| m_wasLastEventTouch = event->isTouchEvent() || event->isGestureEvent() |
| || (event->isMouseEvent() && toMouseEvent(event)->fromTouch()); |
| + // We mark IgnoreControlsHover to m_hideTimerBehaviorFlags for last touch event |
|
fs
2015/02/06 17:04:37
Nit: Maybe reword this a bit:
Add IgnoreControlsH
william.xie1
2015/02/06 17:11:05
Done.
|
| + // so that media control bar goes to hide |
| + m_hideTimerBehaviorFlags |= m_wasLastEventTouch ? IgnoreControlsHover : IgnoreNone; |
| + |
| if (event->type() == EventTypeNames::mouseover) { |
| if (!containsRelatedTarget(event)) { |
| m_isMouseOverControls = true; |
| @@ -474,13 +479,12 @@ void MediaControls::defaultEventHandler(Event* event) |
| void MediaControls::hideMediaControlsTimerFired(Timer<MediaControls>*) |
| { |
| + unsigned behaviorFlags = m_hideTimerBehaviorFlags | IgnoreFocus | IgnoreVideoHover; |
| + m_hideTimerBehaviorFlags = IgnoreNone; |
| + |
| if (mediaElement().togglePlayStateWillPlay()) |
| return; |
| - unsigned behaviorFlags = IgnoreFocus | IgnoreVideoHover; |
| - if (m_wasLastEventTouch) { |
| - behaviorFlags |= IgnoreControlsHover; |
| - } |
| if (!shouldHideMediaControls(behaviorFlags)) |
| return; |