| 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 'mojo/public/js/bindings', | 8 'mojo/public/js/bindings', |
| 9 'mojo/public/js/core', | 9 'mojo/public/js/core', |
| 10 'content/public/renderer/service_provider', | 10 'content/public/renderer/service_provider', |
| (...skipping 89 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 100 | 100 |
| 101 /** | 101 /** |
| 102 * Converts presentation connection state to Mojo enum value. | 102 * Converts presentation connection state to Mojo enum value. |
| 103 * @param {!string} state | 103 * @param {!string} state |
| 104 * @return {!mediaRouterMojom.MediaRouter.PresentationConnectionState} | 104 * @return {!mediaRouterMojom.MediaRouter.PresentationConnectionState} |
| 105 */ | 105 */ |
| 106 function presentationConnectionStateToMojo_(state) { | 106 function presentationConnectionStateToMojo_(state) { |
| 107 var PresentationConnectionState = | 107 var PresentationConnectionState = |
| 108 mediaRouterMojom.MediaRouter.PresentationConnectionState; | 108 mediaRouterMojom.MediaRouter.PresentationConnectionState; |
| 109 switch (state) { | 109 switch (state) { |
| 110 case 'connecting': |
| 111 return PresentationConnectionState.CONNECTING; |
| 110 case 'connected': | 112 case 'connected': |
| 111 return PresentationConnectionState.CONNECTED; | 113 return PresentationConnectionState.CONNECTED; |
| 112 case 'closed': | 114 case 'closed': |
| 113 return PresentationConnectionState.CLOSED; | 115 return PresentationConnectionState.CLOSED; |
| 114 case 'terminated': | 116 case 'terminated': |
| 115 return PresentationConnectionState.TERMINATED; | 117 return PresentationConnectionState.TERMINATED; |
| 116 default: | 118 default: |
| 117 console.error('Unknown presentation connection state: ' + state); | 119 console.error('Unknown presentation connection state: ' + state); |
| 118 return PresentationConnectionState.TERMINATED; | 120 return PresentationConnectionState.TERMINATED; |
| 119 } | 121 } |
| (...skipping 472 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 592 }; | 594 }; |
| 593 | 595 |
| 594 mediaRouter = new MediaRouter(connector.bindHandleToProxy( | 596 mediaRouter = new MediaRouter(connector.bindHandleToProxy( |
| 595 serviceProvider.connectToService( | 597 serviceProvider.connectToService( |
| 596 mediaRouterMojom.MediaRouter.name), | 598 mediaRouterMojom.MediaRouter.name), |
| 597 mediaRouterMojom.MediaRouter)); | 599 mediaRouterMojom.MediaRouter)); |
| 598 | 600 |
| 599 return mediaRouter; | 601 return mediaRouter; |
| 600 }); | 602 }); |
| 601 | 603 |
| OLD | NEW |