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 b31c8faab967c0c281f1f35b1a003a6e333a1bea..e0745b19540eb5c56288b308373d0ab319ddef4f 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" |
| @@ -766,6 +767,23 @@ void MediaControlsImpl::DefaultEventHandler(Event* event) { |
| if (event->type() == EventTypeNames::focusin || |
| event->type() == EventTypeNames::input) |
| ResetHideMediaControlsTimer(); |
| + |
| + if (event->IsKeyboardEvent()) { |
|
mlamouri (slow - plz ping)
2017/05/09 17:32:10
I realised the other day (not sure why I was think
lethalantidote
2017/05/18 00:03:34
Done.
|
| + const String& key = ToKeyboardEvent(event)->key(); |
| + if (key == "Enter" || ToKeyboardEvent(event)->keyCode() == ' ') { |
| + play_button_->OnMediaKeyboardEvent(event); |
| + return; |
| + } |
| + if (key == "ArrowLeft" || key == "ArrowRight" || key == "Home" || |
| + key == "End") { |
| + timeline_->OnMediaKeyboardEvent(event); |
| + return; |
| + } |
| + if (key == "ArrowDown" || key == "ArrowUp") { |
| + volume_slider_->OnMediaKeyboardEvent(event); |
| + return; |
| + } |
| + } |
| } |
| void MediaControlsImpl::HideMediaControlsTimerFired(TimerBase*) { |