Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(364)

Unified Diff: third_party/WebKit/Source/core/html/HTMLMediaElement.cpp

Issue 1680143002: Simulate click through gamepad BUTTON_A (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 4 years, 10 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
Index: third_party/WebKit/Source/core/html/HTMLMediaElement.cpp
diff --git a/third_party/WebKit/Source/core/html/HTMLMediaElement.cpp b/third_party/WebKit/Source/core/html/HTMLMediaElement.cpp
index ecd1e12170f4ab09c8fa89c33bc01831b0380a38..e7d09d4397cc0467b532b8e8864e500ade686111 100644
--- a/third_party/WebKit/Source/core/html/HTMLMediaElement.cpp
+++ b/third_party/WebKit/Source/core/html/HTMLMediaElement.cpp
@@ -37,6 +37,7 @@
#include "core/dom/Fullscreen.h"
#include "core/dom/shadow/ShadowRoot.h"
#include "core/events/Event.h"
+#include "core/events/KeyboardEvent.h"
#include "core/frame/LocalFrame.h"
#include "core/frame/Settings.h"
#include "core/frame/UseCounter.h"
@@ -3489,6 +3490,10 @@ bool HTMLMediaElement::isInteractiveContent() const
void HTMLMediaElement::defaultEventHandler(Event* event)
{
+ if (event->type() == EventTypeNames::keydown && toKeyboardEvent(event)->keyIdentifier() == "Enter") {
dtapuska 2016/02/09 14:29:03 I'd prefer if this was using domCode() as opposed
dtapuska 2016/02/09 14:34:38 Seeing what you are doing later on; mapping a the
+ togglePlayState();
+ event->setDefaultHandled();
+ }
if (event->type() == EventTypeNames::focusin) {
if (mediaControls())
mediaControls()->mediaElementFocused();

Powered by Google App Engine
This is Rietveld 408576698