| 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 123 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 134 /** | 134 /** |
| 135 * Closes the given route. | 135 * Closes the given route. |
| 136 * | 136 * |
| 137 * @param {!media_router.Route} route | 137 * @param {!media_router.Route} route |
| 138 */ | 138 */ |
| 139 function closeRoute(route) { | 139 function closeRoute(route) { |
| 140 chrome.send('closeRoute', [{routeId: route.id}]); | 140 chrome.send('closeRoute', [{routeId: route.id}]); |
| 141 } | 141 } |
| 142 | 142 |
| 143 /** | 143 /** |
| 144 * Joins the given route. |
| 145 * |
| 146 * @param {!media_router.Route} route |
| 147 */ |
| 148 function joinRoute(route) { |
| 149 chrome.send('joinRoute', [{sinkId: route.sinkId, routeId: route.id}]); |
| 150 } |
| 151 |
| 152 /** |
| 144 * Indicates that the initial data has been received. | 153 * Indicates that the initial data has been received. |
| 145 */ | 154 */ |
| 146 function onInitialDataReceived() { | 155 function onInitialDataReceived() { |
| 147 chrome.send('onInitialDataReceived'); | 156 chrome.send('onInitialDataReceived'); |
| 148 } | 157 } |
| 149 | 158 |
| 150 /** | 159 /** |
| 151 * Reports the current number of sinks. | 160 * Reports the current number of sinks. |
| 152 * | 161 * |
| 153 * @param {number} sinkCount | 162 * @param {number} sinkCount |
| (...skipping 19 matching lines...) Expand all Loading... |
| 173 */ | 182 */ |
| 174 function requestRoute(sinkId, selectedCastMode) { | 183 function requestRoute(sinkId, selectedCastMode) { |
| 175 chrome.send('requestRoute', | 184 chrome.send('requestRoute', |
| 176 [{sinkId: sinkId, selectedCastMode: selectedCastMode}]); | 185 [{sinkId: sinkId, selectedCastMode: selectedCastMode}]); |
| 177 } | 186 } |
| 178 | 187 |
| 179 return { | 188 return { |
| 180 actOnIssue: actOnIssue, | 189 actOnIssue: actOnIssue, |
| 181 closeDialog: closeDialog, | 190 closeDialog: closeDialog, |
| 182 closeRoute: closeRoute, | 191 closeRoute: closeRoute, |
| 192 joinRoute: joinRoute, |
| 183 onInitialDataReceived: onInitialDataReceived, | 193 onInitialDataReceived: onInitialDataReceived, |
| 184 reportSinkCount: reportSinkCount, | 194 reportSinkCount: reportSinkCount, |
| 185 requestInitialData: requestInitialData, | 195 requestInitialData: requestInitialData, |
| 186 requestRoute: requestRoute, | 196 requestRoute: requestRoute, |
| 187 }; | 197 }; |
| 188 }); | 198 }); |
| OLD | NEW |