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); |
| 11 |
| 12 function pluginLostFocus_() { |
| 13 // If the plug loses input focus, release all keys as a precaution against |
| 14 // leaving them 'stuck down' on the host. |
| 15 if (remoting.session && remoting.session.plugin) { |
| 16 remoting.session.plugin.releaseAllKeys(); |
| 17 } |
| 18 } |
| 19 |
10 /** @enum {string} */ | 20 /** @enum {string} */ |
11 remoting.AppMode = { | 21 remoting.AppMode = { |
12 CLIENT: 'client', | 22 CLIENT: 'client', |
13 HOST: 'host', | 23 HOST: 'host', |
14 IN_SESSION: 'in-session' | 24 IN_SESSION: 'in-session' |
15 }; | 25 }; |
16 | 26 |
17 remoting.EMAIL = 'email'; | 27 remoting.EMAIL = 'email'; |
18 remoting.HOST_PLUGIN_ID = 'host-plugin-id'; | 28 remoting.HOST_PLUGIN_ID = 'host-plugin-id'; |
19 | 29 |
(...skipping 488 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
508 } | 518 } |
509 | 519 |
510 remoting.toggleScaleToFit = function() { | 520 remoting.toggleScaleToFit = function() { |
511 remoting.scaleToFit = !remoting.scaleToFit; | 521 remoting.scaleToFit = !remoting.scaleToFit; |
512 document.getElementById('scale-to-fit-toggle').value = | 522 document.getElementById('scale-to-fit-toggle').value = |
513 remoting.scaleToFit ? 'No scaling' : 'Scale to fit'; | 523 remoting.scaleToFit ? 'No scaling' : 'Scale to fit'; |
514 remoting.session.toggleScaleToFit(remoting.scaleToFit); | 524 remoting.session.toggleScaleToFit(remoting.scaleToFit); |
515 } | 525 } |
516 | 526 |
517 }()); | 527 }()); |
OLD | NEW |