Chromium Code Reviews| 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 126 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 137 /** | 137 /** |
| 138 * Closes the given route. | 138 * Closes the given route. |
| 139 * | 139 * |
| 140 * @param {!media_router.Route} route | 140 * @param {!media_router.Route} route |
| 141 */ | 141 */ |
| 142 function closeRoute(route) { | 142 function closeRoute(route) { |
| 143 chrome.send('closeRoute', [{routeId: route.id}]); | 143 chrome.send('closeRoute', [{routeId: route.id}]); |
| 144 } | 144 } |
| 145 | 145 |
| 146 /** | 146 /** |
| 147 * Reports the current number of sinks. | |
| 148 * | |
| 149 * @param {number} sinkCount | |
| 150 */ | |
| 151 function reportSinkCount(sinkCount) { | |
| 152 chrome.send('reportSinkCount', [{sinkCount: sinkCount}]); | |
|
imcheng
2015/10/26 17:18:14
Is it possible to just return the sinkCount in the
apacible
2015/10/26 17:52:32
Done.
| |
| 153 } | |
| 154 | |
| 155 /** | |
| 147 * Requests data to initialize the WebUI with. | 156 * Requests data to initialize the WebUI with. |
| 148 * The data will be returned via media_router.ui.setInitialData. | 157 * The data will be returned via media_router.ui.setInitialData. |
| 149 */ | 158 */ |
| 150 function requestInitialData() { | 159 function requestInitialData() { |
| 151 chrome.send('requestInitialData'); | 160 chrome.send('requestInitialData'); |
| 152 } | 161 } |
| 153 | 162 |
| 154 /** | 163 /** |
| 155 * Requests that a media route be started with the given sink. | 164 * Requests that a media route be started with the given sink. |
| 156 * | 165 * |
| 157 * @param {string} sinkId The sink ID. | 166 * @param {string} sinkId The sink ID. |
| 158 * @param {number} selectedCastMode The value of the cast mode the user | 167 * @param {number} selectedCastMode The value of the cast mode the user |
| 159 * selected. | 168 * selected. |
| 160 */ | 169 */ |
| 161 function requestRoute(sinkId, selectedCastMode) { | 170 function requestRoute(sinkId, selectedCastMode) { |
| 162 chrome.send('requestRoute', | 171 chrome.send('requestRoute', |
| 163 [{sinkId: sinkId, selectedCastMode: selectedCastMode}]); | 172 [{sinkId: sinkId, selectedCastMode: selectedCastMode}]); |
| 164 } | 173 } |
| 165 | 174 |
| 166 return { | 175 return { |
| 167 actOnIssue: actOnIssue, | 176 actOnIssue: actOnIssue, |
| 168 closeDialog: closeDialog, | 177 closeDialog: closeDialog, |
| 169 closeRoute: closeRoute, | 178 closeRoute: closeRoute, |
| 179 reportSinkCount: reportSinkCount, | |
| 170 requestInitialData: requestInitialData, | 180 requestInitialData: requestInitialData, |
| 171 requestRoute: requestRoute, | 181 requestRoute: requestRoute, |
| 172 }; | 182 }; |
| 173 }); | 183 }); |
| OLD | NEW |