Index: third_party/WebKit/Source/core/html/shadow/MediaControls.cpp |
diff --git a/third_party/WebKit/Source/core/html/shadow/MediaControls.cpp b/third_party/WebKit/Source/core/html/shadow/MediaControls.cpp |
index 6fcf2642e672bbb9fa145f243b43bcf7045fa993..e77ba7dad0f7015c91a02b78fa78dc83f52c7952 100644 |
--- a/third_party/WebKit/Source/core/html/shadow/MediaControls.cpp |
+++ b/third_party/WebKit/Source/core/html/shadow/MediaControls.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" |
@@ -751,6 +752,26 @@ void MediaControls::defaultEventHandler(Event* event) { |
startHideMediaControlsTimer(); |
return; |
} |
+ |
+ if (event->type() == EventTypeNames::input) { |
mlamouri (slow - plz ping)
2017/03/27 13:02:12
stupid question: why is that?
CJ
2017/04/08 00:31:27
So we don't hide media controls while manipulating
|
+ resetHideMediaControlsTimer(); |
+ } |
+ |
+ if (event->isKeyboardEvent()) { |
+ const String& key = toKeyboardEvent(event)->key(); |
+ if (key == "Enter" || key == " ") { |
+ m_playButton->onMediaKeyboardEvent(event); |
+ return; |
+ } |
+ if (key == "ArrowLeft" || key == "ArrowRight") { |
+ timelineElement()->onMediaKeyboardEvent(event); |
+ return; |
+ } |
+ if (key == "ArrowDown" || key == "ArrowUp") { |
+ volumeSliderElement()->onMediaKeyboardEvent(event); |
+ return; |
+ } |
+ } |
} |
void MediaControls::hideMediaControlsTimerFired(TimerBase*) { |