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

Unified Diff: third_party/WebKit/Source/modules/mediasession/MediaSession.idl

Issue 2589893002: [Blink>MediaSession] Use setActionCallback() instead of event listeners for media control actions (Closed)
Patch Set: more 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
Index: third_party/WebKit/Source/modules/mediasession/MediaSession.idl
diff --git a/third_party/WebKit/Source/modules/mediasession/MediaSession.idl b/third_party/WebKit/Source/modules/mediasession/MediaSession.idl
index bd294bc66219ff71c5da36e1c4a47ee394748293..eb8b897457ce269c5ddcb0fe31568bc128dbf191 100644
--- a/third_party/WebKit/Source/modules/mediasession/MediaSession.idl
+++ b/third_party/WebKit/Source/modules/mediasession/MediaSession.idl
@@ -12,17 +12,25 @@ enum MediaSessionPlaybackState {
// https://wicg.github.io/mediasession/#the-mediasession-interface
+enum MediaSessionAction {
+ "play",
+ "pause",
+ "playpause",
mlamouri (slow - plz ping) 2016/12/20 13:25:57 playpause is no longer there, right?
Zhiqiang Zhang (Slow) 2016/12/20 13:53:06 Thanks for the catch. Done :)
+ "previoustrack",
+ "nexttrack",
+ "seekbackward",
+ "seekforward"
+};
+
+callback MediaSessionActionCallback = void ();
+
[
+ Custom=VisitDOMWrapper,
RuntimeEnabled=MediaSession,
] interface MediaSession : EventTarget {
attribute MediaMetadata? metadata;
-
attribute MediaSessionPlaybackState playbackState;
- attribute EventHandler onplay;
- attribute EventHandler onpause;
- attribute EventHandler onprevioustrack;
- attribute EventHandler onnexttrack;
- attribute EventHandler onseekforward;
- attribute EventHandler onseekbackward;
+ // Why `MediaSessionActionCallback?` will generate bindings with `Nullable<MediaSessionActionCallback*>` instead of `MediaSessionActionCallback*`?
Zhiqiang Zhang (Slow) 2016/12/19 21:21:08 bashi@, do you have answer to this question? If I
bashi 2016/12/20 06:02:10 That seems a bug in the code generator. Thank you
+ void setActionCallback(MediaSessionAction action, MediaSessionActionCallback callback);
mlamouri (slow - plz ping) 2016/12/20 13:25:58 I would prefer to keep Handler to match the discus
Zhiqiang Zhang (Slow) 2016/12/20 13:53:06 Done.
};

Powered by Google App Engine
This is Rietveld 408576698