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

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: Removing Logging Statements Created 5 years, 1 month 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 0c55b88d95a858285a38a663d047ee9dc9df8218..2fd75a96d6863cea87a9f3d6d40a5c88cbe386f8 100644
--- a/chrome/browser/resources/media_router/media_router.js
+++ b/chrome/browser/resources/media_router/media_router.js
@@ -25,6 +25,7 @@ cr.define('media_router', function() {
container.addEventListener('close-button-click', onCloseDialogEvent);
container.addEventListener('close-dialog', onCloseDialogEvent);
container.addEventListener('close-route-click', onCloseRouteClick);
+ container.addEventListener('join-route-click', onJoinRouteClick);
container.addEventListener('create-route', onCreateRoute);
container.addEventListener('issue-action-click', onIssueActionClick);
container.addEventListener('report-sink-count', onSinkCountReported);
@@ -34,9 +35,7 @@ cr.define('media_router', function() {
* Closes the dialog.
* Called when the user clicks the close button on the dialog.
*/
- function onCloseDialogEvent() {
- media_router.browserApi.closeDialog();
- }
+ function onCloseDialogEvent() { media_router.browserApi.closeDialog(); }
/**
* Acts on an issue and dismisses it from the UI.
@@ -50,9 +49,8 @@ cr.define('media_router', function() {
* helpPageId - the numeric help center ID.
*/
function onIssueActionClick(data) {
- media_router.browserApi.actOnIssue(data.detail.id,
- data.detail.actionType,
- data.detail.helpPageId);
+ media_router.browserApi.actOnIssue(
+ data.detail.id, data.detail.actionType, data.detail.helpPageId);
container.issue = null;
}
@@ -66,8 +64,8 @@ cr.define('media_router', function() {
* selectedCastModeValue - cast mode selected by the user.
*/
function onCreateRoute(data) {
- media_router.browserApi.requestRoute(data.detail.sinkId,
- data.detail.selectedCastModeValue);
+ media_router.browserApi.requestRoute(
+ data.detail.sinkId, data.detail.selectedCastModeValue);
}
/**
@@ -83,6 +81,19 @@ cr.define('media_router', function() {
}
/**
+ * Joins a route.
+ * Called when the user requests to join a media route.
+ *
+ * @param {{detail: {route: string}}} data
+ * Parameters in |data|.detail:
+ * route - route ID.
+ */
+ function onJoinRouteClick(data) {
+ console.log('media router ui join clicked: ' + JSON.stringify(data.detail));
+ media_router.browserApi.joinRoute(data.detail.route);
+ }
+
+ /**
* Reports the current sink count.
* Called 3 seconds after the dialog is initially opened.
*

Powered by Google App Engine
This is Rietveld 408576698