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..44c1409d013ccc8dd289283d14e056b5d82bd894 100644 |
| --- a/Source/core/html/shadow/MediaControls.cpp |
| +++ b/Source/core/html/shadow/MediaControls.cpp |
| @@ -34,6 +34,7 @@ |
| #include "core/html/HTMLMediaElement.h" |
| #include "core/html/MediaController.h" |
| #include "core/layout/LayoutTheme.h" |
| +#include "core/page/EventHandler.h" |
| namespace blink { |
| @@ -68,6 +69,7 @@ MediaControls::MediaControls(HTMLMediaElement& mediaElement) |
| , m_isMouseOverControls(false) |
| , m_isPausedForScrubbing(false) |
| , m_wasLastEventTouch(false) |
| + , m_behaviorFlags(0) |
| { |
| } |
| @@ -441,6 +443,10 @@ void MediaControls::defaultEventHandler(Event* event) |
| m_wasLastEventTouch = event->isTouchEvent() || event->isGestureEvent() |
| || (event->isMouseEvent() && toMouseEvent(event)->fromTouch()); |
| + if (m_wasLastEventTouch) { |
| + m_behaviorFlags |= IgnoreControlsHover; |
|
fs
2015/02/06 10:32:36
I think I'd prefer if we could factor this slightl
|
| + } |
| + |
| if (event->type() == EventTypeNames::mouseover) { |
| if (!containsRelatedTarget(event)) { |
| m_isMouseOverControls = true; |
| @@ -477,15 +483,13 @@ void MediaControls::hideMediaControlsTimerFired(Timer<MediaControls>*) |
| if (mediaElement().togglePlayStateWillPlay()) |
| return; |
| - unsigned behaviorFlags = IgnoreFocus | IgnoreVideoHover; |
| - if (m_wasLastEventTouch) { |
| - behaviorFlags |= IgnoreControlsHover; |
| - } |
| - if (!shouldHideMediaControls(behaviorFlags)) |
| + m_behaviorFlags = m_behaviorFlags | IgnoreFocus | IgnoreVideoHover; |
| + if (!shouldHideMediaControls(m_behaviorFlags)) |
| return; |
| makeTransparent(); |
| m_overlayCastButton->hide(); |
| + m_behaviorFlags = 0; |
| } |
| void MediaControls::startHideMediaControlsTimer() |