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

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

Issue 2499883002: Media Controls: handle 'timeupdate', 'play' and 'pause' via an EventListener. (Closed)
Patch Set: fix repaint test Created 4 years 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
« no previous file with comments | « third_party/WebKit/Source/core/html/shadow/MediaControls.cpp ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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 c607fce4e0be6578d1af1dad39884f906e9f7617..154591d58a1b3a10bdccae55c949efae85858152 100644
--- a/third_party/WebKit/Source/core/html/shadow/MediaControlsMediaEventListener.cpp
+++ b/third_party/WebKit/Source/core/html/shadow/MediaControlsMediaEventListener.cpp
@@ -17,6 +17,12 @@ MediaControlsMediaEventListener::MediaControlsMediaEventListener(
EventTypeNames::volumechange, this, false);
m_mediaControls->m_mediaElement->addEventListener(EventTypeNames::focusin,
this, false);
+ m_mediaControls->m_mediaElement->addEventListener(EventTypeNames::timeupdate,
+ this, false);
+ m_mediaControls->m_mediaElement->addEventListener(EventTypeNames::play, this,
+ false);
+ m_mediaControls->m_mediaElement->addEventListener(EventTypeNames::pause, this,
+ false);
}
bool MediaControlsMediaEventListener::operator==(
@@ -31,11 +37,22 @@ void MediaControlsMediaEventListener::handleEvent(
m_mediaControls->onVolumeChange();
return;
}
-
if (event->type() == EventTypeNames::focusin) {
m_mediaControls->onFocusIn();
return;
}
+ if (event->type() == EventTypeNames::timeupdate) {
+ m_mediaControls->onTimeUpdate();
+ return;
+ }
+ if (event->type() == EventTypeNames::play) {
+ m_mediaControls->onPlay();
+ return;
+ }
+ if (event->type() == EventTypeNames::pause) {
+ m_mediaControls->onPause();
+ return;
+ }
NOTREACHED();
}
« no previous file with comments | « third_party/WebKit/Source/core/html/shadow/MediaControls.cpp ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698