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

Unified Diff: third_party/WebKit/Source/modules/media_controls/MediaControlsImpl.cpp

Issue 2757323002: Prevent Media Controls from hiding when the user is interacting via the keyboard (Closed)
Patch Set: rebase 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/modules/media_controls/MediaControlsImpl.cpp
diff --git a/third_party/WebKit/Source/modules/media_controls/MediaControlsImpl.cpp b/third_party/WebKit/Source/modules/media_controls/MediaControlsImpl.cpp
index ede6637936cc9516feb5b0572c865f20e4abad2e..327309289b8030ea7a871e4134c936abc02bd4c8 100644
--- a/third_party/WebKit/Source/modules/media_controls/MediaControlsImpl.cpp
+++ b/third_party/WebKit/Source/modules/media_controls/MediaControlsImpl.cpp
@@ -765,6 +765,13 @@ void MediaControlsImpl::defaultEventHandler(Event* event) {
startHideMediaControlsTimer();
return;
}
+
+ // If the user is interacting with the controls via the keyboard, don't hide
+ // the controls. This will fire when the user tabs between controls (focusin)
+ // or when they seek either the timeline or volume sliders (input).
+ if (event->type() == EventTypeNames::focusin ||
+ event->type() == EventTypeNames::input)
+ resetHideMediaControlsTimer();
}
void MediaControlsImpl::hideMediaControlsTimerFired(TimerBase*) {
@@ -912,6 +919,13 @@ void MediaControlsImpl::onExitedFullscreen() {
startHideMediaControlsTimer();
}
+void MediaControlsImpl::onPanelKeypress() {
+ // If the user is interacting with the controls via the keyboard, don't hide
+ // the controls. This is called when the user mutes/unmutes, turns CC on/off,
+ // etc.
+ resetHideMediaControlsTimer();
+}
+
void MediaControlsImpl::notifyElementSizeChanged(ClientRect* newSize) {
// Note that this code permits a bad frame on resize, since it is
// run after the relayout / paint happens. It would be great to improve

Powered by Google App Engine
This is Rietveld 408576698