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 // Any strings used here will already be localized. Values such as | 5 // Any strings used here will already be localized. Values such as |
6 // CastMode.type or IDs will be defined elsewhere and determined later. | 6 // CastMode.type or IDs will be defined elsewhere and determined later. |
7 | 7 |
8 cr.exportPath('media_router'); | 8 cr.exportPath('media_router'); |
9 | 9 |
10 /** | 10 /** |
11 * This corresponds to the C++ MediaCastMode, with the exception of AUTO. | 11 * This corresponds to the C++ MediaCastMode, with the exception of AUTO. |
12 * See below for details. Note to support fast bitset operations, the values | 12 * See below for details. Note to support fast bitset operations, the values |
13 * here are (1 << [corresponding value in MR]). | 13 * here are (1 << [corresponding value in MR]). |
14 * @enum {number} | 14 * @enum {number} |
15 */ | 15 */ |
16 media_router.CastModeType = { | 16 media_router.CastModeType = { |
17 // Note: AUTO mode is only used to configure the sink list container to show | 17 // Note: AUTO mode is only used to configure the sink list container to show |
18 // all sinks. Individual sinks are configured with a specific cast mode | 18 // all sinks. Individual sinks are configured with a specific cast mode |
19 // (DEFAULT, TAB_MIRROR, DESKTOP_MIRROR). | 19 // (DEFAULT, TAB_MIRROR, DESKTOP_MIRROR). |
20 AUTO: -1, | 20 AUTO: -1, |
21 DEFAULT: 0x1, | 21 DEFAULT: 0x1, |
22 TAB_MIRROR: 0x2, | 22 TAB_MIRROR: 0x2, |
23 DESKTOP_MIRROR: 0x4, | 23 DESKTOP_MIRROR: 0x4, |
24 }; | 24 }; |
25 | 25 |
26 /** | 26 /** |
| 27 * Route controller types that can be shown in the route details view. |
| 28 * @enum {number} |
| 29 */ |
| 30 media_router.ControllerType = { |
| 31 NONE: 0, |
| 32 WEBUI: 1, |
| 33 EXTENSION: 2, |
| 34 }; |
| 35 |
| 36 /** |
27 * The ESC key maps to KeyboardEvent.key value 'Escape'. | 37 * The ESC key maps to KeyboardEvent.key value 'Escape'. |
28 * @const {string} | 38 * @const {string} |
29 */ | 39 */ |
30 media_router.KEY_ESC = 'Escape'; | 40 media_router.KEY_ESC = 'Escape'; |
31 | 41 |
32 /** | 42 /** |
33 * This corresponds to the C++ MediaRouterMetrics | 43 * This corresponds to the C++ MediaRouterMetrics |
34 * MediaRouterRouteCreationOutcome. | 44 * MediaRouterRouteCreationOutcome. |
35 * @enum {number} | 45 * @enum {number} |
36 */ | 46 */ |
(...skipping 163 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
200 /** @type {boolean} */ | 210 /** @type {boolean} */ |
201 this.canJoin = canJoin; | 211 this.canJoin = canJoin; |
202 | 212 |
203 /** @type {number|undefined} */ | 213 /** @type {number|undefined} */ |
204 this.currentCastMode = undefined; | 214 this.currentCastMode = undefined; |
205 | 215 |
206 /** @type {?string} */ | 216 /** @type {?string} */ |
207 this.customControllerPath = customControllerPath; | 217 this.customControllerPath = customControllerPath; |
208 }; | 218 }; |
209 | 219 |
| 220 /** |
| 221 * @param {string} title The title of the route. |
| 222 * @param {string} description A description for the route. |
| 223 * @param {boolean} canPlayPause Whether the route can be played/paused. |
| 224 * @param {boolean} canMute Whether the route can be muted/unmuted. |
| 225 * @param {boolean} canSetVolume Whether the route volume can be changed. |
| 226 * @param {boolean} canSeek Whether the route's playback position can be |
| 227 * changed. |
| 228 * @param {boolean} isPaused Whether the route is paused. |
| 229 * @param {boolean} isMuted Whether the route is muted. |
| 230 * @param {number} volume The route's volume, between 0 and 1. |
| 231 * @param {number} duration The route's duration in seconds. |
| 232 * @param {number} currentTime The route's current position in seconds. |
| 233 * Must not be greater than |duration|. |
| 234 */ |
| 235 var RouteStatus = function(title, description, canPlayPause, canMute, |
| 236 canSetVolume, canSeek, isPaused, isMuted, volume, duration, currentTime) { |
| 237 |
| 238 /** @type {string} */ |
| 239 this.title = title; |
| 240 |
| 241 /** @type {string} */ |
| 242 this.description = description; |
| 243 |
| 244 /** @type {boolean} */ |
| 245 this.canPlayPause = canPlayPause; |
| 246 |
| 247 /** @type {boolean} */ |
| 248 this.canMute = canMute; |
| 249 |
| 250 /** @type {boolean} */ |
| 251 this.canSetVolume = canSetVolume; |
| 252 |
| 253 /** @type {boolean} */ |
| 254 this.canSeek = canSeek; |
| 255 |
| 256 /** @type {boolean} */ |
| 257 this.isPaused = isPaused; |
| 258 |
| 259 /** @type {boolean} */ |
| 260 this.isMuted = isMuted; |
| 261 |
| 262 /** @type {number} */ |
| 263 this.volume = volume; |
| 264 |
| 265 /** @type {number} */ |
| 266 this.duration = duration; |
| 267 |
| 268 /** @type {number} */ |
| 269 this.currentTime = currentTime; |
| 270 }; |
| 271 |
210 | 272 |
211 /** | 273 /** |
212 * @param {string} id The ID of the media sink. | 274 * @param {string} id The ID of the media sink. |
213 * @param {string} name The name of the sink. | 275 * @param {string} name The name of the sink. |
214 * @param {?string} description Optional description of the sink. | 276 * @param {?string} description Optional description of the sink. |
215 * @param {?string} domain Optional domain of the sink. | 277 * @param {?string} domain Optional domain of the sink. |
216 * @param {media_router.SinkIconType} iconType the type of icon for the sink. | 278 * @param {media_router.SinkIconType} iconType the type of icon for the sink. |
217 * @param {media_router.SinkStatus} status The readiness state of the sink. | 279 * @param {media_router.SinkStatus} status The readiness state of the sink. |
218 * @param {number} castModes Bitset of cast modes compatible with the sink. | 280 * @param {number} castModes Bitset of cast modes compatible with the sink. |
219 * @constructor | 281 * @constructor |
(...skipping 39 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
259 | 321 |
260 /** @type {string} */ | 322 /** @type {string} */ |
261 this.domain = domain; | 323 this.domain = domain; |
262 }; | 324 }; |
263 | 325 |
264 return { | 326 return { |
265 AUTO_CAST_MODE: AUTO_CAST_MODE, | 327 AUTO_CAST_MODE: AUTO_CAST_MODE, |
266 CastMode: CastMode, | 328 CastMode: CastMode, |
267 Issue: Issue, | 329 Issue: Issue, |
268 Route: Route, | 330 Route: Route, |
| 331 RouteStatus: RouteStatus, |
269 Sink: Sink, | 332 Sink: Sink, |
270 TabInfo: TabInfo, | 333 TabInfo: TabInfo, |
271 }; | 334 }; |
272 }); | 335 }); |
OLD | NEW |