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 * Class handling creation and teardown of a remoting client session. | 7 * Class handling creation and teardown of a remoting client session. |
8 * | 8 * |
9 * The ClientSession class controls lifetime of the client plugin | 9 * The ClientSession class controls lifetime of the client plugin |
10 * object and provides the plugin with the functionality it needs to | 10 * object and provides the plugin with the functionality it needs to |
(...skipping 567 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
578 remoting.fullscreen.activate( | 578 remoting.fullscreen.activate( |
579 false, | 579 false, |
580 function() { | 580 function() { |
581 remoting.fullscreen.removeListener(listener); | 581 remoting.fullscreen.removeListener(listener); |
582 }); | 582 }); |
583 if (remoting.windowFrame) { | 583 if (remoting.windowFrame) { |
584 remoting.windowFrame.setClientSession(null); | 584 remoting.windowFrame.setClientSession(null); |
585 } else { | 585 } else { |
586 remoting.toolbar.setClientSession(null); | 586 remoting.toolbar.setClientSession(null); |
587 } | 587 } |
| 588 document.body.classList.remove('connected'); |
588 | 589 |
589 // Remove mediasource-rendering class from the container - this will also | 590 // Remove mediasource-rendering class from the container - this will also |
590 // hide the <video> element. | 591 // hide the <video> element. |
591 this.container_.classList.remove('mediasource-rendering'); | 592 this.container_.classList.remove('mediasource-rendering'); |
592 | 593 |
593 this.container_.removeEventListener('mousemove', | 594 this.container_.removeEventListener('mousemove', |
594 this.updateMouseCursorPosition_, | 595 this.updateMouseCursorPosition_, |
595 true); | 596 true); |
596 }; | 597 }; |
597 | 598 |
(...skipping 367 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
965 window.devicePixelRatio); | 966 window.devicePixelRatio); |
966 } | 967 } |
967 // Activate full-screen related UX. | 968 // Activate full-screen related UX. |
968 remoting.fullscreen.addListener(this.callOnFullScreenChanged_); | 969 remoting.fullscreen.addListener(this.callOnFullScreenChanged_); |
969 remoting.fullscreen.syncWithMaximize(true); | 970 remoting.fullscreen.syncWithMaximize(true); |
970 if (remoting.windowFrame) { | 971 if (remoting.windowFrame) { |
971 remoting.windowFrame.setClientSession(this); | 972 remoting.windowFrame.setClientSession(this); |
972 } else { | 973 } else { |
973 remoting.toolbar.setClientSession(this); | 974 remoting.toolbar.setClientSession(this); |
974 } | 975 } |
| 976 document.body.classList.add('connected'); |
975 | 977 |
976 this.container_.addEventListener('mousemove', | 978 this.container_.addEventListener('mousemove', |
977 this.updateMouseCursorPosition_, | 979 this.updateMouseCursorPosition_, |
978 true); | 980 true); |
979 | 981 |
980 } else if (status == remoting.ClientSession.State.FAILED) { | 982 } else if (status == remoting.ClientSession.State.FAILED) { |
981 switch (error) { | 983 switch (error) { |
982 case remoting.ClientSession.ConnectionError.HOST_IS_OFFLINE: | 984 case remoting.ClientSession.ConnectionError.HOST_IS_OFFLINE: |
983 this.error_ = remoting.Error.HOST_IS_OFFLINE; | 985 this.error_ = remoting.Error.HOST_IS_OFFLINE; |
984 break; | 986 break; |
(...skipping 547 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1532 * @return {{top: number, left:number}} The top-left corner of the plugin. | 1534 * @return {{top: number, left:number}} The top-left corner of the plugin. |
1533 */ | 1535 */ |
1534 remoting.ClientSession.prototype.getPluginPositionForTesting = function() { | 1536 remoting.ClientSession.prototype.getPluginPositionForTesting = function() { |
1535 var plugin = this.plugin_.element(); | 1537 var plugin = this.plugin_.element(); |
1536 var style = plugin.style; | 1538 var style = plugin.style; |
1537 return { | 1539 return { |
1538 top: parseFloat(style.marginTop), | 1540 top: parseFloat(style.marginTop), |
1539 left: parseFloat(style.marginLeft) | 1541 left: parseFloat(style.marginLeft) |
1540 }; | 1542 }; |
1541 }; | 1543 }; |
OLD | NEW |