// Copyright 2016 The Chromium Authors. All rights reserved. // Use of this source code is governed by a BSD-style license that can be // found in the LICENSE file. module ash.mojom; // The type of icon the sink is associated with. These values match // media_router::SinkIconType. enum SinkIconType { CAST = 0, CAST_AUDIO_GROUP = 1, CAST_AUDIO = 2, MEETING = 3, HANGOUT = 4, EDUCATION = 5, GENERIC = 6 }; struct CastSink { string id; string name; string domain; // Icon which describes the type of sink media is being routed to. SinkIconType sink_icon_type = SinkIconType.GENERIC; }; enum ContentSource { UNKNOWN, TAB, DESKTOP }; struct CastRoute { string id; string title; // Is the activity source this computer? ie, are we mirroring the display? bool is_local_source = false; // What is source of the content? For example, we could be DIAL casting a // tab or mirroring the entire desktop. ContentSource content_source = ContentSource.UNKNOWN; }; struct SinkAndRoute { CastSink sink; CastRoute route; }; // Allows clients (e.g. Chrome browser) to interface with the cast item in the // system tray. interface CastConfig { // Sets the client interface. This client interface will receive commands from // ash and provide OnDevicesUpdated() calls. SetClient(associated CastConfigClient client); // Invoked whenever there is new sink or route information available. OnDevicesUpdated(array device); }; // This delegate allows the UI code in ash, e.g. |TrayCastDetailedView|, // to access the cast system. // // TODO(erg): Eventually, this should no longer be exported by chrome, but // should be exported by a separate cast service. interface CastConfigClient { // Request fresh data from the backend. When the data is available, all // registered observers will get called. RequestDeviceRefresh(); // Initiate a casting session to |sink|. CastToSink(CastSink sink); // A user-initiated request to stop the given cast session. StopCasting(CastRoute route); };