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

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

Issue 2725503002: [Media Router] Custom Controls 4 - Implement details view WebUI (Closed)
Patch Set: . Created 3 years, 10 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_ui_interface.js
diff --git a/chrome/browser/resources/media_router/media_router_ui_interface.js b/chrome/browser/resources/media_router/media_router_ui_interface.js
index a8ec54461a248a242f5475c160923d50dc85ccfd..9b152eaaff66fe09db1b44fd508d6d201898f220 100644
--- a/chrome/browser/resources/media_router/media_router_ui_interface.js
+++ b/chrome/browser/resources/media_router/media_router_ui_interface.js
@@ -166,6 +166,15 @@ cr.define('media_router.ui', function() {
container.updateMaxDialogHeight(height);
}
+ /**
+ * Updates the route status shown in the details view.
+ *
+ * @param {!media_router.RouteStatus} status
+ */
+ function updateRouteStatus(status) {
+ container.updateRouteStatus(status);
+ }
+
return {
onCreateRouteResponseReceived: onCreateRouteResponseReceived,
receiveSearchResult: receiveSearchResult,
@@ -177,6 +186,7 @@ cr.define('media_router.ui', function() {
setRouteList: setRouteList,
setSinkListAndIdentity: setSinkListAndIdentity,
updateMaxHeight: updateMaxHeight,
+ updateRouteStatus: updateRouteStatus,
};
});
@@ -255,6 +265,36 @@ cr.define('media_router.browserApi', function() {
}
/**
+ * Reports that the route details view was closed.
+ */
+ function onRouteDetailsClosed() {
+ chrome.send('onRouteDetailsClosed');
+ }
+
+ /**
+ * Reports that the route details view was opened for |routeId|.
+ *
+ * @param {string} routeId
+ */
+ function onRouteDetailsOpened(routeId) {
+ chrome.send('onRouteDetailsOpened', [{routeId: routeId}]);
+ }
+
+ /**
+ * Sends a command to pause the route shown in the route details view.
+ */
+ function pauseRoute() {
+ chrome.send('pauseRoute');
+ }
+
+ /**
+ * Sends a command to play the route shown in the route details view.
+ */
+ function playRoute() {
+ chrome.send('playRoute');
+ }
+
+ /**
* Reports when the user clicks outside the dialog.
*/
function reportBlur() {
@@ -401,6 +441,35 @@ cr.define('media_router.browserApi', function() {
selectedCastMode: selectedCastMode}]);
}
+ /**
+ * Sends a command to seek the route shown in the route details view.
+ *
+ * @param {number} time The new current time in milliseconds.
+ */
+ function seekRoute(time) {
+ chrome.send('seekRoute', [{time: time}]);
+ }
+
+ /**
+ * Sends a command to mute or unmute the route shown in the route details
+ * view.
+ *
+ * @param {boolean} mute Mute the route if true, unmute it if false.
+ */
+ function setRouteMute(mute) {
+ chrome.send('setRouteMute', [{mute: mute}]);
+ }
+
+ /**
+ * Sends a command to change the volume of the route shown in the route
+ * details view.
+ *
+ * @param {number} volume The volume between 0 and 1.
+ */
+ function setRouteVolume(volume) {
+ chrome.send('setRouteVolume', [{volume: volume}]);
+ }
+
return {
acknowledgeFirstRunFlow: acknowledgeFirstRunFlow,
actOnIssue: actOnIssue,
@@ -409,6 +478,10 @@ cr.define('media_router.browserApi', function() {
closeRoute: closeRoute,
joinRoute: joinRoute,
onInitialDataReceived: onInitialDataReceived,
+ onRouteDetailsClosed: onRouteDetailsClosed,
+ onRouteDetailsOpened: onRouteDetailsOpened,
+ pauseRoute: pauseRoute,
+ playRoute: playRoute,
reportBlur: reportBlur,
reportClickedSinkIndex: reportClickedSinkIndex,
reportFilter: reportFilter,
@@ -424,5 +497,8 @@ cr.define('media_router.browserApi', function() {
requestInitialData: requestInitialData,
requestRoute: requestRoute,
searchSinksAndCreateRoute: searchSinksAndCreateRoute,
+ seekRoute: seekRoute,
+ setRouteMute: setRouteMute,
+ setRouteVolume: setRouteVolume,
};
});

Powered by Google App Engine
This is Rietveld 408576698