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

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

Issue 2757323002: Prevent Media Controls from hiding when the user is interacting via the keyboard (Closed)
Patch Set: 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..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();
}

Powered by Google App Engine
This is Rietveld 408576698