| OLD | NEW |
| 1 // Copyright 2015 The Chromium Authors. All rights reserved. | 1 // Copyright 2015 The Chromium Authors. All rights reserved. |
| 2 // Use of this source code is governed by a BSD-style license that can be | 2 // Use of this source code is governed by a BSD-style license that can be |
| 3 // found in the LICENSE file. | 3 // found in the LICENSE file. |
| 4 | 4 |
| 5 // API invoked by the browser MediaRouterWebUIMessageHandler to communicate | 5 // API invoked by the browser MediaRouterWebUIMessageHandler to communicate |
| 6 // with this UI. | 6 // with this UI. |
| 7 cr.define('media_router.ui', function() { | 7 cr.define('media_router.ui', function() { |
| 8 'use strict'; | 8 'use strict'; |
| 9 | 9 |
| 10 // The media-router-container element. | 10 // The media-router-container element. |
| (...skipping 124 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 135 /** | 135 /** |
| 136 * Closes the given route. | 136 * Closes the given route. |
| 137 * | 137 * |
| 138 * @param {!media_router.Route} route | 138 * @param {!media_router.Route} route |
| 139 */ | 139 */ |
| 140 function closeRoute(route) { | 140 function closeRoute(route) { |
| 141 chrome.send('closeRoute', [{routeId: route.id, isLocal: route.isLocal}]); | 141 chrome.send('closeRoute', [{routeId: route.id, isLocal: route.isLocal}]); |
| 142 } | 142 } |
| 143 | 143 |
| 144 /** | 144 /** |
| 145 * Joins the given route. |
| 146 * |
| 147 * @param {!media_router.Route} route |
| 148 */ |
| 149 function joinRoute(route) { |
| 150 chrome.send('joinRoute', [{sinkId: route.sinkId, routeId: route.id}]); |
| 151 } |
| 152 |
| 153 /** |
| 145 * Indicates that the initial data has been received. | 154 * Indicates that the initial data has been received. |
| 146 */ | 155 */ |
| 147 function onInitialDataReceived() { | 156 function onInitialDataReceived() { |
| 148 chrome.send('onInitialDataReceived'); | 157 chrome.send('onInitialDataReceived'); |
| 149 } | 158 } |
| 150 | 159 |
| 151 /** | 160 /** |
| 152 * Reports the index of the selected sink. | 161 * Reports the index of the selected sink. |
| 153 * | 162 * |
| 154 * @param {number} sinkIndex | 163 * @param {number} sinkIndex |
| (...skipping 46 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 201 */ | 210 */ |
| 202 function requestRoute(sinkId, selectedCastMode) { | 211 function requestRoute(sinkId, selectedCastMode) { |
| 203 chrome.send('requestRoute', | 212 chrome.send('requestRoute', |
| 204 [{sinkId: sinkId, selectedCastMode: selectedCastMode}]); | 213 [{sinkId: sinkId, selectedCastMode: selectedCastMode}]); |
| 205 } | 214 } |
| 206 | 215 |
| 207 return { | 216 return { |
| 208 actOnIssue: actOnIssue, | 217 actOnIssue: actOnIssue, |
| 209 closeDialog: closeDialog, | 218 closeDialog: closeDialog, |
| 210 closeRoute: closeRoute, | 219 closeRoute: closeRoute, |
| 220 joinRoute: joinRoute, |
| 211 onInitialDataReceived: onInitialDataReceived, | 221 onInitialDataReceived: onInitialDataReceived, |
| 212 reportClickedSinkIndex: reportClickedSinkIndex, | 222 reportClickedSinkIndex: reportClickedSinkIndex, |
| 213 reportNavigateToView: reportNavigateToView, | 223 reportNavigateToView: reportNavigateToView, |
| 214 reportSelectedCastMode: reportSelectedCastMode, | 224 reportSelectedCastMode: reportSelectedCastMode, |
| 215 reportSinkCount: reportSinkCount, | 225 reportSinkCount: reportSinkCount, |
| 216 requestInitialData: requestInitialData, | 226 requestInitialData: requestInitialData, |
| 217 requestRoute: requestRoute, | 227 requestRoute: requestRoute, |
| 218 }; | 228 }; |
| 219 }); | 229 }); |
| OLD | NEW |