// 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; struct CastSink { string id; string name; string domain; }; 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); };