Chromium Code Reviews| OLD | NEW |
|---|---|
| 1 // Copyright 2016 The Chromium Authors. All rights reserved. | 1 // Copyright 2016 The Chromium Authors. All rights reserved. |
| 2 // Use of this source code is governed by a BSD-style license that can be | 2 // Use of this source code is governed by a BSD-style license that can be |
| 3 // found in the LICENSE file. | 3 // found in the LICENSE file. |
| 4 | 4 |
| 5 module blink.mojom; | 5 module blink.mojom; |
| 6 | 6 |
| 7 import "mojo/common/common_custom_types.mojom"; | 7 import "mojo/common/common_custom_types.mojom"; |
| 8 import "ui/gfx/geometry/mojo/geometry.mojom"; | 8 import "ui/gfx/geometry/mojo/geometry.mojom"; |
| 9 import "url/mojo/url.mojom"; | 9 import "url/mojo/url.mojom"; |
| 10 | 10 |
| 11 // Spec: https://wicg.github.io/mediasession/ | |
| 12 enum MediaSessionAction { | |
| 13 PLAY, | |
| 14 PAUSE, | |
| 15 PLAY_PAUSE, | |
| 16 PREVIOUS_TRACK, | |
| 17 NEXT_TRACK, | |
| 18 SEEK_FORWARD, | |
| 19 SEEK_BACKWARD, | |
| 20 LAST = SEEK_BACKWARD | |
|
mlamouri (slow - plz ping)
2016/10/18 17:11:14
style: leave one empty line before "LAST" to make
| |
| 21 }; | |
| 22 | |
| 11 // Album art in MediaMetadata | 23 // Album art in MediaMetadata |
| 12 // Spec: https://wicg.github.io/mediasession/ | 24 // Spec: https://wicg.github.io/mediasession/ |
| 13 struct MediaImage { | 25 struct MediaImage { |
| 14 url.mojom.Url src; | 26 url.mojom.Url src; |
| 15 mojo.common.mojom.String16 type; | 27 mojo.common.mojom.String16 type; |
| 16 array<gfx.mojom.Size> sizes; | 28 array<gfx.mojom.Size> sizes; |
| 17 }; | 29 }; |
| 18 | 30 |
| 19 // MediaMetadata | 31 // MediaMetadata |
| 20 // Spec: https://wicg.github.io/mediasession/ | 32 // Spec: https://wicg.github.io/mediasession/ |
| 21 struct MediaMetadata { | 33 struct MediaMetadata { |
| 22 mojo.common.mojom.String16 title; | 34 mojo.common.mojom.String16 title; |
| 23 mojo.common.mojom.String16 artist; | 35 mojo.common.mojom.String16 artist; |
| 24 mojo.common.mojom.String16 album; | 36 mojo.common.mojom.String16 album; |
| 25 array<MediaImage> artwork; | 37 array<MediaImage> artwork; |
| 26 }; | 38 }; |
| 27 | 39 |
| 40 interface MediaSessionClient { | |
| 41 DidReceivedAction(MediaSessionAction action); | |
|
whywhat
2016/10/18 21:02:57
nit:s/Received/Receive
| |
| 42 }; | |
| 43 | |
| 28 interface MediaSessionService { | 44 interface MediaSessionService { |
| 45 // MediaSessionClient interface is to used to notify Blink MediaSession of | |
|
whywhat
2016/10/18 21:02:57
nit: s/to used/used/
| |
| 46 // media control actions. | |
| 47 SetClient(MediaSessionClient client); | |
| 48 | |
| 29 SetMetadata(MediaMetadata? metadata); | 49 SetMetadata(MediaMetadata? metadata); |
| 50 | |
| 51 EnableAction(MediaSessionAction action); | |
| 52 DisableAction(MediaSessionAction action); | |
| 30 }; | 53 }; |
| OLD | NEW |