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'; |
11 | 11 |
12 /** @suppress {duplicate} */ | 12 /** @suppress {duplicate} */ |
13 var remoting = remoting || {}; | 13 var remoting = remoting || {}; |
14 | 14 |
15 /** | 15 /** |
16 * @param {HTMLElement} container | 16 * @param {HTMLElement} container |
17 * @param {remoting.ConnectionInfo} connectionInfo | 17 * @param {remoting.ConnectionInfo} connectionInfo |
| 18 * @param {remoting.SessionLogger} logger |
18 * @constructor | 19 * @constructor |
19 * @extends {base.EventSourceImpl} | 20 * @extends {base.EventSourceImpl} |
20 * @implements {base.Disposable} | 21 * @implements {base.Disposable} |
21 */ | 22 */ |
22 remoting.DesktopConnectedView = function(container, connectionInfo) { | 23 remoting.DesktopConnectedView = function(container, connectionInfo, logger) { |
23 | 24 |
24 /** @private {HTMLElement} */ | 25 /** @private {HTMLElement} */ |
25 this.container_ = container; | 26 this.container_ = container; |
26 | 27 |
27 /** @private {remoting.ClientPlugin} */ | 28 /** @private {remoting.ClientPlugin} */ |
28 this.plugin_ = connectionInfo.plugin(); | 29 this.plugin_ = connectionInfo.plugin(); |
29 | 30 |
30 /** @private {remoting.ClientSession} */ | 31 /** @private {remoting.ClientSession} */ |
31 this.session_ = connectionInfo.session(); | 32 this.session_ = connectionInfo.session(); |
32 | 33 |
33 /** @private */ | 34 /** @private */ |
34 this.host_ = connectionInfo.host(); | 35 this.host_ = connectionInfo.host(); |
35 | 36 |
| 37 /** @private */ |
| 38 this.logger_ = logger; |
| 39 |
36 /** @private {remoting.DesktopViewport} */ | 40 /** @private {remoting.DesktopViewport} */ |
37 this.viewport_ = null; | 41 this.viewport_ = null; |
38 | 42 |
39 /** @private {remoting.ConnectedView} */ | 43 /** @private {remoting.ConnectedView} */ |
40 this.view_ = null; | 44 this.view_ = null; |
41 | 45 |
42 /** @private {base.Disposable} */ | 46 /** @private {base.Disposable} */ |
43 this.eventHooks_ = null; | 47 this.eventHooks_ = null; |
44 | 48 |
45 /** @private */ | 49 /** @private */ |
(...skipping 126 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
172 document.body.classList.add('connected'); | 176 document.body.classList.add('connected'); |
173 | 177 |
174 this.view_ = new remoting.ConnectedView( | 178 this.view_ = new remoting.ConnectedView( |
175 this.plugin_, this.container_, | 179 this.plugin_, this.container_, |
176 this.container_.querySelector('.mouse-cursor-overlay')); | 180 this.container_.querySelector('.mouse-cursor-overlay')); |
177 | 181 |
178 var scrollerElement = base.getHtmlElement('scroller'); | 182 var scrollerElement = base.getHtmlElement('scroller'); |
179 this.viewport_ = new remoting.DesktopViewport( | 183 this.viewport_ = new remoting.DesktopViewport( |
180 scrollerElement || document.body, | 184 scrollerElement || document.body, |
181 this.plugin_.hostDesktop(), | 185 this.plugin_.hostDesktop(), |
182 this.host_.options); | 186 this.host_.options, |
| 187 this.logger_); |
183 | 188 |
184 if (remoting.windowFrame) { | 189 if (remoting.windowFrame) { |
185 remoting.windowFrame.setDesktopConnectedView(this); | 190 remoting.windowFrame.setDesktopConnectedView(this); |
186 } | 191 } |
187 if (remoting.toolbar) { | 192 if (remoting.toolbar) { |
188 remoting.toolbar.setDesktopConnectedView(this); | 193 remoting.toolbar.setDesktopConnectedView(this); |
189 } | 194 } |
190 if (remoting.optionsMenu) { | 195 if (remoting.optionsMenu) { |
191 remoting.optionsMenu.setDesktopConnectedView(this); | 196 remoting.optionsMenu.setDesktopConnectedView(this); |
192 } | 197 } |
(...skipping 100 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
293 this.host_.options.save(); | 298 this.host_.options.save(); |
294 this.plugin_.setRemapKeys(this.host_.options.getRemapKeys()); | 299 this.plugin_.setRemapKeys(this.host_.options.getRemapKeys()); |
295 }; | 300 }; |
296 | 301 |
297 /** | 302 /** |
298 * Factory function so that it can be overwritten in unit test to avoid | 303 * Factory function so that it can be overwritten in unit test to avoid |
299 * UI dependencies. | 304 * UI dependencies. |
300 * | 305 * |
301 * @param {HTMLElement} container | 306 * @param {HTMLElement} container |
302 * @param {remoting.ConnectionInfo} connectionInfo | 307 * @param {remoting.ConnectionInfo} connectionInfo |
| 308 * @param {remoting.SessionLogger} logger |
303 * @return {remoting.DesktopConnectedView} | 309 * @return {remoting.DesktopConnectedView} |
304 */ | 310 */ |
305 remoting.DesktopConnectedView.create = function(container, connectionInfo) { | 311 remoting.DesktopConnectedView.create = function(container, connectionInfo, |
306 return new remoting.DesktopConnectedView(container, connectionInfo); | 312 logger) { |
| 313 return new remoting.DesktopConnectedView(container, connectionInfo, logger); |
307 }; | 314 }; |
OLD | NEW |