Chromium Code Reviews| Index: chrome/browser/resources/media_router/elements/route_details/route_details.js |
| diff --git a/chrome/browser/resources/media_router/elements/route_details/route_details.js b/chrome/browser/resources/media_router/elements/route_details/route_details.js |
| index eeaf2a5de7702fdc2b997e2c7c3670c04b3e2c20..bf4e6aec1d6126d3ac6eedb72c1bd71dabfdd237 100644 |
| --- a/chrome/browser/resources/media_router/elements/route_details/route_details.js |
| +++ b/chrome/browser/resources/media_router/elements/route_details/route_details.js |
| @@ -33,8 +33,7 @@ Polymer({ |
| */ |
| controllerType_: { |
| type: Number, |
| - computed: 'computeControllerType_(useWebUiRouteControls,' + |
| - 'isExtensionViewReady)', |
| + computed: 'computeControllerType_(route, isExtensionViewReady)', |
| }, |
| /** |
| @@ -95,16 +94,6 @@ Polymer({ |
| type: Object, |
| value: null, |
| }, |
| - |
| - /** |
| - * Whether we should use the WebUI route controls. This value is used for |
| - * updating |controllerType_|, |
| - * @type {boolean} |
| - */ |
| - useWebUiRouteControls: { |
| - type: Boolean, |
| - value: false, |
| - }, |
| }, |
| behaviors: [ |
| @@ -161,14 +150,13 @@ Polymer({ |
| }, |
| /** |
| - * @param {boolean} useWebUiRouteControls |
| + * @param {?media_router.Route} route |
| * @param {boolean} isExtensionViewReady |
| * @return {number} An enum value to represent the controller to show. |
| * @private |
| */ |
| - computeControllerType_: function( |
| - useWebUiRouteControls, isExtensionViewReady) { |
| - if (useWebUiRouteControls) { |
| + computeControllerType_: function(route, isExtensionViewReady) { |
| + if (route && route.supportsWebUiController) { |
| return media_router.ControllerType.WEBUI; |
| } |
| if (isExtensionViewReady) { |
| @@ -251,6 +239,15 @@ Polymer({ |
| } |
| }, |
| + /** |
| + * @param {?media_router.Route} route |
| + * @return {boolean} |
| + * @private |
| + */ |
| + shouldAttemptLoadingExtensionView_: function(route) { |
| + return !!route && !route.supportsWebUiController; |
|
takumif
2017/06/19 18:10:28
The Closure compiler complains that the return typ
imcheng
2017/06/19 19:56:13
Acknowledged.
|
| + }, |
| + |
| /** |
| * @param {number} controllerType |
| * @return {boolean} Whether the extensionview should be shown instead of the |