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 2f32c0510fc28434d2ae7adb85c8c19b4a0dfffc..61085d771e897a2ae8c2c87657a8548bd7d42e39 100644 |
| --- a/third_party/WebKit/Source/modules/media_controls/MediaControlsImpl.cpp |
| +++ b/third_party/WebKit/Source/modules/media_controls/MediaControlsImpl.cpp |
| @@ -37,6 +37,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" |
| @@ -852,6 +853,23 @@ void MediaControlsImpl::DefaultEventHandler(Event* event) { |
| if (event->type() == EventTypeNames::focusin || |
| event->type() == EventTypeNames::input) |
| ResetHideMediaControlsTimer(); |
| + |
| + if (event->IsKeyboardEvent() && !IsSpatialNavigationActive()) { |
|
mlamouri (slow - plz ping)
2017/05/24 08:49:15
Would it make sense to allow "enter" and "space" t
lethalantidote
2017/05/24 18:46:08
Maybe, but wouldn't that cause inconsistency? It's
mlamouri (slow - plz ping)
2017/05/30 10:22:41
I have no strong opinion on this. Whatever sounds
|
| + 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*) { |