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

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

Issue 1415103006: Non-Local Join for Media Router and Presentation API (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Fixing ChromeOS System Tray Test 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
Index: chrome/browser/resources/media_router/media_router.js
diff --git a/chrome/browser/resources/media_router/media_router.js b/chrome/browser/resources/media_router/media_router.js
index 5ee3b787d6943db3950ea5578c3b5c4e101e6380..59074570eb4637a5c1c94f36fdb024679b83f8c5 100644
--- a/chrome/browser/resources/media_router/media_router.js
+++ b/chrome/browser/resources/media_router/media_router.js
@@ -29,6 +29,7 @@ cr.define('media_router', function() {
container.addEventListener('close-route-click', onCloseRouteClick);
container.addEventListener('create-route', onCreateRoute);
container.addEventListener('issue-action-click', onIssueActionClick);
+ container.addEventListener('join-route-click', onJoinRouteClick);
container.addEventListener('navigate-sink-list-to-details',
onNavigateToDetails);
container.addEventListener('navigate-to-cast-mode-list',
@@ -93,15 +94,39 @@ cr.define('media_router', function() {
* Stops a route.
* Called when the user requests to stop a media route.
*
- * @param {{detail: {route: string}}} data
+ * @param {{detail: {route: media_router.Route}}} data
* Parameters in |data|.detail:
- * route - route ID.
+ * route - route to close.
*/
function onCloseRouteClick(data) {
media_router.browserApi.closeRoute(data.detail.route);
}
/**
+ * Joins a route.
+ * Called when the user requests to join a media route.
+ *
+ * @param {{detail: {route: media_router.Route}}} data
+ * Parameters in |data|.detail:
+ * route - route to join.
+ */
+ function onJoinRouteClick(data) {
+ media_router.browserApi.joinRoute(data.detail.route);
+ }
+
+ /**
+ * Reports the index of the sink that was clicked.
+ * Called when the user selects a sink on the sink list.
+ *
+ * @param {{detail: {index: number}}} data
+ * Paramters in |data|.detail:
+ * index - the index of the clicked sink.
+ */
+ function onSinkClick(data) {
+ media_router.browserApi.reportClickedSinkIndex(data.detail.index);
+ }
+
+ /**
* Reports the user navigation to the cast mode view.
* Called when the user clicks the drop arrow to navigate to the cast mode
* view on the dialog.

Powered by Google App Engine
This is Rietveld 408576698