| 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 /** | 5 /** |
| 6 * @fileoverview | 6 * @fileoverview |
| 7 * Class handling user-facing aspects of the client session. | 7 * Class handling user-facing aspects of the client session. |
| 8 */ | 8 */ |
| 9 | 9 |
| 10 'use strict'; | 10 'use strict'; |
| (...skipping 21 matching lines...) Expand all Loading... |
| 32 * @param {string} defaultRemapKeys The default set of remap keys, to use | 32 * @param {string} defaultRemapKeys The default set of remap keys, to use |
| 33 * when the client doesn't define any. | 33 * when the client doesn't define any. |
| 34 * @param {function(remoting.Error, remoting.ClientPlugin): void} onInitialized | 34 * @param {function(remoting.Error, remoting.ClientPlugin): void} onInitialized |
| 35 * @constructor | 35 * @constructor |
| 36 * @extends {base.EventSourceImpl} | 36 * @extends {base.EventSourceImpl} |
| 37 */ | 37 */ |
| 38 remoting.DesktopConnectedView = function(session, container, host, mode, | 38 remoting.DesktopConnectedView = function(session, container, host, mode, |
| 39 defaultRemapKeys, onInitialized) { | 39 defaultRemapKeys, onInitialized) { |
| 40 this.session_ = session; | 40 this.session_ = session; |
| 41 | 41 |
| 42 /** @type {HTMLElement} @private */ | 42 /** @private {HTMLElement} */ |
| 43 this.container_ = container; | 43 this.container_ = container; |
| 44 | 44 |
| 45 /** @type {remoting.ClientPlugin} @private */ | 45 /** @private {remoting.ClientPlugin} */ |
| 46 this.plugin_ = null; | 46 this.plugin_ = null; |
| 47 | 47 |
| 48 /** @private */ | 48 /** @private */ |
| 49 this.host_ = host; | 49 this.host_ = host; |
| 50 | 50 |
| 51 /** @private */ | 51 /** @private */ |
| 52 this.mode_ = mode; | 52 this.mode_ = mode; |
| 53 | 53 |
| 54 /** @type {string} @private */ | 54 /** @private {string} */ |
| 55 this.defaultRemapKeys_ = defaultRemapKeys; | 55 this.defaultRemapKeys_ = defaultRemapKeys; |
| 56 | 56 |
| 57 /** | 57 /** |
| 58 * Called when the UI is finished initializing. | 58 * Called when the UI is finished initializing. |
| 59 * @type {function(remoting.Error, remoting.ClientPlugin):void} | 59 * @type {function(remoting.Error, remoting.ClientPlugin):void} |
| 60 */ | 60 */ |
| 61 this.onInitialized_ = onInitialized; | 61 this.onInitialized_ = onInitialized; |
| 62 | 62 |
| 63 /** @private */ | 63 /** @private */ |
| 64 this.callPluginLostFocus_ = this.pluginLostFocus_.bind(this); | 64 this.callPluginLostFocus_ = this.pluginLostFocus_.bind(this); |
| 65 /** @private */ | 65 /** @private */ |
| 66 this.callPluginGotFocus_ = this.pluginGotFocus_.bind(this); | 66 this.callPluginGotFocus_ = this.pluginGotFocus_.bind(this); |
| 67 /** @type {Element} @private */ | 67 /** @private {Element} */ |
| 68 this.debugRegionContainer_ = | 68 this.debugRegionContainer_ = |
| 69 this.container_.querySelector('.debug-region-container'); | 69 this.container_.querySelector('.debug-region-container'); |
| 70 | 70 |
| 71 /** @type {Element} @private */ | 71 /** @private {Element} */ |
| 72 this.mouseCursorOverlay_ = | 72 this.mouseCursorOverlay_ = |
| 73 this.container_.querySelector('.mouse-cursor-overlay'); | 73 this.container_.querySelector('.mouse-cursor-overlay'); |
| 74 | 74 |
| 75 /** @private {remoting.DesktopViewport} */ | 75 /** @private {remoting.DesktopViewport} */ |
| 76 this.viewport_ = null; | 76 this.viewport_ = null; |
| 77 | 77 |
| 78 /** @type {Element} */ | 78 /** @type {Element} */ |
| 79 var img = this.mouseCursorOverlay_; | 79 var img = this.mouseCursorOverlay_; |
| 80 /** @param {Event} event @private */ | 80 /** |
| 81 * @param {Event} event |
| 82 * @private |
| 83 */ |
| 81 this.updateMouseCursorPosition_ = function(event) { | 84 this.updateMouseCursorPosition_ = function(event) { |
| 82 img.style.top = event.offsetY + 'px'; | 85 img.style.top = event.offsetY + 'px'; |
| 83 img.style.left = event.offsetX + 'px'; | 86 img.style.left = event.offsetX + 'px'; |
| 84 }; | 87 }; |
| 85 | 88 |
| 86 /** @type {remoting.VideoFrameRecorder} @private */ | 89 /** @private {remoting.VideoFrameRecorder} */ |
| 87 this.videoFrameRecorder_ = null; | 90 this.videoFrameRecorder_ = null; |
| 88 | 91 |
| 89 /** private {base.Disposable} */ | 92 /** private {base.Disposable} */ |
| 90 this.eventHooks_ = null; | 93 this.eventHooks_ = null; |
| 91 }; | 94 }; |
| 92 | 95 |
| 93 // The mode of this session. | 96 // The mode of this session. |
| 94 /** @enum {number} */ | 97 /** @enum {number} */ |
| 95 remoting.DesktopConnectedView.Mode = { | 98 remoting.DesktopConnectedView.Mode = { |
| 96 IT2ME: 0, | 99 IT2ME: 0, |
| (...skipping 497 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 594 var rect = document.createElement('div'); | 597 var rect = document.createElement('div'); |
| 595 rect.classList.add('debug-region-rect'); | 598 rect.classList.add('debug-region-rect'); |
| 596 rect.style.left = rects[i][0] + 'px'; | 599 rect.style.left = rects[i][0] + 'px'; |
| 597 rect.style.top = rects[i][1] +'px'; | 600 rect.style.top = rects[i][1] +'px'; |
| 598 rect.style.width = rects[i][2] +'px'; | 601 rect.style.width = rects[i][2] +'px'; |
| 599 rect.style.height = rects[i][3] + 'px'; | 602 rect.style.height = rects[i][3] + 'px'; |
| 600 this.debugRegionContainer_.appendChild(rect); | 603 this.debugRegionContainer_.appendChild(rect); |
| 601 } | 604 } |
| 602 } | 605 } |
| 603 }; | 606 }; |
| OLD | NEW |