summaryrefslogtreecommitdiffstats
path: root/extensions/renderer
diff options
context:
space:
mode:
authormfoltz <mfoltz@chromium.org>2016-02-25 15:44:55 -0800
committerCommit bot <commit-bot@chromium.org>2016-02-25 23:45:49 +0000
commit77f4655df0ec6a9c40732f25d18968465df011d4 (patch)
tree601c1ee4472398e53f78cbfdc761329a063011cd /extensions/renderer
parentc916fccc772dce7924d8cf1266ba4e71344c37c3 (diff)
downloadchromium_src-77f4655df0ec6a9c40732f25d18968465df011d4.zip
chromium_src-77f4655df0ec6a9c40732f25d18968465df011d4.tar.gz
chromium_src-77f4655df0ec6a9c40732f25d18968465df011d4.tar.bz2
First patch to implement support for MR for off the record media routes (created by incognito profiles).
This adds a flag to the CreateRoute and JoinRoute APIs that is set to true when the route request originates from an incognito profile. Also, an off_the_record flag is added to MediaRoute. Patch 1/3 of support for incognito: This patch: Adds support for off the record media routes. TBD: Enables UI for incognito profiles. TBD: Clean up routes when incognito profile destroyed. BUG=524795 Review URL: https://codereview.chromium.org/1682853007 Cr-Commit-Position: refs/heads/master@{#377711}
Diffstat (limited to 'extensions/renderer')
-rw-r--r--extensions/renderer/resources/media_router_bindings.js20
1 files changed, 14 insertions, 6 deletions
diff --git a/extensions/renderer/resources/media_router_bindings.js b/extensions/renderer/resources/media_router_bindings.js
index ebb668c..b6252c5 100644
--- a/extensions/renderer/resources/media_router_bindings.js
+++ b/extensions/renderer/resources/media_router_bindings.js
@@ -75,8 +75,10 @@ define('media_router_bindings', [
'icon_url': route.iconUrl,
'is_local': route.isLocal,
'custom_controller_path': route.customControllerPath,
- // TODO(imcheng): Remove logic when extension always sets the field.
- 'for_display': route.forDisplay == undefined ? true : route.forDisplay
+ // Begin newly added properties, followed by the milestone they were
+ // added. The guard should be safe to remove N+2 milestones later.
+ 'for_display': route.forDisplay, // M47
+ 'off_the_record': !!route.offTheRecord // M50
});
}
@@ -556,15 +558,18 @@ define('media_router_bindings', [
* @param {!number} timeoutMillis If positive, the timeout duration for the
* request, measured in seconds. Otherwise, the default duration will be
* used.
+ * @param {!boolean} offTheRecord If true, the route is being requested by
+ * an off the record (incognito) profile.
* @return {!Promise.<!Object>} A Promise resolving to an object describing
* the newly created media route, or rejecting with an error message on
* failure.
*/
MediaRouteProvider.prototype.createRoute =
function(sourceUrn, sinkId, presentationId, origin, tabId,
- timeoutMillis) {
+ timeoutMillis, offTheRecord) {
return this.handlers_.createRoute(
- sourceUrn, sinkId, presentationId, origin, tabId, timeoutMillis)
+ sourceUrn, sinkId, presentationId, origin, tabId, timeoutMillis,
+ offTheRecord)
.then(function(route) {
return toSuccessRouteResponse_(route);
},
@@ -584,14 +589,17 @@ define('media_router_bindings', [
* @param {!number} timeoutMillis If positive, the timeout duration for the
* request, measured in seconds. Otherwise, the default duration will be
* used.
+ * @param {!boolean} offTheRecord If true, the route is being requested by
+ * an off the record (incognito) profile.
* @return {!Promise.<!Object>} A Promise resolving to an object describing
* the newly created media route, or rejecting with an error message on
* failure.
*/
MediaRouteProvider.prototype.joinRoute =
- function(sourceUrn, presentationId, origin, tabId, timeoutMillis) {
+ function(sourceUrn, presentationId, origin, tabId, timeoutMillis,
+ offTheRecord) {
return this.handlers_.joinRoute(
- sourceUrn, presentationId, origin, tabId, timeoutMillis)
+ sourceUrn, presentationId, origin, tabId, timeoutMillis, offTheRecord)
.then(function(route) {
return toSuccessRouteResponse_(route);
},