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

Unified Diff: extensions/renderer/resources/media_router_bindings.js

Issue 1693963003: Pass origin to StartObservingMediaSinks. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Marks Review Fixes with URL changes Created 4 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
« no previous file with comments | « chrome/test/media_router/test_media_sinks_observer.cc ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: extensions/renderer/resources/media_router_bindings.js
diff --git a/extensions/renderer/resources/media_router_bindings.js b/extensions/renderer/resources/media_router_bindings.js
index b6252c50e999fe49cbc08973532b30b1db95939b..48b790fcd924ba64279ad46de37afce3a5828f18 100644
--- a/extensions/renderer/resources/media_router_bindings.js
+++ b/extensions/renderer/resources/media_router_bindings.js
@@ -264,10 +264,22 @@ define('media_router_bindings', [
* Called by the provider manager when a sink list for a given source is
* updated.
* @param {!string} sourceUrn
+ * @param {!string} origin
* @param {!Array<!MediaSink>} sinks
*/
- MediaRouter.prototype.onSinksReceived = function(sourceUrn, sinks) {
- this.service_.onSinksReceived(sourceUrn, sinks.map(sinkToMojo_));
+ MediaRouter.prototype.onSinksReceived = function(
+ sourceUrn, origin, sinks) {
+ if (origin typeof String) {
+ this.service_.onSinksReceived(sourceUrn, origin, sinks.map(sinkToMojo_));
+ } else {
+ /* Provided for backward compatibility if the component extension was
+ * before cl/114586744 when the parameter list only had two parameters:
+ *
+ * @param {!string} sourceUrn
+ * @param {!Array<!MediaSink>} sinks
+ */
+ this.service_.onSinksReceived(sourceUrn, "", origin);
+ }
};
/**
@@ -530,19 +542,21 @@ define('media_router_bindings', [
* designated by |sourceUrn|. Results are returned by calling
* OnSinksReceived.
* @param {!string} sourceUrn
+ * @param {!string} origin
*/
MediaRouteProvider.prototype.startObservingMediaSinks =
- function(sourceUrn) {
- this.handlers_.startObservingMediaSinks(sourceUrn);
+ function(sourceUrn, origin) {
+ this.handlers_.startObservingMediaSinks(sourceUrn, origin);
};
/**
* Stops querying for sinks capable of displaying |sourceUrn|.
* @param {!string} sourceUrn
+ * @param {!string} origin
*/
MediaRouteProvider.prototype.stopObservingMediaSinks =
- function(sourceUrn) {
- this.handlers_.stopObservingMediaSinks(sourceUrn);
+ function(sourceUrn, origin) {
+ this.handlers_.stopObservingMediaSinks(sourceUrn, origin);
};
/**
« no previous file with comments | « chrome/test/media_router/test_media_sinks_observer.cc ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698