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

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

Issue 1805813002: [Media Router] Wiring for searching route providers for new sinks. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Clarifying pseudo sink comments Created 4 years, 8 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 6b23d2b34cd5dc9ab9cacd34328f761330562278..05383265bed25fe76efc2de593fc36d12b5a0459 100644
--- a/chrome/browser/resources/media_router/media_router_ui_interface.js
+++ b/chrome/browser/resources/media_router/media_router_ui_interface.js
@@ -27,6 +27,15 @@ cr.define('media_router.ui', function() {
}
/**
+ * Handles the search response by forwarding |sinkId| to the container.
+ *
+ * @param {string} sinkId The ID of the sink found by search.
+ */
+ function receiveSearchResult(sinkId) {
+ container.onReceiveSearchResult(sinkId);
+ }
+
+ /**
* Sets the cast mode list.
*
* @param {!Array<!media_router.CastMode>} castModeList
@@ -155,6 +164,7 @@ cr.define('media_router.ui', function() {
return {
onCreateRouteResponseReceived: onCreateRouteResponseReceived,
+ receiveSearchResult: receiveSearchResult,
setCastModeList: setCastModeList,
setElements: setElements,
setFirstRunFlowData: setFirstRunFlowData,
@@ -353,6 +363,27 @@ cr.define('media_router.browserApi', function() {
[{sinkId: sinkId, selectedCastMode: selectedCastMode}]);
}
+ /**
+ * Requests that the media router search all providers for a sink matching
+ * |searchCriteria| that can be used with the media source associated with the
+ * cast mode |selectedCastMode|. If such a sink is found, a route is also
+ * created between the sink and the media source.
+ *
+ * @param {string} sinkId Sink ID of the pseudo sink generating the request.
+ * @param {string} searchCriteria Search criteria for the route providers.
+ * @param {string} domain User's current hosted domain.
+ * @param {number} selectedCastMode The value of the cast mode to be used with
+ * the sink.
+ */
+ function searchSinksAndCreateRoute(
+ sinkId, searchCriteria, domain, selectedCastMode) {
+ chrome.send('searchSinksAndCreateRoute',
+ [{sinkId: sinkId,
+ searchCriteria: searchCriteria,
+ domain: domain,
+ selectedCastMode: selectedCastMode}]);
+ }
+
return {
acknowledgeFirstRunFlow: acknowledgeFirstRunFlow,
actOnIssue: actOnIssue,
@@ -374,5 +405,6 @@ cr.define('media_router.browserApi', function() {
reportTimeToInitialActionClose: reportTimeToInitialActionClose,
requestInitialData: requestInitialData,
requestRoute: requestRoute,
+ searchSinksAndCreateRoute: searchSinksAndCreateRoute,
};
});

Powered by Google App Engine
This is Rietveld 408576698