Chromium Code Reviews| Index: chrome/browser/resources/media_router/media_router.js |
| diff --git a/chrome/browser/resources/media_router/media_router.js b/chrome/browser/resources/media_router/media_router.js |
| index 834f9effc655bd84f1fc3004b5d1c4caf8872abb..f5883c21be309ae777b650bce5643f96eff22695 100644 |
| --- a/chrome/browser/resources/media_router/media_router.js |
| +++ b/chrome/browser/resources/media_router/media_router.js |
| @@ -37,6 +37,8 @@ cr.define('media_router', function() { |
| container.addEventListener('cast-mode-selected', onCastModeSelected); |
| container.addEventListener('close-dialog', onCloseDialog); |
| container.addEventListener('close-route-click', onCloseRouteClick); |
| + container.addEventListener('close-route-for-new-media', |
| + onCloseRouteForNewMedia); |
|
amp
2016/05/23 21:42:35
Can't this reuse the onCloseRouteClick handler as
btolsch
2016/05/23 22:41:10
It is identical, but I wasn't sure if it would be
apacible
2016/05/25 00:56:34
Reusing onCloseRouteClick is fine.
|
| container.addEventListener('create-route', onCreateRoute); |
| container.addEventListener('issue-action-click', onIssueActionClick); |
| container.addEventListener('navigate-sink-list-to-details', |
| @@ -221,6 +223,20 @@ cr.define('media_router', function() { |
| } |
| /** |
| + * Stops a route. |
| + * Called when the user requests to cast to a sink that already has a route. |
| + * |
| + * @param {!Event} event |
| + * Parameters in |event|.detail: |
| + * route - The route to close. |
| + */ |
| + function onCloseRouteForNewMedia(event) { |
| + /** @type {{route: !media_router.Route}} */ |
| + var detail = event.detail; |
| + media_router.browserApi.closeRoute(detail.route); |
| + } |
| + |
| + /** |
| * Starts casting to an existing route. |
| * Called when the user requests to start casting to a media route. |
| * |