| OLD | NEW |
| 1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2012 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 /** | 5 /** |
| 6 * @fileoverview | 6 * @fileoverview |
| 7 * Functions related to the 'host screen' for Chromoting. | 7 * Functions related to the 'host screen' for Chromoting. |
| 8 */ | 8 */ |
| 9 | 9 |
| 10 /** @suppress {duplicate} */ | 10 /** @suppress {duplicate} */ |
| (...skipping 56 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 67 }; | 67 }; |
| 68 | 68 |
| 69 tryInitializeFacade(); | 69 tryInitializeFacade(); |
| 70 }; | 70 }; |
| 71 | 71 |
| 72 /** | 72 /** |
| 73 * @param {remoting.It2MeHostFacade} hostFacade An initialized It2MeHostFacade. | 73 * @param {remoting.It2MeHostFacade} hostFacade An initialized It2MeHostFacade. |
| 74 */ | 74 */ |
| 75 remoting.startHostUsingFacade_ = function(hostFacade) { | 75 remoting.startHostUsingFacade_ = function(hostFacade) { |
| 76 console.log('Attempting to share...'); | 76 console.log('Attempting to share...'); |
| 77 remoting.identity.callWithToken( | 77 remoting.identity.getToken().then( |
| 78 remoting.tryShareWithToken_.bind(null, hostFacade), | 78 remoting.tryShareWithToken_.bind(null, hostFacade), |
| 79 remoting.showErrorMessage); | 79 remoting.Error.handler(remoting.showErrorMessage)); |
| 80 } | 80 } |
| 81 | 81 |
| 82 /** | 82 /** |
| 83 * @param {remoting.It2MeHostFacade} hostFacade An initialized | 83 * @param {remoting.It2MeHostFacade} hostFacade An initialized |
| 84 * It2MeHostFacade. | 84 * It2MeHostFacade. |
| 85 * @param {string} token The OAuth access token. | 85 * @param {string} token The OAuth access token. |
| 86 * @private | 86 * @private |
| 87 */ | 87 */ |
| 88 remoting.tryShareWithToken_ = function(hostFacade, token) { | 88 remoting.tryShareWithToken_ = function(hostFacade, token) { |
| 89 lastShareWasCancelled_ = false; | 89 lastShareWasCancelled_ = false; |
| (...skipping 240 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 330 function onNatTraversalPolicyChanged_(enabled) { | 330 function onNatTraversalPolicyChanged_(enabled) { |
| 331 var natBox = document.getElementById('nat-box'); | 331 var natBox = document.getElementById('nat-box'); |
| 332 if (enabled) { | 332 if (enabled) { |
| 333 natBox.classList.add('traversal-enabled'); | 333 natBox.classList.add('traversal-enabled'); |
| 334 } else { | 334 } else { |
| 335 natBox.classList.remove('traversal-enabled'); | 335 natBox.classList.remove('traversal-enabled'); |
| 336 } | 336 } |
| 337 } | 337 } |
| 338 | 338 |
| 339 })(); | 339 })(); |
| OLD | NEW |