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 208 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
219 // resolution to the host once connection has been established. See | 219 // resolution to the host once connection has been established. See |
220 // this.plugin_.notifyClientResolution(). | 220 // this.plugin_.notifyClientResolution(). |
221 SEND_INITIAL_RESOLUTION: 'sendInitialResolution', | 221 SEND_INITIAL_RESOLUTION: 'sendInitialResolution', |
222 | 222 |
223 // Let the host know that we're interested in knowing whether or not it | 223 // Let the host know that we're interested in knowing whether or not it |
224 // rate limits desktop-resize requests. | 224 // rate limits desktop-resize requests. |
225 // TODO(kelvinp): This has been supported since M-29. Currently we only have | 225 // TODO(kelvinp): This has been supported since M-29. Currently we only have |
226 // <1000 users on M-29 or below. Remove this and the capability on the host. | 226 // <1000 users on M-29 or below. Remove this and the capability on the host. |
227 RATE_LIMIT_RESIZE_REQUESTS: 'rateLimitResizeRequests', | 227 RATE_LIMIT_RESIZE_REQUESTS: 'rateLimitResizeRequests', |
228 | 228 |
| 229 // Indicates native touch input support. If the host does not support |
| 230 // touch then the client will let Chrome synthesize mouse events from touch |
| 231 // input, for compatibility with non-touch-aware systems. |
| 232 TOUCH_EVENTS: 'touchEvents', |
| 233 |
229 // Indicates that host/client supports Google Drive integration, and that the | 234 // Indicates that host/client supports Google Drive integration, and that the |
230 // client should send to the host the OAuth tokens to be used by Google Drive | 235 // client should send to the host the OAuth tokens to be used by Google Drive |
231 // on the host. | 236 // on the host. |
232 GOOGLE_DRIVE: 'googleDrive', | 237 GOOGLE_DRIVE: 'googleDrive', |
233 | 238 |
234 // Indicates that the client supports the video frame-recording extension. | 239 // Indicates that the client supports the video frame-recording extension. |
235 VIDEO_RECORDER: 'videoRecorder', | 240 VIDEO_RECORDER: 'videoRecorder', |
236 | 241 |
237 // Indicates that the client supports 'cast'ing the video stream to a | 242 // Indicates that the client supports 'cast'ing the video stream to a |
238 // cast-enabled device. | 243 // cast-enabled device. |
(...skipping 283 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
522 if (newState == remoting.ClientSession.State.CONNECTED) { | 527 if (newState == remoting.ClientSession.State.CONNECTED) { |
523 this.connectedDisposables_.add( | 528 this.connectedDisposables_.add( |
524 new base.RepeatingTimer(this.reportStatistics.bind(this), 1000)); | 529 new base.RepeatingTimer(this.reportStatistics.bind(this), 1000)); |
525 } else if (this.isFinished()) { | 530 } else if (this.isFinished()) { |
526 base.dispose(this.connectedDisposables_); | 531 base.dispose(this.connectedDisposables_); |
527 this.connectedDisposables_ = null; | 532 this.connectedDisposables_ = null; |
528 } | 533 } |
529 | 534 |
530 this.notifyStateChanges_(oldState, this.state_); | 535 this.notifyStateChanges_(oldState, this.state_); |
531 this.logToServer_.logClientSessionStateChange(this.state_, this.error_); | 536 this.logToServer_.logClientSessionStateChange(this.state_, this.error_); |
| 537 if (this.plugin_.hasCapability( |
| 538 remoting.ClientSession.Capability.TOUCH_EVENTS)) { |
| 539 this.plugin_.enableTouchEvents(true); |
| 540 } |
532 }; | 541 }; |
533 | 542 |
534 /** | 543 /** |
535 * @param {remoting.ClientSession.State} oldState The new state for the session. | 544 * @param {remoting.ClientSession.State} oldState The new state for the session. |
536 * @param {remoting.ClientSession.State} newState The new state for the session. | 545 * @param {remoting.ClientSession.State} newState The new state for the session. |
537 * @private | 546 * @private |
538 */ | 547 */ |
539 remoting.ClientSession.prototype.notifyStateChanges_ = | 548 remoting.ClientSession.prototype.notifyStateChanges_ = |
540 function(oldState, newState) { | 549 function(oldState, newState) { |
541 /** @type {remoting.Error} */ | 550 /** @type {remoting.Error} */ |
(...skipping 79 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
621 * Enable or disable logging of connection errors due to a host being offline. | 630 * Enable or disable logging of connection errors due to a host being offline. |
622 * For example, if attempting a connection using a cached JID, host-offline | 631 * For example, if attempting a connection using a cached JID, host-offline |
623 * errors should not be logged because the JID will be refreshed and the | 632 * errors should not be logged because the JID will be refreshed and the |
624 * connection retried. | 633 * connection retried. |
625 * | 634 * |
626 * @param {boolean} enable True to log host-offline errors; false to suppress. | 635 * @param {boolean} enable True to log host-offline errors; false to suppress. |
627 */ | 636 */ |
628 remoting.ClientSession.prototype.logHostOfflineErrors = function(enable) { | 637 remoting.ClientSession.prototype.logHostOfflineErrors = function(enable) { |
629 this.logHostOfflineErrors_ = enable; | 638 this.logHostOfflineErrors_ = enable; |
630 }; | 639 }; |
OLD | NEW |