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.
5 // Any strings used here will already be localized. Values such as castMode or
6 // IDs will be defined elsewhere and determined later.
7 cr
.define('media_router', function() {
16 REQUEST_PENDING
: 'request_pending'
21 * @param {number} castMode The type of cast mode.
22 * @param {string} title The title of the cast mode.
23 * @param {string} description The description of the cast mode.
27 var CastMode = function(castMode
, title
, description
) {
29 this.castMode
= castMode
;
35 this.description
= description
;
40 * @param {string} id The ID of this issue.
41 * @param {string} title The issue title.
42 * @param {string} message The issue message.
43 * @param {string} defaultActionText The button text of default action.
44 * @param {number} defaultActionType The type of default action.
45 * @param {?string} secondaryActionText The button text of optional action.
46 * @param {?number} secondaryActionType The type of optional action.
47 * @param {?string} mediaRouteId The route ID to which this issue
48 * pertains. If not set, this is a global issue.
49 * @param {boolean} isBlocking True if this issue blocks other UI.
50 * @param {?string} helpURL The URL to be opened if learn more is clicked.
54 var Issue = function(id
, title
, message
, defaultActionText
,
55 defaultActionType
, secondaryActionText
,
56 secondaryActionType
, mediaRouteId
, isBlocking
,
65 this.message
= message
;
68 this.defaultActionText
= defaultActionText
;
71 this.defaultActionType
= defaultActionType
;
73 /** @type {?string} */
74 this.secondaryActionText
= secondaryActionText
;
76 /** @type {?number} */
77 this.secondaryActionType
= secondaryActionType
;
79 /** @type {?string} */
80 this.mediaRouteId
= mediaRouteId
;
82 /** @type {boolean} */
83 this.isBlocking
= isBlocking
;
85 /** @type {?string} */
86 this.helpURL
= helpURL
;
91 * @param {string} id The media route ID.
92 * @param {string} sinkId The ID of the media sink running this route.
93 * @param {string} title The short description of this route.
94 * @param {?number} tabId The ID of the tab in which web app is running and
95 * accessing the route.
96 * @param {boolean} isLocal True if this is a locally created route.
100 var Route = function(id
, sinkId
, title
, tabId
, isLocal
) {
101 /** @type {string} */
104 /** @type {string} */
105 this.sinkId
= sinkId
;
107 /** @type {string} */
110 /** @type {?number} */
113 /** @type {boolean} */
114 this.isLocal
= isLocal
;
119 * @param {string} id The ID of the media sink.
120 * @param {string} name The name of the sink.
121 * @param {media_router.SinkStatus} status The readiness state of the sink.
122 * @param {!Array<number>} castModes Cast modes compatible with the sink.
126 var Sink = function(id
, name
, status
) {
127 /** @type {string} */
130 /** @type {string} */
133 /** @type {media_router.SinkStatus} */
134 this.status
= status
;
136 /** @type {!Array<number>} */
137 this.castModes
= castModes
;
142 * @param {number} tabId The current tab ID.
143 * @param {string} domain The domain of the current tab.
147 var TabInfo = function(tabId
, domain
) {
148 /** @type {number} */
151 /** @type {string} */
152 this.domain
= domain
;
156 SinkStatus
: SinkStatus
,