| OLD | NEW |
| (Empty) | |
| 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 |
| 3 // found in the LICENSE file. |
| 4 |
| 5 module ash.mojom; |
| 6 |
| 7 struct CastSink { |
| 8 string id; |
| 9 string name; |
| 10 string domain; |
| 11 }; |
| 12 |
| 13 enum ContentSource { |
| 14 UNKNOWN, |
| 15 TAB, |
| 16 DESKTOP |
| 17 }; |
| 18 |
| 19 struct CastRoute { |
| 20 string id; |
| 21 string title; |
| 22 |
| 23 // Is the activity source this computer? ie, are we mirroring the display? |
| 24 bool is_local_source = false; |
| 25 |
| 26 // What is source of the content? For example, we could be DIAL casting a |
| 27 // tab or mirroring the entire desktop. |
| 28 ContentSource content_source = ContentSource.UNKNOWN; |
| 29 }; |
| 30 |
| 31 struct SinkAndRoute { |
| 32 CastSink sink; |
| 33 CastRoute route; |
| 34 }; |
| 35 |
| 36 // Allows clients (e.g. Chrome browser) to interface with the cast item in the |
| 37 // system tray. |
| 38 interface CastConfig { |
| 39 // Sets the client interface. This client interface will receive commands from |
| 40 // ash and provide OnDevicesUpdated() calls. |
| 41 SetClient(associated CastConfigClient client); |
| 42 |
| 43 // Invoked whenever there is new sink or route information available. |
| 44 OnDevicesUpdated(array<SinkAndRoute> device); |
| 45 }; |
| 46 |
| 47 // This delegate allows the UI code in ash, e.g. |TrayCastDetailedView|, |
| 48 // to access the cast system. |
| 49 // |
| 50 // TODO(erg): Eventually, this should no longer be exported by chrome, but |
| 51 // should be exported by a separate cast service. |
| 52 interface CastConfigClient { |
| 53 // Request fresh data from the backend. When the data is available, all |
| 54 // registered observers will get called. |
| 55 RequestDeviceRefresh(); |
| 56 |
| 57 // Initiate a casting session to |sink|. |
| 58 CastToSink(CastSink sink); |
| 59 |
| 60 // A user-initiated request to stop the given cast session. |
| 61 StopCasting(CastRoute route); |
| 62 }; |
| OLD | NEW |