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 (function() { | 5 (function() { |
6 /** | 6 /** |
7 * The possible states of media-router-container. Used to determine which | 7 * The possible states of media-router-container. Used to determine which |
8 * components of media-router-container to show. | 8 * components of media-router-container to show. |
9 * | 9 * |
10 * @enum {number} | 10 * @enum {number} |
(...skipping 169 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
180 * @return {boolean} Whether or not to hide the cast mode list. | 180 * @return {boolean} Whether or not to hide the cast mode list. |
181 * @private | 181 * @private |
182 */ | 182 */ |
183 computeCastModeHidden_: function(view) { | 183 computeCastModeHidden_: function(view) { |
184 return view != MediaRouterContainerView.CAST_MODE_LIST; | 184 return view != MediaRouterContainerView.CAST_MODE_LIST; |
185 }, | 185 }, |
186 | 186 |
187 /** | 187 /** |
188 * @param {!MediaRouterContainerView} view The current view. | 188 * @param {!MediaRouterContainerView} view The current view. |
189 * @param {?media_router.Issue} issue The current issue. | 189 * @param {?media_router.Issue} issue The current issue. |
190 * return {boolean} Whether or not to hide the header. | 190 * @return {boolean} Whether or not to hide the header. |
191 * @private | 191 * @private |
192 */ | 192 */ |
193 computeHeaderHidden_: function(view, issue) { | 193 computeHeaderHidden_: function(view, issue) { |
194 return view == MediaRouterContainerView.ROUTE_DETAILS || | 194 return view == MediaRouterContainerView.ROUTE_DETAILS || |
195 (view == MediaRouterContainerView.SINK_LIST && | 195 (view == MediaRouterContainerView.SINK_LIST && |
196 issue && issue.isBlocking); | 196 issue && issue.isBlocking); |
197 }, | 197 }, |
198 | 198 |
199 /** | 199 /** |
200 * @param {!MediaRouterContainerView} view The current view. | 200 * @param {!MediaRouterContainerView} view The current view. |
201 * @param {?media_router.Issue} issue The current issue. | 201 * @param {?media_router.Issue} issue The current issue. |
202 * return {boolean} Whether or not to hide the issue banner. | 202 * @return {boolean} Whether or not to hide the issue banner. |
203 * @private | 203 * @private |
204 */ | 204 */ |
205 computeIssueBannerHidden_: function(view, issue) { | 205 computeIssueBannerHidden_: function(view, issue) { |
206 return !issue || view == MediaRouterContainerView.CAST_MODE_LIST; | 206 return !issue || view == MediaRouterContainerView.CAST_MODE_LIST; |
207 }, | 207 }, |
208 | 208 |
209 /** | 209 /** |
210 * @param {!MediaRouterContainerView} view The current view. | 210 * @param {!MediaRouterContainerView} view The current view. |
211 * @param {?media_router.Issue} issue The current issue. | 211 * @param {?media_router.Issue} issue The current issue. |
212 * return {boolean} Whether or not to hide the route details. | 212 * @return {boolean} Whether or not to hide the route details. |
213 * @private | 213 * @private |
214 */ | 214 */ |
215 computerRouteDetailsHidden_: function(view, issue) { | 215 computerRouteDetailsHidden_: function(view, issue) { |
216 return view != MediaRouterContainerView.ROUTE_DETAILS || | 216 return view != MediaRouterContainerView.ROUTE_DETAILS || |
217 (issue && issue.isBlocking); | 217 (issue && issue.isBlocking); |
218 }, | 218 }, |
219 | 219 |
220 /** | 220 /** |
221 * @param {!string} sinkId A sink ID. | 221 * @param {!string} sinkId A sink ID. |
222 * return {boolean} Whether or not to hide the route info in the sink list | 222 * @return {boolean} Whether or not to hide the route info in the sink list |
223 * that is associated with |sinkId|. | 223 * that is associated with |sinkId|. |
224 * @private | 224 * @private |
225 */ | 225 */ |
226 computeRouteInSinkListHidden_: function(sinkId) { | 226 computeRouteInSinkListHidden_: function(sinkId) { |
227 return !this.sinkToRouteMap_[sinkId]; | 227 return !this.sinkToRouteMap_[sinkId]; |
228 }, | 228 }, |
229 | 229 |
230 /** | 230 /** |
231 * @param {!string} sinkId A sink ID. | 231 * @param {!string} sinkId A sink ID. |
232 * return {string} The title value of the route associated with |sinkId|. | 232 * @return {string} The title value of the route associated with |sinkId|. |
233 * @private | 233 * @private |
234 */ | 234 */ |
235 computeRouteInSinkListValue_: function(sinkId) { | 235 computeRouteInSinkListValue_: function(sinkId) { |
236 var route = this.sinkToRouteMap_[sinkId]; | 236 var route = this.sinkToRouteMap_[sinkId]; |
237 return route ? this.sinkToRouteMap_[sinkId].title : ''; | 237 return route ? this.sinkToRouteMap_[sinkId].title : ''; |
238 }, | 238 }, |
239 | 239 |
240 /** | 240 /** |
241 * @param {?media_router.Route} route The current route. | 241 * @param {?media_router.Route} route The current route. |
242 * return {?media_router.Sink} The sink associated with |route|. | 242 * return {?media_router.Sink} The sink associated with |route|. |
243 * @private | 243 * @private |
244 */ | 244 */ |
245 computeSinkForCurrentRoute_: function(route) { | 245 computeSinkForCurrentRoute_: function(route) { |
246 return route ? this.sinkMap_[route.sinkId] : null; | 246 return route ? this.sinkMap_[route.sinkId] : null; |
247 }, | 247 }, |
248 | 248 |
249 /** | 249 /** |
250 * @param {!MediaRouterContainerView} view The current view. | 250 * @param {!MediaRouterContainerView} view The current view. |
251 * @param {?media_router.Issue} issue The current issue. | 251 * @param {?media_router.Issue} issue The current issue. |
252 * return {boolean} Whether or not to hide the sink list. | 252 * @return {boolean} Whether or not to hide the sink list. |
253 * @private | 253 * @private |
254 */ | 254 */ |
255 computeSinkListHidden_: function(view, issue) { | 255 computeSinkListHidden_: function(view, issue) { |
256 return view != MediaRouterContainerView.SINK_LIST || | 256 return view != MediaRouterContainerView.SINK_LIST || |
257 (issue && issue.isBlocking); | 257 (issue && issue.isBlocking); |
258 }, | 258 }, |
259 | 259 |
260 /** | 260 /** |
261 * Creates a new route if |route| is null. Otherwise, shows the route | 261 * Creates a new route if |route| is null. Otherwise, shows the route |
262 * details. | 262 * details. |
(...skipping 110 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
373 */ | 373 */ |
374 toggleCastModeHidden_: function() { | 374 toggleCastModeHidden_: function() { |
375 if (this.currentView_ == MediaRouterContainerView.CAST_MODE_LIST) { | 375 if (this.currentView_ == MediaRouterContainerView.CAST_MODE_LIST) { |
376 this.showSinkList_(); | 376 this.showSinkList_(); |
377 } else { | 377 } else { |
378 this.showCastModeList_(); | 378 this.showCastModeList_(); |
379 } | 379 } |
380 }, | 380 }, |
381 }); | 381 }); |
382 })(); | 382 })(); |
OLD | NEW |