Revert of Add button to add new FSP services to Files app. (patchset #8 id:140001...
[chromium-blink-merge.git] / chrome / browser / resources / media_router / media_router_data.js
blobc6844aa5cd85d6c66883a74b2a3415eb34f6d341
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() {
8 'use strict';
10 /**
11 * @enum {string}
13 var SinkStatus = {
14 IDLE: 'idle',
15 ACTIVE: 'active',
16 REQUEST_PENDING: 'request_pending'
20 /**
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.
24 * @constructor
25 * @struct
27 var CastMode = function(castMode, title, description) {
28 /** @type {number} */
29 this.castMode = castMode;
31 /** @type {string} */
32 this.title = title;
34 /** @type {string} */
35 this.description = description;
39 /**
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.
51 * @constructor
52 * @struct
54 var Issue = function(id, title, message, defaultActionText,
55 defaultActionType, secondaryActionText,
56 secondaryActionType, mediaRouteId, isBlocking,
57 helpURL) {
58 /** @type {string} */
59 this.id = id;
61 /** @type {string} */
62 this.title = title;
64 /** @type {string} */
65 this.message = message;
67 /** @type {string} */
68 this.defaultActionText = defaultActionText;
70 /** @type {number} */
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;
90 /**
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.
97 * @constructor
98 * @struct
100 var Route = function(id, sinkId, title, tabId, isLocal) {
101 /** @type {string} */
102 this.id = id;
104 /** @type {string} */
105 this.sinkId = sinkId;
107 /** @type {string} */
108 this.title = title;
110 /** @type {?number} */
111 this.tabId = tabId;
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.
123 * @constructor
124 * @struct
126 var Sink = function(id, name, status) {
127 /** @type {string} */
128 this.id = id;
130 /** @type {string} */
131 this.name = name;
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.
144 * @constructor
145 * @struct
147 var TabInfo = function(tabId, domain) {
148 /** @type {number} */
149 this.tabId = tabId;
151 /** @type {string} */
152 this.domain = domain;
155 return {
156 SinkStatus: SinkStatus,
157 CastMode: CastMode,
158 Issue: Issue,
159 Route: Route,
160 Sink: Sink,
161 TabInfo: TabInfo,