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

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

Issue 1587803002: [Media Router] Handle route swapping in the WebUI. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 4 years, 11 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
« no previous file with comments | « no previous file | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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 0db284868dbffae2fdf5c0443c083c0db03cf89d..e69ca14af9a63d3c4a8ef3ba796f91ba9915a65b 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
@@ -889,10 +889,18 @@ Polymer({
// switch back to the SINK_PICKER view if the user is currently in the
// ROUTE_DETAILS view.
if (!this.currentRoute_ || !this.routeMap_[this.currentRoute_.id]) {
- if (this.currentView_ == media_router.MediaRouterView.ROUTE_DETAILS)
- this.showSinkList_();
- else
+ if (this.currentView_ == media_router.MediaRouterView.ROUTE_DETAILS) {
+ // We may have an updated route to show for a device.
+ // We swap out |currentRoute_| (and consequently the route-details
+ // controls) to handle this.
+ this.currentRoute_ =
+ tempSinkToRouteMap[this.currentRoute_.sinkId] || null;
+
+ if (!this.currentRoute_)
+ this.showSinkList_();
+ } else {
this.currentRoute_ = null;
+ }
}
this.sinkToRouteMap_ = tempSinkToRouteMap;
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698