| Index: chrome/browser/resources/media_router/media_router_ui_interface.js
|
| diff --git a/chrome/browser/resources/media_router/media_router_ui_interface.js b/chrome/browser/resources/media_router/media_router_ui_interface.js
|
| index 6b23d2b34cd5dc9ab9cacd34328f761330562278..05383265bed25fe76efc2de593fc36d12b5a0459 100644
|
| --- a/chrome/browser/resources/media_router/media_router_ui_interface.js
|
| +++ b/chrome/browser/resources/media_router/media_router_ui_interface.js
|
| @@ -27,6 +27,15 @@ cr.define('media_router.ui', function() {
|
| }
|
|
|
| /**
|
| + * Handles the search response by forwarding |sinkId| to the container.
|
| + *
|
| + * @param {string} sinkId The ID of the sink found by search.
|
| + */
|
| + function receiveSearchResult(sinkId) {
|
| + container.onReceiveSearchResult(sinkId);
|
| + }
|
| +
|
| + /**
|
| * Sets the cast mode list.
|
| *
|
| * @param {!Array<!media_router.CastMode>} castModeList
|
| @@ -155,6 +164,7 @@ cr.define('media_router.ui', function() {
|
|
|
| return {
|
| onCreateRouteResponseReceived: onCreateRouteResponseReceived,
|
| + receiveSearchResult: receiveSearchResult,
|
| setCastModeList: setCastModeList,
|
| setElements: setElements,
|
| setFirstRunFlowData: setFirstRunFlowData,
|
| @@ -353,6 +363,27 @@ cr.define('media_router.browserApi', function() {
|
| [{sinkId: sinkId, selectedCastMode: selectedCastMode}]);
|
| }
|
|
|
| + /**
|
| + * Requests that the media router search all providers for a sink matching
|
| + * |searchCriteria| that can be used with the media source associated with the
|
| + * cast mode |selectedCastMode|. If such a sink is found, a route is also
|
| + * created between the sink and the media source.
|
| + *
|
| + * @param {string} sinkId Sink ID of the pseudo sink generating the request.
|
| + * @param {string} searchCriteria Search criteria for the route providers.
|
| + * @param {string} domain User's current hosted domain.
|
| + * @param {number} selectedCastMode The value of the cast mode to be used with
|
| + * the sink.
|
| + */
|
| + function searchSinksAndCreateRoute(
|
| + sinkId, searchCriteria, domain, selectedCastMode) {
|
| + chrome.send('searchSinksAndCreateRoute',
|
| + [{sinkId: sinkId,
|
| + searchCriteria: searchCriteria,
|
| + domain: domain,
|
| + selectedCastMode: selectedCastMode}]);
|
| + }
|
| +
|
| return {
|
| acknowledgeFirstRunFlow: acknowledgeFirstRunFlow,
|
| actOnIssue: actOnIssue,
|
| @@ -374,5 +405,6 @@ cr.define('media_router.browserApi', function() {
|
| reportTimeToInitialActionClose: reportTimeToInitialActionClose,
|
| requestInitialData: requestInitialData,
|
| requestRoute: requestRoute,
|
| + searchSinksAndCreateRoute: searchSinksAndCreateRoute,
|
| };
|
| });
|
|
|