Merge Chromium + Blink git repositories
[chromium-blink-merge.git] / chrome / common / extensions / api / cast_devices_private.idl
blob2903a58c326b106db07436635a1f5917d156424e
1 // Copyright 2015 The Chromium Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file.
5 // The <code>chrome.cast.devicesPrivate</code> API manages starting and stopping
6 // casts based on receiver names. It also provides a list of available
7 // receivers.
8 namespace cast.devicesPrivate {
9 // A cast receiver is an actual cast device. It has a unique |id| and a
10 // non-unique |name| which is how people identify it.
11 dictionary Receiver {
12 // The unique id of a receiver.
13 DOMString id;
15 // The human-readable name of the receiver.
16 DOMString name;
19 // An activity represents what a receiver is currently doing.
20 dictionary Activity {
21 // The unique id for the activity.
22 DOMString id;
24 // The human-readable title of the activity.
25 DOMString title;
27 // Where did this activity originate from? For >=0 values, then this is the
28 // tab identifier. For <0 values, each value has a special meaning. If the
29 // cast was started on another device, there is no tabId.
30 long? tabId;
33 // A receiver with its associated activity. This is a 1-1 mapping.
34 dictionary ReceiverActivity {
35 // The current receiver.
36 Receiver receiver;
38 // Its associated activity, if any.
39 Activity? activity;
42 interface Functions {
43 // Update the state of all of the cast devices and their associated
44 // activities.
46 // |devices|: Every single receivers with its associated activities, if any.
47 static void updateDevices(ReceiverActivity[] devices);
50 interface Events {
51 // Request a refresh of the device states.
52 [maxListeners=1] static void updateDevicesRequested();
54 // Stops a cast. This should always be a user-initiated stop.
55 static void stopCast(DOMString reason);
57 // Starts a new cast.
59 // |receiverId|: The receiver ID to initiate a cast on. The implementation
60 // will handle selecting an appropriate activity.
61 static void startCast(DOMString receiverId);