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..8d4e8fe1f065a0a1a37f3f869e37468395e0d33d 100644 |
--- a/third_party/WebKit/Source/core/html/shadow/MediaControlsMediaEventListener.cpp |
+++ b/third_party/WebKit/Source/core/html/shadow/MediaControlsMediaEventListener.cpp |
@@ -42,6 +42,12 @@ void MediaControlsMediaEventListener::attach() { |
textTracks->addEventListener(EventTypeNames::addtrack, this, false); |
textTracks->addEventListener(EventTypeNames::change, this, false); |
textTracks->addEventListener(EventTypeNames::removetrack, this, false); |
+ |
+ // Keypress events. |
+ if (m_mediaControls->panelElement()) { |
+ m_mediaControls->panelElement()->addEventListener(EventTypeNames::keypress, |
johnme
2017/03/30 17:21:41
Should you also removeEventListener in detach()?
steimel
2017/04/05 23:38:21
Good catch. Done.
|
+ this, false); |
+ } |
} |
void MediaControlsMediaEventListener::detach() { |
@@ -122,6 +128,13 @@ void MediaControlsMediaEventListener::handleEvent( |
return; |
} |
+ // Keypress events. |
+ if (event->type() == EventTypeNames::keypress) { |
+ if (event->currentTarget() == m_mediaControls->panelElement()) |
johnme
2017/03/30 17:21:41
Why do you need to check the currentTarget? The ot
steimel
2017/04/05 23:38:21
lethalantidote@ is working on a CL that will also
|
+ m_mediaControls->onPanelKeypress(); |
+ return; |
+ } |
+ |
NOTREACHED(); |
} |