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

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

Issue 2700663002: Adds keyboard functionality for videos. (Closed)
Patch Set: Addresses mlamouri's #20 comments. Created 3 years, 8 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 19a7ecec16d7ee6f7bd9d6c74393d4e69127a33b..1719c33c65bf4631858b6c149ac75b4105033a14 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);
// 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) {
+ m_mediaControls->onMediaKeyboardEvent(event);
+ return;
+ }
+
NOTREACHED();
}

Powered by Google App Engine
This is Rietveld 408576698