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 1b1a234275e528d7ea759827b70eb757ce30ff7e..4a4e3cd2a197cd0d34bd7c3bdd0342a8fea0b398 100644 |
| --- a/Source/core/html/shadow/MediaControls.cpp |
| +++ b/Source/core/html/shadow/MediaControls.cpp |
| @@ -191,6 +191,11 @@ void MediaControls::show() |
| m_panel->show(); |
| } |
| +void MediaControls::mediaElementFocused() |
| +{ |
| + show(); |
|
acolwell GONE FROM CHROMIUM
2014/05/22 00:31:17
Should we have a stopHideMediaControlsTimer() call
fs
2014/05/22 15:48:45
Probably makes sense. Added.
|
| +} |
| + |
| void MediaControls::hide() |
| { |
| m_panel->setIsDisplayed(false); |
| @@ -212,6 +217,16 @@ bool MediaControls::shouldHideMediaControls() |
| return !m_panel->hovered(); |
| } |
| +bool MediaControls::shouldShowMediaControls() const |
| +{ |
| + if (m_isMouseOverControls) |
| + return true; |
| + // Check for 'focus' on the HTMLMediaElement and within the controls/shadow |
| + // tree separately (to avoid going through all the potential ancestor hosts |
| + // for the focused element.) |
| + return mediaElement().focused() || contains(document().focusedElement()); |
| +} |
| + |
| void MediaControls::playbackStarted() |
| { |
| m_currentTimeDisplay->show(); |
| @@ -229,7 +244,7 @@ void MediaControls::playbackProgressed() |
| m_timeline->setPosition(mediaElement().currentTime()); |
| updateCurrentTimeDisplay(); |
| - if (!m_isMouseOverControls && mediaElement().hasVideo()) |
| + if (mediaElement().hasVideo() && !shouldShowMediaControls()) |
|
acolwell GONE FROM CHROMIUM
2014/05/22 00:31:17
!shouldShowMediaControls() conceptually seems like
fs
2014/05/22 15:48:45
I integrated should_Show_MediaControls in should_H
|
| makeTransparent(); |
| } |