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 /** |
(...skipping 86 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
97 REQUEST_PENDING: 'request_pending' | 97 REQUEST_PENDING: 'request_pending' |
98 }; | 98 }; |
99 | 99 |
100 cr.define('media_router', function() { | 100 cr.define('media_router', function() { |
101 'use strict'; | 101 'use strict'; |
102 | 102 |
103 /** | 103 /** |
104 * @param {number} type The type of cast mode. | 104 * @param {number} type The type of cast mode. |
105 * @param {string} description The description of the cast mode. | 105 * @param {string} description The description of the cast mode. |
106 * @param {?string} host The hostname of the site to cast. | 106 * @param {?string} host The hostname of the site to cast. |
| 107 * @param {boolean} isForced True if the mode is forced. |
107 * @constructor | 108 * @constructor |
108 * @struct | 109 * @struct |
109 */ | 110 */ |
110 var CastMode = function(type, description, host) { | 111 var CastMode = function(type, description, host, isForced) { |
111 /** @type {number} */ | 112 /** @type {number} */ |
112 this.type = type; | 113 this.type = type; |
113 | 114 |
114 /** @type {string} */ | 115 /** @type {string} */ |
115 this.description = description; | 116 this.description = description; |
116 | 117 |
117 /** @type {?string} */ | 118 /** @type {?string} */ |
118 this.host = host || null; | 119 this.host = host || null; |
| 120 |
| 121 /** @type {boolean} */ |
| 122 this.isForced = isForced; |
119 }; | 123 }; |
120 | 124 |
121 /** | 125 /** |
122 * Placeholder object for AUTO cast mode. See comment in CastModeType. | 126 * Placeholder object for AUTO cast mode. See comment in CastModeType. |
123 * @const {!media_router.CastMode} | 127 * @const {!media_router.CastMode} |
124 */ | 128 */ |
125 var AUTO_CAST_MODE = new CastMode(media_router.CastModeType.AUTO, | 129 var AUTO_CAST_MODE = new CastMode(media_router.CastModeType.AUTO, |
126 loadTimeData.getString('autoCastMode'), null); | 130 loadTimeData.getString('autoCastMode'), |
| 131 null, false); |
127 | 132 |
128 /** | 133 /** |
129 * @param {number} id The ID of this issue. | 134 * @param {number} id The ID of this issue. |
130 * @param {string} title The issue title. | 135 * @param {string} title The issue title. |
131 * @param {string} message The issue message. | 136 * @param {string} message The issue message. |
132 * @param {number} defaultActionType The type of default action. | 137 * @param {number} defaultActionType The type of default action. |
133 * @param {number|undefined} secondaryActionType The type of optional action. | 138 * @param {number|undefined} secondaryActionType The type of optional action. |
134 * @param {?string} routeId The route ID to which this issue | 139 * @param {?string} routeId The route ID to which this issue |
135 * pertains. If not set, this is a global issue. | 140 * pertains. If not set, this is a global issue. |
136 * @param {boolean} isBlocking True if this issue blocks other UI. | 141 * @param {boolean} isBlocking True if this issue blocks other UI. |
(...skipping 126 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
263 | 268 |
264 return { | 269 return { |
265 AUTO_CAST_MODE: AUTO_CAST_MODE, | 270 AUTO_CAST_MODE: AUTO_CAST_MODE, |
266 CastMode: CastMode, | 271 CastMode: CastMode, |
267 Issue: Issue, | 272 Issue: Issue, |
268 Route: Route, | 273 Route: Route, |
269 Sink: Sink, | 274 Sink: Sink, |
270 TabInfo: TabInfo, | 275 TabInfo: TabInfo, |
271 }; | 276 }; |
272 }); | 277 }); |
OLD | NEW |