Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(15)

Side by Side Diff: chrome/browser/media/router/mojo/media_router.mojom

Issue 2728543009: [Media Router] Custom Controls 2 - add MediaRouter::GetRouteController() (Closed)
Patch Set: Address Mark's comments Created 3 years, 8 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
OLDNEW
1 // Copyright 2015 The Chromium Authors. All rights reserved. 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 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 media_router.mojom; 5 module media_router.mojom;
6 6
7 import "chrome/browser/media/router/mojo/media_controller.mojom";
8 import "chrome/browser/media/router/mojo/media_status.mojom";
7 import "mojo/common/time.mojom"; 9 import "mojo/common/time.mojom";
8 import "net/interfaces/ip_address.mojom"; 10 import "net/interfaces/ip_address.mojom";
9 import "url/mojo/origin.mojom"; 11 import "url/mojo/origin.mojom";
10 import "url/mojo/url.mojom"; 12 import "url/mojo/url.mojom";
11 13
12 // Represents an output sink to which media can be routed. 14 // Represents an output sink to which media can be routed.
13 struct MediaSink { 15 struct MediaSink {
14 enum IconType { 16 enum IconType {
15 CAST, 17 CAST,
16 CAST_AUDIO, 18 CAST_AUDIO,
(...skipping 56 matching lines...) Expand 10 before | Expand all | Expand 10 after
73 75
74 // Should be kept in sync with media_route.h. 76 // Should be kept in sync with media_route.h.
75 struct MediaRoute { 77 struct MediaRoute {
76 // The ID of this media route, e.g. "r_PR1O_blkC9dsKp-tb1ti8qurOo". 78 // The ID of this media route, e.g. "r_PR1O_blkC9dsKp-tb1ti8qurOo".
77 string media_route_id; 79 string media_route_id;
78 // The ID of the media source being sent through this media route. 80 // The ID of the media source being sent through this media route.
79 // May be missing if route is not local. 81 // May be missing if route is not local.
80 string? media_source; 82 string? media_source;
81 // The ID of sink that is rendering the media content. 83 // The ID of sink that is rendering the media content.
82 string media_sink_id; 84 string media_sink_id;
83 // Human readable description of this route, e.g. 85 // Human readable description of this route, e.g. "Tab casting".
84 // "Tab casting".
85 string description; 86 string description;
86 // Specifies that the route is requested locally. 87 // Specifies that the route is requested locally.
87 bool is_local; 88 bool is_local;
88 // An optional path to an HTML page bundled bundled with the media router 89 // An optional path to an HTML page bundled bundled with the media router
89 // component extension. When set, the route can have custom route detail as 90 // component extension. When set, the route can have custom route detail as
90 // well as its own route controls in the media router dialog. 91 // well as its own route controls in the media router dialog.
91 string? custom_controller_path; 92 string? custom_controller_path;
92 // Set to true if this route should be displayed for |media_sink_id| in UI. 93 // Set to true if this route should be displayed for |media_sink_id| in UI.
93 bool for_display; 94 bool for_display;
94 // Set to true if this route was created by an incognito profile. 95 // Set to true if this route was created by an incognito profile.
(...skipping 262 matching lines...) Expand 10 before | Expand all | Expand 10 after
357 // Indicates that the Media Router is interested in finding a sink that 358 // Indicates that the Media Router is interested in finding a sink that
358 // matches |search_criteria| and is compatible with the source urn 359 // matches |search_criteria| and is compatible with the source urn
359 // |media_source|. |search_criteria| should contain an exact copy of the user 360 // |media_source|. |search_criteria| should contain an exact copy of the user
360 // input. The user's current domain is also used to search. The domain is the 361 // input. The user's current domain is also used to search. The domain is the
361 // hosted domain of the user's signed-in identity, or empty if the user has no 362 // hosted domain of the user's signed-in identity, or empty if the user has no
362 // domain or is not signed in. 363 // domain or is not signed in.
363 SearchSinks(string sink_id, 364 SearchSinks(string sink_id,
364 string media_source, 365 string media_source,
365 SinkSearchCriteria search_criteria) => 366 SinkSearchCriteria search_criteria) =>
366 (string sink_id); 367 (string sink_id);
368
369 // Creates a controller for the media route with given |route_id| and binds it
370 // to |media_controller| for receiving media commands. This method returns
371 // false if such a media route doesn't exist, a controller already exists
372 // for it, or there was an error while creating a controller.
373 // |media_controller| becomes invalid when the media route is terminated. The
374 // created controller is destroyed when |media_controller| becomes invalid,
375 // after which this method can be called again with the same |route_id|.
376 // TODO(takumif): Consider returning an enum instead of a bool to distinguish
377 // between error conditions for metrics/debugging.
378 CreateMediaRouteController(string route_id,
379 MediaController& media_controller) =>
380 (bool success);
381
382 // Sets the observer to be notified whenever there is a change in the status
383 // of a media route. A media route can have at most one observer at a time,
384 // and it will be overwritten each time this method is called with the same
385 // |route_id|.
386 SetMediaRouteStatusObserver(string route_id, MediaStatusObserver observer);
367 }; 387 };
368 388
369 // Interface for a service which observes state changes across media 389 // Interface for a service which observes state changes across media
370 // sources, sinks, and issues. 390 // sources, sinks, and issues.
371 interface MediaRouter { 391 interface MediaRouter {
372 392
373 // Represents overall media sink availability states. 393 // Represents overall media sink availability states.
374 // UNAVAILABLE - No sinks are available. 394 // UNAVAILABLE - No sinks are available.
375 // PER_SOURCE - Sinks are available, but are only compatible with specific 395 // PER_SOURCE - Sinks are available, but are only compatible with specific
376 // media sources. 396 // media sources.
(...skipping 55 matching lines...) Expand 10 before | Expand all | Expand 10 after
432 452
433 // Called when the a batch of messages arrives from the media sink for the 453 // Called when the a batch of messages arrives from the media sink for the
434 // route given by |route_id|. 454 // route given by |route_id|.
435 // |StartListeningForRouteMessages| must be called first in order to receive 455 // |StartListeningForRouteMessages| must be called first in order to receive
436 // messages. 456 // messages.
437 // |route_id|: ID of route of the messages. 457 // |route_id|: ID of route of the messages.
438 // |messages|: A non-empty list of messages received. 458 // |messages|: A non-empty list of messages received.
439 OnRouteMessagesReceived(string route_id, 459 OnRouteMessagesReceived(string route_id,
440 array<RouteMessage> messages); 460 array<RouteMessage> messages);
441 }; 461 };
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698