[sql] Remove _HAS_EXCEPTIONS=0 from build info.
[chromium-blink-merge.git] / chrome / browser / resources / media_router / media_router_data.js
blobcbe7cc46f9c62e45b76e4e7a223ebd3204b19c92
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
3 // found in the LICENSE file.
5 // Any strings used here will already be localized. Values such as
6 // CastMode.type or IDs will be defined elsewhere and determined later.
7 cr.define('media_router', function() {
8 'use strict';
10 /**
11 * This corresponds to the C++ MediaCastMode.
12 * @enum {number}
14 var CastModeType = {
15 DEFAULT: 0,
16 TAB_MIRROR: 1,
17 DESKTOP_MIRROR: 2,
20 /**
21 * @enum {string}
23 var SinkStatus = {
24 IDLE: 'idle',
25 ACTIVE: 'active',
26 REQUEST_PENDING: 'request_pending'
30 /**
31 * @param {media_router.CastModeType} type The type of cast mode.
32 * @param {string} title The title of the cast mode.
33 * @param {string} description The description of the cast mode.
34 * @param {string} host The hostname of the site to cast.
35 * @constructor
36 * @struct
38 var CastMode = function(type, title, description, host) {
39 /** @type {number} */
40 this.type = type;
42 /** @type {string} */
43 this.title = title;
45 /** @type {string} */
46 this.description = description;
48 /** @type {string} */
49 this.host = host || null;
53 /**
54 * @param {string} id The ID of this issue.
55 * @param {string} title The issue title.
56 * @param {string} message The issue message.
57 * @param {number} defaultActionType The type of default action.
58 * @param {?number} secondaryActionType The type of optional action.
59 * @param {?string} mediaRouteId The route ID to which this issue
60 * pertains. If not set, this is a global issue.
61 * @param {boolean} isBlocking True if this issue blocks other UI.
62 * @param {?number} helpPageId The numeric help center ID.
63 * @constructor
64 * @struct
66 var Issue = function(id, title, message, defaultActionType,
67 secondaryActionType, mediaRouteId, isBlocking,
68 helpPageId) {
69 /** @type {string} */
70 this.id = id;
72 /** @type {string} */
73 this.title = title;
75 /** @type {string} */
76 this.message = message;
78 /** @type {number} */
79 this.defaultActionType = defaultActionType;
81 /** @type {?number} */
82 this.secondaryActionType = secondaryActionType;
84 /** @type {?string} */
85 this.mediaRouteId = mediaRouteId;
87 /** @type {boolean} */
88 this.isBlocking = isBlocking;
90 /** @type {?number} */
91 this.helpPageId = helpPageId;
95 /**
96 * @param {string} id The media route ID.
97 * @param {string} sinkId The ID of the media sink running this route.
98 * @param {string} title The short description of this route.
99 * @param {?number} tabId The ID of the tab in which web app is running and
100 * accessing the route.
101 * @param {boolean} isLocal True if this is a locally created route.
102 * @param {?string} customControllerPath non-empty if this route has custom
103 * controller.
104 * @constructor
105 * @struct
107 var Route = function(id, sinkId, title, tabId, isLocal,
108 customControllerPath) {
109 /** @type {string} */
110 this.id = id;
112 /** @type {string} */
113 this.sinkId = sinkId;
115 /** @type {string} */
116 this.title = title;
118 /** @type {?number} */
119 this.tabId = tabId;
121 /** @type {boolean} */
122 this.isLocal = isLocal;
124 /** @type {?string} */
125 this.customControllerPath = customControllerPath;
130 * @param {string} id The ID of the media sink.
131 * @param {string} name The name of the sink.
132 * @param {media_router.SinkStatus} status The readiness state of the sink.
133 * @param {!Array<number>} castModes Cast modes compatible with the sink.
134 * @constructor
135 * @struct
137 var Sink = function(id, name, status, castModes) {
138 /** @type {string} */
139 this.id = id;
141 /** @type {string} */
142 this.name = name;
144 /** @type {media_router.SinkStatus} */
145 this.status = status;
147 /** @type {!Array<number>} */
148 this.castModes = castModes;
153 * @param {number} tabId The current tab ID.
154 * @param {string} domain The domain of the current tab.
155 * @constructor
156 * @struct
158 var TabInfo = function(tabId, domain) {
159 /** @type {number} */
160 this.tabId = tabId;
162 /** @type {string} */
163 this.domain = domain;
166 return {
167 CastModeType: CastModeType,
168 SinkStatus: SinkStatus,
169 CastMode: CastMode,
170 Issue: Issue,
171 Route: Route,
172 Sink: Sink,
173 TabInfo: TabInfo,