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

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

Issue 2700663002: Adds keyboard functionality for videos. (Closed)
Patch Set: Addresses mlamouri's #11 comment. 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/HTMLMediaElement.cpp
diff --git a/third_party/WebKit/Source/core/html/HTMLMediaElement.cpp b/third_party/WebKit/Source/core/html/HTMLMediaElement.cpp
index 12bdeea91444eca4108add71383687c328564f5f..cd525d046b3b7f56a63e9a87a3cb925d68f64364 100644
--- a/third_party/WebKit/Source/core/html/HTMLMediaElement.cpp
+++ b/third_party/WebKit/Source/core/html/HTMLMediaElement.cpp
@@ -42,6 +42,7 @@
#include "core/dom/TaskRunnerHelper.h"
#include "core/dom/shadow/ShadowRoot.h"
#include "core/events/Event.h"
+#include "core/events/KeyboardEvent.h"
#include "core/frame/FrameView.h"
#include "core/frame/LocalFrame.h"
#include "core/frame/LocalFrameClient.h"
@@ -85,6 +86,7 @@
#include "platform/network/mime/MIMETypeFromURL.h"
#include "platform/weborigin/SecurityOrigin.h"
#include "public/platform/Platform.h"
+#include "public/platform/UserMetricsAction.h"
#include "public/platform/WebAudioSourceProvider.h"
#include "public/platform/WebContentDecryptionModule.h"
#include "public/platform/WebInbandTextTrack.h"
@@ -3716,6 +3718,15 @@ void HTMLMediaElement::ensureMediaControls() {
assertShadowRootChildren(shadowRoot);
}
+void HTMLMediaElement::defaultEventHandler(Event* event) {
+ if (isFocusedElementInDocument()) {
+ if (event->isKeyboardEvent()) {
+ m_mediaControls->defaultEventHandler(event);
mlamouri (slow - plz ping) 2017/03/16 12:17:22 We are working on decoupling HTMLMediaElement and
CJ 2017/03/16 20:08:28 I don't think I know how these classes relate to e
+ }
+ }
+ HTMLElement::defaultEventHandler(event);
+}
+
void HTMLMediaElement::updateControlsVisibility() {
if (!isConnected()) {
if (mediaControls())

Powered by Google App Engine
This is Rietveld 408576698