Chromium Code Reviews| Index: third_party/WebKit/Source/modules/media_controls/MediaControlsImpl.cpp |
| diff --git a/third_party/WebKit/Source/modules/media_controls/MediaControlsImpl.cpp b/third_party/WebKit/Source/modules/media_controls/MediaControlsImpl.cpp |
| index 402230417b10ac62781469052557d3177e51ee4e..b367c4d1a2e11384842b3a580f97745206c9a812 100644 |
| --- a/third_party/WebKit/Source/modules/media_controls/MediaControlsImpl.cpp |
| +++ b/third_party/WebKit/Source/modules/media_controls/MediaControlsImpl.cpp |
| @@ -33,6 +33,7 @@ |
| #include "core/dom/ResizeObserverCallback.h" |
| #include "core/dom/ResizeObserverEntry.h" |
| #include "core/dom/TaskRunnerHelper.h" |
| +#include "core/events/KeyboardEvent.h" |
| #include "core/events/MouseEvent.h" |
| #include "core/frame/Settings.h" |
| #include "core/frame/UseCounter.h" |
| @@ -765,6 +766,27 @@ void MediaControlsImpl::defaultEventHandler(Event* event) { |
| startHideMediaControlsTimer(); |
| return; |
| } |
| + |
| + if (event->type() == EventTypeNames::input) { |
| + resetHideMediaControlsTimer(); |
| + } |
|
mlamouri (slow - plz ping)
2017/04/10 13:14:02
I think steimel@'s CL doing this has landed.
CJ
2017/04/12 23:21:05
Done.
CJ
2017/04/12 23:21:05
Done.
|
| + |
| + if (event->isKeyboardEvent()) { |
| + const String& key = toKeyboardEvent(event)->key(); |
| + if (key == "Enter" || toKeyboardEvent(event)->keyCode() == ' ') { |
| + m_playButton->onMediaKeyboardEvent(event); |
| + return; |
| + } |
| + if (key == "ArrowLeft" || key == "ArrowRight" || key == "Home" || |
| + key == "End") { |
| + timelineElement()->onMediaKeyboardEvent(event); |
|
mlamouri (slow - plz ping)
2017/04/10 13:14:02
nit: use the member directly
CJ
2017/04/12 23:21:05
Done.
|
| + return; |
| + } |
| + if (key == "ArrowDown" || key == "ArrowUp") { |
| + volumeSliderElement()->onMediaKeyboardEvent(event); |
|
mlamouri (slow - plz ping)
2017/04/10 13:14:02
ditto
CJ
2017/04/12 23:21:05
Done.
|
| + return; |
| + } |
| + } |
| } |
| void MediaControlsImpl::hideMediaControlsTimerFired(TimerBase*) { |