Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(5446)

Unified Diff: chrome/browser/resources/media_router/elements/media_router_container/media_router_container.js

Issue 2938173004: [Media Router] Add a supports_web_ui_controller attribute to MediaRoute (Closed)
Patch Set: . Created 3 years, 6 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
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 155bc82031fd8bf9f4699defaae97426f2c577b6..ca53dd5c06ce7d04acf7214f816fecdc83a03406 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
@@ -392,9 +392,9 @@ Polymer({
/**
* Whether the WebUI route controls should be shown instead of the
* extensionview in the route details view.
- * @type {boolean}
+ * @private {boolean}
*/
- useWebUiRouteControls: {
+ useWebUiRouteControls_: {
type: Boolean,
value: false,
},
@@ -416,6 +416,16 @@ Polymer({
type: Boolean,
value: false,
},
+
+ /**
+ * Whether the WebUI route controls are available for use. Used for updating
+ * the value of |useWebUiRouteControls_|.
+ * @type {boolean}
+ */
+ webUiRouteControlsAvailable: {
+ type: Boolean,
+ value: false,
+ }
},
behaviors: [
@@ -1825,7 +1835,7 @@ Polymer({
* from route details view to the sink list view.
*/
onRouteControllerInvalidated: function() {
- if (this.useWebUiRouteControls &&
+ if (this.useWebUiRouteControls_ &&
this.currentView_ == media_router.MediaRouterView.ROUTE_DETAILS) {
this.currentRoute_ = null;
this.showSinkList_();
@@ -2386,7 +2396,9 @@ Polymer({
showRouteDetails_: function(route) {
this.currentRoute_ = route;
this.currentView_ = media_router.MediaRouterView.ROUTE_DETAILS;
- if (this.useWebUiRouteControls) {
+ this.useWebUiRouteControls_ =
+ this.webUiRouteControlsAvailable && route.supportsWebUiController;
+ if (this.useWebUiRouteControls_) {
media_router.browserApi.onMediaControllerAvailable(route.id);
}
if (this.$$('route-details')) {

Powered by Google App Engine
This is Rietveld 408576698