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

Unified Diff: third_party/WebKit/Source/core/html/shadow/MediaControlsMediaEventListener.cpp

Issue 2700663002: Adds keyboard functionality for videos. (Closed)
Patch Set: Clean up. Created 3 years, 9 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/shadow/MediaControlsMediaEventListener.cpp
diff --git a/third_party/WebKit/Source/core/html/shadow/MediaControlsMediaEventListener.cpp b/third_party/WebKit/Source/core/html/shadow/MediaControlsMediaEventListener.cpp
index 070f17b32971c62841984ede8a0b15d1d8086e8d..dc9474ba4a5c6bc2daaab34e2041d9d4abb131ea 100644
--- a/third_party/WebKit/Source/core/html/shadow/MediaControlsMediaEventListener.cpp
+++ b/third_party/WebKit/Source/core/html/shadow/MediaControlsMediaEventListener.cpp
@@ -29,6 +29,9 @@ void MediaControlsMediaEventListener::attach() {
mediaElement().addEventListener(EventTypeNames::durationchange, this, false);
mediaElement().addEventListener(EventTypeNames::error, this, false);
mediaElement().addEventListener(EventTypeNames::loadedmetadata, this, false);
+ mediaElement().addEventListener(EventTypeNames::keypress, this, false);
+ mediaElement().addEventListener(EventTypeNames::keydown, this, false);
+ mediaElement().addEventListener(EventTypeNames::keyup, this, false);
mlamouri (slow - plz ping) 2017/03/27 13:02:12 I think keypress should be enough here.
CJ 2017/04/08 00:31:27 Keypress only works for the Enter button. All othe
// Listen to two different fullscreen events in order to make sure the new and
// old APIs are handled.
@@ -122,6 +125,12 @@ void MediaControlsMediaEventListener::handleEvent(
return;
}
+ if (event->type() == EventTypeNames::keypress || EventTypeNames::keydown ||
+ EventTypeNames::keyup) {
mlamouri (slow - plz ping) 2017/03/27 13:02:12 ditto
CJ 2017/04/08 00:31:27 Acknowledged.
+ m_mediaControls->onMediaKeypress(event);
+ return;
+ }
+
NOTREACHED();
}

Powered by Google App Engine
This is Rietveld 408576698