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

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

Issue 1029213002: Add Media Router JS structs. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 5 years, 9 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
« no previous file with comments | « chrome/browser/browser_resources.grd ('k') | no next file » | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
(Empty)
1 // Copyright (c) 2015 The Chromium Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file.
4
5 cr.define('media_router', function() {
6 'use strict';
7
8 /**
9 * @param {number} castMode The type of cast mode.
mark a. foltz 2015/03/24 18:09:16 Where are legal values defined?
apacible 2015/03/24 20:46:26 RE: all legal values questions -- These are all de
10 * @param {string} title The title of the cast mode.
mark a. foltz 2015/03/24 18:09:17 Is the title and description for internal use, or
apacible 2015/03/24 20:46:26 The description is shown. RE: all localization qu
11 * @param {string} description The description of the cast mode.
12 * @constructor
13 * @struct
14 */
15 var CastMode = function(castMode, title, description) {
16 /** @type {number} */
17 this.castMode = castMode;
18
19 /** @type {string} */
20 this.title = title;
21
22 /** @type {string} */
23 this.description = description;
24 };
25
26 /**
James Hawkins 2015/03/24 17:48:06 nit: Double blank lines between top-level JSDoc bl
apacible 2015/03/24 20:46:26 Done.
27 * @param {string} id The ID of this issue.
mark a. foltz 2015/03/24 18:09:15 What are legal values? Are these defined somewher
apacible 2015/03/24 20:46:26 Issue IDs are created in Media Router using Genera
28 * @param {string} title The issue title.
mark a. foltz 2015/03/24 18:09:16 Similar questions about localization for all the s
apacible 2015/03/24 20:46:27 Acknowledged.
29 * @param {string} message The issue message.
30 * @param {string} defaultActionText The button text of default action.
mark a. foltz 2015/03/24 18:09:16 What if the text overflows the dimensions of the b
apacible 2015/03/24 20:46:26 We'll need to talk to UX about this (and all other
31 * @param {number} defaultActionType The type of default action.
mark a. foltz 2015/03/24 18:09:16 Where are the types defined?
apacible 2015/03/24 20:46:26 Acknowledged.
32 * @param {?string} optActionText The button text of optional action.
33 * @param {?number} optActionType The type of optional action.
mark a. foltz 2015/03/24 18:09:16 Where are the types defined?
apacible 2015/03/24 20:46:26 Acknowledged.
34 * @param {?string} routeId The route ID to which this issue
mark a. foltz 2015/03/24 18:09:17 mediaRouteId
apacible 2015/03/24 20:46:26 Done.
35 * pertains. If not set, this is a global issue.
mark a. foltz 2015/03/24 18:09:16 What if the issue occurred before or after the rou
apacible 2015/03/24 20:46:26 We currently don't have screen-specific issues. If
36 * @param {boolean} isBlocking True if this issue blocks other UI.
37 * @param {?string} helpURL The URL to be opened if learn more is clicked.
38 * @constructor
39 * @struct
40 */
41 var Issue = function(id, title, message, defaultActionText,
42 defaultActionType, optActionText, optActionType,
James Hawkins 2015/03/24 17:48:06 nit: opt_actionText, opt_actionType
apacible 2015/03/24 20:46:26 Ack, question in next comment before I change this
43 routeId, isBlocking, helpURL) {
44 /** @type {string} */
45 this.id = id;
46
47 /** @type {string} */
48 this.title = title;
49
50 /** @type {string} */
51 this.message = message;
52
53 /** @type {string} */
54 this.defaultActionText = defaultActionText;
55
56 /** @type {number} */
57 this.defaultActionType = defaultActionType;
58
59 /** @type {?string} */
60 this.optActionText = optActionText;
James Hawkins 2015/03/24 17:48:06 nit: Only the parameter should have 'opt' in the n
apacible 2015/03/24 20:46:26 Why is 'opt' restricted to the parameter? Should
James Hawkins 2015/03/24 21:27:56 Because the member variable itself is not optional
apacible 2015/03/24 21:58:11 Thanks! Also, should I prepend all optional parame
61
62 /** @type {?number} */
63 this.optActionType = optActionType;
64
65 /** @type {?string} */
66 this.routeId = routeId;
67
68 /** @type {boolean} */
69 this.isBlocking = isBlocking;
70
71 /** @type {?string} */
72 this.helpURL = helpURL;
73 };
74
75 /**
76 * @param {string} id The route ID.
mark a. foltz 2015/03/24 18:09:15 The media route ID
apacible 2015/03/24 20:46:26 Done.
77 * @param {string} sinkId The ID of the sink running this route.
mark a. foltz 2015/03/24 18:09:15 "the media sink"
apacible 2015/03/24 20:46:26 Done.
78 * @param {?string} iconUrl The icon URL of this route.
mark a. foltz 2015/03/24 18:09:16 This should just point to a bundled resource, corr
apacible 2015/03/24 20:46:27 This is the favicon of whatever we're casting. Tal
79 * @param {string} title The short description of this route.
80 * @param {?number} tabId The ID of the tab in which web app is running and
81 * accessing the route.
82 * @param {boolean} isLocal True if this is a locally launched route.
mark a. foltz 2015/03/24 18:09:16 s/launched/created/
apacible 2015/03/24 20:46:27 Done.
83 * @constructor
84 * @struct
85 */
86 var Route = function(id, sinkId, iconUrl, title, tabId, isLocal) {
87 /** @type {string} */
88 this.id = id;
89
90 /** @type {string} */
91 this.sinkId = sinkId;
92
93 /** @type {?string} */
94 this.iconUrl = iconUrl;
95
96 /** @type {string} */
97 this.title = title;
98
99 /** @type {?number} */
100 this.tabId = tabId;
101
102 /** @type {boolean} */
103 this.isLocal = isLocal;
104 };
105
106 /**
107 * @param {string} id The ID of the sink.
mark a. foltz 2015/03/24 18:09:17 "the media sink"
apacible 2015/03/24 20:46:26 Done.
108 * @param {string} name The name of the sink.
109 * @param {media_router.SinkStatus} status The readiness state of the sink.
110 * @param {!Array<number>} castModes Cast modes compatible with the sink.
111 * @constructor
112 * @struct
113 */
114 var Sink = function(id, name, status) {
115 /** @type {string} */
116 this.id = id;
117
118 /** @type {string} */
119 this.name = name;
120
121 /** @type {media_router.SinkStatus} */
122 this.status = status;
123
124 /** @type {!Array<number>} */
125 this.castModes = castModes;
126 };
127
128 /**
129 * @enum {string}
130 */
131 var SinkStatus = {
James Hawkins 2015/03/24 17:48:06 Consider moving SinkStatus higher up (at least hig
apacible 2015/03/24 20:46:26 Moved to top.
132 IDLE: 'idle',
133 ACTIVE: 'active',
134 REQUEST_PENDING: 'request_pending'
135 };
136
137 /**
138 * @param {number} tabId The current tab ID.
139 * @param {string} domain The domain of the current tab.
140 * @param {boolean} hasCastApp True if tab has a current Cast App.
mark a. foltz 2015/03/24 18:09:16 When is this set to true? Does it mean to say "an
apacible 2015/03/24 20:46:26 It's when the tab has a current cast app (e.g. You
141 * @constructor
142 * @struct
143 */
144 var TabInfo = function(tabId, domain, hasCastApp) {
145 /** @type {number} */
146 this.tabId = tabId;
147
148 /** @type {string} */
149 this.domain = domain;
150
151 /** @type {boolean} */
152 this.hasCastApp = hasCastApp;
153 };
154
155 return {
156 CastMode: CastMode,
157 Issue: Issue,
158 Route: Route,
159 Sink: Sink,
160 SinkStatus: SinkStatus,
161 TabInfo: TabInfo,
162 };
163 });
OLDNEW
« no previous file with comments | « chrome/browser/browser_resources.grd ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698