Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(31)

Side by Side Diff: chrome/browser/resources/media_router/media_router_data.js

Issue 2725503002: [Media Router] Custom Controls 4 - Implement details view WebUI (Closed)
Patch Set: Add braces to @implements {Interface} Created 3 years, 7 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
OLDNEW
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 168 matching lines...) Expand 10 before | Expand all | Expand 10 after
205 /** @type {boolean} */ 215 /** @type {boolean} */
206 this.canJoin = canJoin; 216 this.canJoin = canJoin;
207 217
208 /** @type {number|undefined} */ 218 /** @type {number|undefined} */
209 this.currentCastMode = undefined; 219 this.currentCastMode = undefined;
210 220
211 /** @type {?string} */ 221 /** @type {?string} */
212 this.customControllerPath = customControllerPath; 222 this.customControllerPath = customControllerPath;
213 }; 223 };
214 224
225 /**
226 * @param {string} title The title of the route.
227 * @param {string} description A description for the route.
228 * @param {boolean} canPlayPause Whether the route can be played/paused.
229 * @param {boolean} canMute Whether the route can be muted/unmuted.
230 * @param {boolean} canSetVolume Whether the route volume can be changed.
231 * @param {boolean} canSeek Whether the route's playback position can be
232 * changed.
233 * @param {boolean} isPaused Whether the route is paused.
234 * @param {boolean} isMuted Whether the route is muted.
235 * @param {number} volume The route's volume, between 0 and 1.
236 * @param {number} duration The route's duration in seconds.
237 * @param {number} currentTime The route's current position in seconds.
238 * Must not be greater than |duration|.
239 * @constructor
240 * @struct
241 */
242 var RouteStatus = function(
243 title, description, canPlayPause, canMute, canSetVolume, canSeek,
244 isPaused, isMuted, volume, duration, currentTime) {
245
246 /** @type {string} */
247 this.title = title;
248
249 /** @type {string} */
250 this.description = description;
251
252 /** @type {boolean} */
253 this.canPlayPause = canPlayPause;
254
255 /** @type {boolean} */
256 this.canMute = canMute;
257
258 /** @type {boolean} */
259 this.canSetVolume = canSetVolume;
260
261 /** @type {boolean} */
262 this.canSeek = canSeek;
263
264 /** @type {boolean} */
265 this.isPaused = isPaused;
266
267 /** @type {boolean} */
268 this.isMuted = isMuted;
269
270 /** @type {number} */
271 this.volume = volume;
272
273 /** @type {number} */
274 this.duration = duration;
275
276 /** @type {number} */
277 this.currentTime = currentTime;
278 };
279
215 280
216 /** 281 /**
217 * @param {string} id The ID of the media sink. 282 * @param {string} id The ID of the media sink.
218 * @param {string} name The name of the sink. 283 * @param {string} name The name of the sink.
219 * @param {?string} description Optional description of the sink. 284 * @param {?string} description Optional description of the sink.
220 * @param {?string} domain Optional domain of the sink. 285 * @param {?string} domain Optional domain of the sink.
221 * @param {media_router.SinkIconType} iconType the type of icon for the sink. 286 * @param {media_router.SinkIconType} iconType the type of icon for the sink.
222 * @param {media_router.SinkStatus} status The readiness state of the sink. 287 * @param {media_router.SinkStatus} status The readiness state of the sink.
223 * @param {number} castModes Bitset of cast modes compatible with the sink. 288 * @param {number} castModes Bitset of cast modes compatible with the sink.
224 * @constructor 289 * @constructor
(...skipping 39 matching lines...) Expand 10 before | Expand all | Expand 10 after
264 329
265 /** @type {string} */ 330 /** @type {string} */
266 this.domain = domain; 331 this.domain = domain;
267 }; 332 };
268 333
269 return { 334 return {
270 AUTO_CAST_MODE: AUTO_CAST_MODE, 335 AUTO_CAST_MODE: AUTO_CAST_MODE,
271 CastMode: CastMode, 336 CastMode: CastMode,
272 Issue: Issue, 337 Issue: Issue,
273 Route: Route, 338 Route: Route,
339 RouteStatus: RouteStatus,
274 Sink: Sink, 340 Sink: Sink,
275 TabInfo: TabInfo, 341 TabInfo: TabInfo,
276 }; 342 };
277 }); 343 });
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698