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

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

Issue 1133853003: Media Router: Replace sink custom elements with core/paper elements. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 5 years, 7 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 7d1ec51be0fa81bf963e890649adae7d82f2231a..9f711d093fdc1be6ef3fa4348b6811e8e56c32a9 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
@@ -131,8 +131,8 @@ Polymer('media-router-container', {
sinkMap_: null,
/**
- * Maps media_router.Sink.id to corresponding media_router.Route.id.
- * @private {?Object<!string, ?string>}
+ * Maps media_router.Sink.id to corresponding media_router.Route.
+ * @private {?Object<!string, ?media_router.Route>}
* @default null
*/
sinkToRouteMap_: null,
@@ -261,17 +261,16 @@ Polymer('media-router-container', {
},
/**
- * Called when an on-sink-click event bubbles up. Updates |currentRoute_|.
+ * Called when a sink is clicked. Updates |currentRoute_|.
*
- * @param {{detail: {route: ?media_router.Route, sink: !media_router.Sink}}}
- * data The information passed up with the event.
- * Parameters in |data|.detail:
- * route - The existing route associated with |sink|.
- * sink - The sink that was clicked.
+ * @param {!Event} event The event object.
+ * @param {Object} detail The details of the event.
+ * @param {!Element} sender Reference to clicked node.
*/
- onSinkClick: function(data) {
- this.currentRoute_ = data.detail.route;
- this.maybeCreateRoute(data.detail.sink, this.currentRoute_);
+ onSinkClick: function(event, detail, sender) {
+ var clickedSink = event.target.templateInstance.model.sink;
+ this.currentRoute_ = this.sinkToRouteMap_[clickedSink.id];
+ this.maybeCreateRoute(clickedSink, this.currentRoute_);
},
/**
@@ -286,7 +285,7 @@ Polymer('media-router-container', {
// Rebuild |routeMap_| and |sinkToRouteMap_|.
this.routeList.forEach(function(route) {
this.routeMap_[route.id] = route;
- this.sinkToRouteMap_[route.sinkId] = route.id;
+ this.sinkToRouteMap_[route.sinkId] = route;
}, this);
},

Powered by Google App Engine
This is Rietveld 408576698