| 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 45bee3333154048d339a4b4b54c3960ec96260d4..da8ce9b64af7832bd6d60d6daef36d1b901520b9 100644
|
| --- a/chrome/browser/resources/media_router/media_router_ui_interface.js
|
| +++ b/chrome/browser/resources/media_router/media_router_ui_interface.js
|
| @@ -26,9 +26,13 @@ cr.define('media_router.ui', function() {
|
| * if route creation succeeded; null otherwise
|
| */
|
| function onCreateRouteResponseReceived(sinkId, route) {
|
| + console.log('media_router.ui.onCreateRouteResponseReceived: ' + sinkId);
|
| container.onCreateRouteResponseReceived(sinkId, route);
|
| }
|
|
|
| +
|
| + function onCanJoin(canJoin) { container.setCanJoin(canJoin); }
|
| +
|
| /**
|
| * Sets the cast mode list.
|
| *
|
| @@ -67,8 +71,8 @@ cr.define('media_router.ui', function() {
|
| container.deviceMissingUrl = data['deviceMissingUrl'];
|
| container.allSinks = data['sinks'];
|
| container.routeList = data['routes'];
|
| - container.initializeCastModes(data['castModes'],
|
| - data['initialCastModeType']);
|
| + container.initializeCastModes(
|
| + data['castModes'], data['initialCastModeType']);
|
| }
|
|
|
| /**
|
| @@ -77,31 +81,26 @@ cr.define('media_router.ui', function() {
|
| *
|
| * @param {?media_router.Issue} issue
|
| */
|
| - function setIssue(issue) {
|
| - container.issue = issue;
|
| - }
|
| + function setIssue(issue) { container.issue = issue; }
|
|
|
| /**
|
| * Sets the list of currently active routes.
|
| *
|
| * @param {!Array<!media_router.Route>} routeList
|
| */
|
| - function setRouteList(routeList) {
|
| - container.routeList = routeList;
|
| - }
|
| + function setRouteList(routeList) { container.routeList = routeList; }
|
|
|
| /**
|
| * Sets the list of discovered sinks.
|
| *
|
| * @param {!Array<!media_router.Sink>} sinkList
|
| */
|
| - function setSinkList(sinkList) {
|
| - container.allSinks = sinkList;
|
| - }
|
| + function setSinkList(sinkList) { container.allSinks = sinkList; }
|
|
|
| return {
|
| onNotifyRouteCreationTimeout: onNotifyRouteCreationTimeout,
|
| onCreateRouteResponseReceived: onCreateRouteResponseReceived,
|
| + onCanJoin: onCanJoin,
|
| setCastModeList: setCastModeList,
|
| setContainer: setContainer,
|
| setInitialData: setInitialData,
|
| @@ -123,16 +122,15 @@ cr.define('media_router.browserApi', function() {
|
| * @param {?number} helpPageId The numeric help center ID.
|
| */
|
| function actOnIssue(issueId, actionType, helpPageId) {
|
| - chrome.send('actOnIssue', [{issueId: issueId, actionType: actionType,
|
| - helpPageId: helpPageId}]);
|
| + chrome.send(
|
| + 'actOnIssue',
|
| + [{issueId: issueId, actionType: actionType, helpPageId: helpPageId}]);
|
| }
|
|
|
| /**
|
| * Closes the dialog.
|
| */
|
| - function closeDialog() {
|
| - chrome.send('closeDialog');
|
| - }
|
| + function closeDialog() { chrome.send('closeDialog'); }
|
|
|
| /**
|
| * Closes the given route.
|
| @@ -144,6 +142,24 @@ cr.define('media_router.browserApi', function() {
|
| }
|
|
|
| /**
|
| + * Joins the given route.
|
| + *
|
| + * @param {!media_router.Route} route
|
| + */
|
| + function joinRoute(route) {
|
| + chrome.send('joinRoute', [{sinkId: route.sinkId, routeId: route.id}]);
|
| + }
|
| +
|
| + /**
|
| + * Asks the provider if the given route can be joined.
|
| + *
|
| + * @param {!media_router.Route} route
|
| + */
|
| + function canJoinRoute(route) {
|
| + chrome.send('canJoin', [{routeId: route.id}]);
|
| + }
|
| +
|
| + /**
|
| * Reports the current number of sinks.
|
| *
|
| * @param {number} sinkCount
|
| @@ -156,9 +172,7 @@ cr.define('media_router.browserApi', function() {
|
| * Requests data to initialize the WebUI with.
|
| * The data will be returned via media_router.ui.setInitialData.
|
| */
|
| - function requestInitialData() {
|
| - chrome.send('requestInitialData');
|
| - }
|
| + function requestInitialData() { chrome.send('requestInitialData'); }
|
|
|
| /**
|
| * Requests that a media route be started with the given sink.
|
| @@ -168,14 +182,16 @@ cr.define('media_router.browserApi', function() {
|
| * selected.
|
| */
|
| function requestRoute(sinkId, selectedCastMode) {
|
| - chrome.send('requestRoute',
|
| - [{sinkId: sinkId, selectedCastMode: selectedCastMode}]);
|
| + chrome.send(
|
| + 'requestRoute', [{sinkId: sinkId, selectedCastMode: selectedCastMode}]);
|
| }
|
|
|
| return {
|
| actOnIssue: actOnIssue,
|
| closeDialog: closeDialog,
|
| closeRoute: closeRoute,
|
| + joinRoute: joinRoute,
|
| + canJoinRoute: canJoinRoute,
|
| reportSinkCount: reportSinkCount,
|
| requestInitialData: requestInitialData,
|
| requestRoute: requestRoute,
|
|
|