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 cr.define('media_router', function() { | 7 cr.define('media_router', function() { |
8 'use strict'; | 8 'use strict'; |
9 | 9 |
10 /** | 10 /** |
11 * @enum {string} | 11 * @enum {string} |
12 */ | 12 */ |
13 var SinkStatus = { | 13 var SinkStatus = { |
14 IDLE: 'idle', | 14 IDLE: 'idle', |
15 ACTIVE: 'active', | 15 ACTIVE: 'active', |
16 REQUEST_PENDING: 'request_pending' | 16 REQUEST_PENDING: 'request_pending' |
17 }; | 17 }; |
18 | 18 |
19 | 19 |
20 /** | 20 /** |
21 * @param {number} type The type of cast mode. This corresponds to the | 21 * @param {number} type The type of cast mode. This corresponds to the |
22 * C++ MediaCastMode. | 22 * C++ MediaCastMode. |
apacible
2015/08/10 14:13:27
Can you also align this with the first instance of
haibinlu
2015/08/11 01:31:47
Done.
| |
23 * @param {string} title The title of the cast mode. | 23 * @param {string} title The title of the cast mode. |
24 * @param {string} description The description of the cast mode. | 24 * @param {string} description The description of the cast mode. |
25 * @param {string} host The hostname of the site to cast. | 25 * @param {string} host The hostname of the site to cast. |
26 * @constructor | 26 * @constructor |
27 * @struct | 27 * @struct |
28 */ | 28 */ |
29 var CastMode = function(type, title, description, host) { | 29 var CastMode = function(type, title, description, host) { |
30 /** @type {number} */ | 30 /** @type {number} */ |
31 this.type = type; | 31 this.type = type; |
32 | 32 |
(...skipping 82 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
115 /** @type {?string} */ | 115 /** @type {?string} */ |
116 this.customControllerPath = customControllerPath; | 116 this.customControllerPath = customControllerPath; |
117 }; | 117 }; |
118 | 118 |
119 | 119 |
120 /** | 120 /** |
121 * @param {string} id The ID of the media sink. | 121 * @param {string} id The ID of the media sink. |
122 * @param {string} name The name of the sink. | 122 * @param {string} name The name of the sink. |
123 * @param {media_router.SinkStatus} status The readiness state of the sink. | 123 * @param {media_router.SinkStatus} status The readiness state of the sink. |
124 * @param {!Array<number>} castModes Cast modes compatible with the sink. | 124 * @param {!Array<number>} castModes Cast modes compatible with the sink. |
125 * @param {boolean} isLaunching True if the Media Router is creating a route | |
126 * to this sink. | |
apacible
2015/08/10 14:13:27
nit: align with "isLaunching" on the line above.
haibinlu
2015/08/11 01:31:47
Done.
| |
125 * @constructor | 127 * @constructor |
126 * @struct | 128 * @struct |
127 */ | 129 */ |
128 var Sink = function(id, name, status, castModes) { | 130 var Sink = function(id, name, status, castModes, isLaunching) { |
129 /** @type {string} */ | 131 /** @type {string} */ |
130 this.id = id; | 132 this.id = id; |
131 | 133 |
132 /** @type {string} */ | 134 /** @type {string} */ |
133 this.name = name; | 135 this.name = name; |
134 | 136 |
135 /** @type {media_router.SinkStatus} */ | 137 /** @type {media_router.SinkStatus} */ |
136 this.status = status; | 138 this.status = status; |
137 | 139 |
138 /** @type {!Array<number>} */ | 140 /** @type {!Array<number>} */ |
139 this.castModes = castModes; | 141 this.castModes = castModes; |
142 | |
143 /** @type {boolean} */ | |
144 this.isLaunching = isLaunching; | |
140 }; | 145 }; |
141 | 146 |
142 | 147 |
143 /** | 148 /** |
144 * @param {number} tabId The current tab ID. | 149 * @param {number} tabId The current tab ID. |
145 * @param {string} domain The domain of the current tab. | 150 * @param {string} domain The domain of the current tab. |
146 * @constructor | 151 * @constructor |
147 * @struct | 152 * @struct |
148 */ | 153 */ |
149 var TabInfo = function(tabId, domain) { | 154 var TabInfo = function(tabId, domain) { |
150 /** @type {number} */ | 155 /** @type {number} */ |
151 this.tabId = tabId; | 156 this.tabId = tabId; |
152 | 157 |
153 /** @type {string} */ | 158 /** @type {string} */ |
154 this.domain = domain; | 159 this.domain = domain; |
155 }; | 160 }; |
156 | 161 |
157 return { | 162 return { |
158 SinkStatus: SinkStatus, | 163 SinkStatus: SinkStatus, |
159 CastMode: CastMode, | 164 CastMode: CastMode, |
160 Issue: Issue, | 165 Issue: Issue, |
161 Route: Route, | 166 Route: Route, |
162 Sink: Sink, | 167 Sink: Sink, |
163 TabInfo: TabInfo, | 168 TabInfo: TabInfo, |
164 }; | 169 }; |
165 }); | 170 }); |
OLD | NEW |