Chromium Code Reviews| 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 a19cf3c874e961991161c5b85d59544de0073a00..9975ad3cfe56376e35e2fc153069eed4de8751a4 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 |
| @@ -159,6 +168,7 @@ cr.define('media_router.ui', function() { |
| return { |
| onCreateRouteResponseReceived: onCreateRouteResponseReceived, |
| + receiveSearchResult: receiveSearchResult, |
| setCastModeList: setCastModeList, |
| setElements: setElements, |
| setFirstRunFlowData: setFirstRunFlowData, |
| @@ -357,6 +367,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 domain. |
|
apacible
2016/04/06 21:27:02
Is this the user's current domain, or the pseudosi
apacible
2016/04/06 21:27:02
Are pseudosinks guaranteed to have a domain specif
btolsch
2016/04/08 09:31:25
The pseudo-sink will only have a domain if the MRP
|
| + * @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, |
| @@ -378,5 +409,6 @@ cr.define('media_router.browserApi', function() { |
| reportTimeToInitialActionClose: reportTimeToInitialActionClose, |
| requestInitialData: requestInitialData, |
| requestRoute: requestRoute, |
| + searchSinksAndCreateRoute: searchSinksAndCreateRoute, |
| }; |
| }); |