Chromium Code Reviews| Index: chrome/browser/resources/media_router/elements/media_router_container/media_router_container.js |
| diff --git a/chrome/browser/resources/media_router/elements/media_router_container/media_router_container.js b/chrome/browser/resources/media_router/elements/media_router_container/media_router_container.js |
| index d58a5ac8286a0b1555746cb36be4af4afd094faa..7309fd874dc634947c872e15696e0ef991c1d6f8 100644 |
| --- a/chrome/browser/resources/media_router/elements/media_router_container/media_router_container.js |
| +++ b/chrome/browser/resources/media_router/elements/media_router_container/media_router_container.js |
| @@ -707,6 +707,18 @@ Polymer({ |
| }, |
| /** |
| + * @param {?Element} element Element to compute padding for. |
| + * @return {number} Computes the amount of vertical padding (top + bottom) on |
| + * |element|. |
| + * @private |
| + */ |
| + computeElementVerticalPadding_: function(element) { |
| + var paddingBottom, paddingTop; |
| + [paddingBottom, paddingTop] = this.getElementVerticalPadding_(element); |
| + return paddingBottom + paddingTop; |
| + }, |
| + |
| + /** |
| * @param {?media_router.MediaRouterView} view The current view. |
| * @param {?media_router.Issue} issue The current issue. |
| * @return {boolean} Whether or not to hide the header. |
| @@ -809,6 +821,38 @@ Polymer({ |
| }, |
| /** |
| + * @param {?media_router.Route|undefined} currentRoute The current route for |
| + * the route details view. |
| + * @param {string} currentLaunchingSinkId ID of the currently launching sink |
| + * or the empty string if no sink is launching. |
| + * @param {number} shownCastModeValue Currently selected cast mode value or |
| + * AUTO if no value has been explicitly selected. |
| + * @return {boolean} Whether the replace route function should be available |
| + * when displaying |currentRoute| in the route details view. Replace route |
| + * should not be available when the source that would be cast from when |
| + * creating a new route would be the same as the route's current source. |
| + * @private |
| + */ |
| + computeReplaceRouteAvailable_: function( |
|
apacible
2016/06/06 20:17:10
Can we move this to <route-details>? The functiona
btolsch
2016/06/06 23:46:52
Done.
|
| + currentRoute, currentLaunchingSinkId, shownCastModeValue) { |
| + if (currentLaunchingSinkId || !currentRoute) { |
| + return false; |
| + } |
| + if (!currentRoute.currentCastMode) { |
| + return true; |
| + } |
| + var selectedCastMode = shownCastModeValue; |
| + if (selectedCastMode == media_router.CastModeType.AUTO) { |
| + var sink = this.sinkMap_[currentRoute.sinkId]; |
| + if (!sink) { |
| + return false; |
| + } |
| + selectedCastMode = sink.castModes & -sink.castModes; |
| + } |
| + return selectedCastMode != currentRoute.currentCastMode; |
| + }, |
| + |
| + /** |
| * @param {?media_router.MediaRouterView} view The current view. |
| * @param {?media_router.Issue} issue The current issue. |
| * @return {boolean} Whether or not to hide the route details. |
| @@ -820,18 +864,6 @@ Polymer({ |
| }, |
| /** |
| - * @param {?Element} element Element to compute padding for. |
| - * @return {number} Computes the amount of vertical padding (top + bottom) on |
| - * |element|. |
| - * @private |
| - */ |
| - computeElementVerticalPadding_: function(element) { |
| - var paddingBottom, paddingTop; |
| - [paddingBottom, paddingTop] = this.getElementVerticalPadding_(element); |
| - return paddingBottom + paddingTop; |
| - }, |
| - |
| - /** |
| * Computes an array of substring indices that mark where substrings of |
| * |searchString| occur in |sinkName|. |
| * |