| Index: chrome/browser/resources/media_router/elements/route_details/route_details.js
|
| diff --git a/chrome/browser/resources/media_router/elements/route_details/route_details.js b/chrome/browser/resources/media_router/elements/route_details/route_details.js
|
| index d3db440a8042f08e4e0e3d4d2d61e075ae257cf2..49d99765b03145420b1cd174b34ade0e31476161 100644
|
| --- a/chrome/browser/resources/media_router/elements/route_details/route_details.js
|
| +++ b/chrome/browser/resources/media_router/elements/route_details/route_details.js
|
| @@ -17,6 +17,16 @@ Polymer({
|
| },
|
|
|
| /**
|
| + * Bitmask of available cast modes compatible with the sink of the current
|
| + * route.
|
| + * @type {number}
|
| + */
|
| + availableCastModes: {
|
| + type: Number,
|
| + value: 0,
|
| + },
|
| +
|
| + /**
|
| * Whether the browser is currently incognito.
|
| * @type {boolean|undefined}
|
| */
|
| @@ -50,23 +60,39 @@ Polymer({
|
| ],
|
|
|
| /**
|
| - * Fires a close-route-click event. This is called when the button to close
|
| + * Fires a close-route event. This is called when the button to close
|
| * the current route is clicked.
|
| *
|
| * @private
|
| */
|
| closeRoute_: function() {
|
| - this.fire('close-route-click', {route: this.route});
|
| + this.fire('close-route', {route: this.route});
|
| },
|
|
|
| /**
|
| - * Fires a start-casting-to-route-click event. This is called when the button
|
| - * to start casting to the current route is clicked.
|
| + * @param {?media_router.Route|undefined} route
|
| + * @param {number} availableCastModes
|
| + * @return {boolean} Whether to show the button that allows casting to the
|
| + * current route or the current route's sink.
|
| + */
|
| + computeCastButtonHidden_: function(route, availableCastModes) {
|
| + return !(route && route.canJoin) && !availableCastModes;
|
| + },
|
| +
|
| + /**
|
| + * Fires a join-route-click event if the current route is joinable, otherwise
|
| + * it fires a cast-new-media-click event, which stops the current route and
|
| + * immediately launches a new route to the same sink. This is called when the
|
| + * button to start casting to the current route is clicked.
|
| *
|
| * @private
|
| */
|
| startCastingToRoute_: function() {
|
| - this.fire('start-casting-to-route-click', {route: this.route});
|
| + if (this.route.canJoin) {
|
| + this.fire('join-route-click', {route: this.route});
|
| + } else {
|
| + this.fire('cast-new-media-click', {route: this.route});
|
| + }
|
| },
|
|
|
| /**
|
|
|