OLD | NEW |
1 // Copyright 2015 The Chromium Authors. All rights reserved. | 1 // Copyright 2015 The Chromium Authors. All rights reserved. |
2 // Use of this source code is governed by a BSD-style license that can be | 2 // Use of this source code is governed by a BSD-style license that can be |
3 // found in the LICENSE file. | 3 // found in the LICENSE file. |
4 | 4 |
5 var mediaRouter; | 5 var mediaRouter; |
6 | 6 |
7 define('media_router_bindings', [ | 7 define('media_router_bindings', [ |
8 'chrome/common/media_router/mojo/media_controller.mojom', | 8 'chrome/common/media_router/mojo/media_controller.mojom', |
9 'chrome/common/media_router/mojo/media_router.mojom', | 9 'chrome/common/media_router/mojo/media_router.mojom', |
10 'chrome/common/media_router/mojo/media_status.mojom', | 10 'chrome/common/media_router/mojo/media_status.mojom', |
(...skipping 67 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
78 return new mediaRouterMojom.MediaRoute({ | 78 return new mediaRouterMojom.MediaRoute({ |
79 'media_route_id': route.id, | 79 'media_route_id': route.id, |
80 'media_source': route.mediaSource, | 80 'media_source': route.mediaSource, |
81 'media_sink_id': route.sinkId, | 81 'media_sink_id': route.sinkId, |
82 'description': route.description, | 82 'description': route.description, |
83 'icon_url': route.iconUrl, | 83 'icon_url': route.iconUrl, |
84 'is_local': route.isLocal, | 84 'is_local': route.isLocal, |
85 'custom_controller_path': route.customControllerPath, | 85 'custom_controller_path': route.customControllerPath, |
86 // Begin newly added properties, followed by the milestone they were | 86 // Begin newly added properties, followed by the milestone they were |
87 // added. The guard should be safe to remove N+2 milestones later. | 87 // added. The guard should be safe to remove N+2 milestones later. |
88 'for_display': route.forDisplay, // M47 | 88 'for_display': route.forDisplay, // M47 |
89 'is_incognito': !!route.offTheRecord, // M50 | 89 'is_incognito': !!route.offTheRecord, // M50 |
90 'is_offscreen_presentation': !!route.isOffscreenPresentation // M56 | 90 'is_offscreen_presentation': !!route.isOffscreenPresentation, // M56 |
| 91 'supports_media_route_controller': |
| 92 !!route.supportsMediaRouteController // M61 |
91 }); | 93 }); |
92 } | 94 } |
93 | 95 |
94 /** | 96 /** |
95 * Converts a route message to a RouteMessage Mojo object. | 97 * Converts a route message to a RouteMessage Mojo object. |
96 * @param {!RouteMessage} message | 98 * @param {!RouteMessage} message |
97 * @return {!mediaRouterMojom.RouteMessage} A Mojo RouteMessage object. | 99 * @return {!mediaRouterMojom.RouteMessage} A Mojo RouteMessage object. |
98 */ | 100 */ |
99 function messageToMojo_(message) { | 101 function messageToMojo_(message) { |
100 if ("string" == typeof message.message) { | 102 if ("string" == typeof message.message) { |
(...skipping 823 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
924 return this.handlers_ | 926 return this.handlers_ |
925 .createMediaRouteController(routeId, controllerRequest, observer) | 927 .createMediaRouteController(routeId, controllerRequest, observer) |
926 .then(() => ({success: true}), e => ({success: false})); | 928 .then(() => ({success: true}), e => ({success: false})); |
927 }; | 929 }; |
928 | 930 |
929 mediaRouter = new MediaRouter(new mediaRouterMojom.MediaRouterPtr( | 931 mediaRouter = new MediaRouter(new mediaRouterMojom.MediaRouterPtr( |
930 frameInterfaces.getInterface(mediaRouterMojom.MediaRouter.name))); | 932 frameInterfaces.getInterface(mediaRouterMojom.MediaRouter.name))); |
931 | 933 |
932 return mediaRouter; | 934 return mediaRouter; |
933 }); | 935 }); |
OLD | NEW |