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

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

Issue 2002293003: [Media Router] Allow casting new media to sink with existing route. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 4 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/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 d3db440a8042f08e4e0e3d4d2d61e075ae257cf2..261f1b121d7768d802904e8d47c96e7406723605 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
@@ -60,13 +60,18 @@ Polymer({
},
/**
- * Fires a start-casting-to-route-click event. This is called when the button
- * to start casting to the current route is clicked.
+ * Fires a start-casting-to-route-click event if the current route is
+ * joinable, otherwise it fires a cast-new-media-click event. This is called
+ * when the button to start casting to the current route is clicked.
*
* @private
*/
startCastingToRoute_: function() {
- this.fire('start-casting-to-route-click', {route: this.route});
+ if (this.route.canJoin) {
+ this.fire('start-casting-to-route-click', {route: this.route});
+ } else {
+ this.fire('cast-new-media-click', {route: this.route});
+ }
},
/**

Powered by Google App Engine
This is Rietveld 408576698