| OLD | NEW |
| 1 // Copyright (c) 2011 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2011 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 remoting = remoting || {}; | 5 var remoting = remoting || {}; |
| 6 | 6 |
| 7 (function() { | 7 (function() { |
| 8 'use strict'; | 8 'use strict'; |
| 9 | 9 |
| 10 window.addEventListener('blur', pluginLostFocus_, false); | 10 window.addEventListener('blur', pluginLostFocus_, false); |
| (...skipping 314 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 325 remoting.updateAccessCodeTimeoutElement_(); | 325 remoting.updateAccessCodeTimeoutElement_(); |
| 326 updateTimeoutStyles_(); | 326 updateTimeoutStyles_(); |
| 327 remoting.setMode(remoting.AppMode.HOST_WAITING_FOR_CONNECTION); | 327 remoting.setMode(remoting.AppMode.HOST_WAITING_FOR_CONNECTION); |
| 328 } else { | 328 } else { |
| 329 // This can only happen if the access code takes more than 5m to get from | 329 // This can only happen if the access code takes more than 5m to get from |
| 330 // the cloud to the web-app, so we don't care how clean this UX is. | 330 // the cloud to the web-app, so we don't care how clean this UX is. |
| 331 remoting.debug.log('Access code already invalid on receipt!'); | 331 remoting.debug.log('Access code already invalid on receipt!'); |
| 332 remoting.cancelShare(); | 332 remoting.cancelShare(); |
| 333 } | 333 } |
| 334 } else if (state == plugin.CONNECTED) { | 334 } else if (state == plugin.CONNECTED) { |
| 335 var element = document.getElementById('host-shared-message'); |
| 336 var client = plugin.client; |
| 337 l10n.localizeElement(element, client); |
| 335 remoting.setMode(remoting.AppMode.HOST_SHARED); | 338 remoting.setMode(remoting.AppMode.HOST_SHARED); |
| 336 disableTimeoutCountdown_(); | 339 disableTimeoutCountdown_(); |
| 337 } else if (state == plugin.DISCONNECTED) { | 340 } else if (state == plugin.DISCONNECTED) { |
| 338 remoting.setMode(remoting.AppMode.HOST_UNSHARED); | 341 remoting.setMode(remoting.AppMode.HOST_UNSHARED); |
| 339 plugin.parentNode.removeChild(plugin); | 342 plugin.parentNode.removeChild(plugin); |
| 340 } else { | 343 } else { |
| 341 remoting.debug.log('Unknown state -> ' + state); | 344 remoting.debug.log('Unknown state -> ' + state); |
| 342 } | 345 } |
| 343 } | 346 } |
| 344 | 347 |
| (...skipping 260 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 605 remoting.disconnect = function() { | 608 remoting.disconnect = function() { |
| 606 if (remoting.session) { | 609 if (remoting.session) { |
| 607 remoting.session.disconnect(); | 610 remoting.session.disconnect(); |
| 608 remoting.session = null; | 611 remoting.session = null; |
| 609 remoting.debug.log('Disconnected.'); | 612 remoting.debug.log('Disconnected.'); |
| 610 remoting.setMode(remoting.AppMode.CLIENT_SESSION_FINISHED); | 613 remoting.setMode(remoting.AppMode.CLIENT_SESSION_FINISHED); |
| 611 } | 614 } |
| 612 } | 615 } |
| 613 | 616 |
| 614 }()); | 617 }()); |
| OLD | NEW |