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 189 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
200 // resolution to the host once connection has been established. See | 200 // resolution to the host once connection has been established. See |
201 // this.plugin_.notifyClientResolution(). | 201 // this.plugin_.notifyClientResolution(). |
202 SEND_INITIAL_RESOLUTION: 'sendInitialResolution', | 202 SEND_INITIAL_RESOLUTION: 'sendInitialResolution', |
203 | 203 |
204 // Let the host know that we're interested in knowing whether or not it | 204 // Let the host know that we're interested in knowing whether or not it |
205 // rate limits desktop-resize requests. | 205 // rate limits desktop-resize requests. |
206 // TODO(kelvinp): This has been supported since M-29. Currently we only have | 206 // TODO(kelvinp): This has been supported since M-29. Currently we only have |
207 // <1000 users on M-29 or below. Remove this and the capability on the host. | 207 // <1000 users on M-29 or below. Remove this and the capability on the host. |
208 RATE_LIMIT_RESIZE_REQUESTS: 'rateLimitResizeRequests', | 208 RATE_LIMIT_RESIZE_REQUESTS: 'rateLimitResizeRequests', |
209 | 209 |
210 // Indicates native touch input support. If the host does not support | |
211 // touch then the client will let Chrome sythesize mouse events from touch | |
Wez
2015/05/21 00:59:14
typo: synthesize
Rintaro Kuroiwa
2015/05/21 21:53:30
Done.
| |
212 // input, for compatibility with non-touch-aware systems. | |
213 TOUCH_EVENTS: 'touchEvents', | |
214 | |
210 // Indicates that host/client supports Google Drive integration, and that the | 215 // Indicates that host/client supports Google Drive integration, and that the |
211 // client should send to the host the OAuth tokens to be used by Google Drive | 216 // client should send to the host the OAuth tokens to be used by Google Drive |
212 // on the host. | 217 // on the host. |
213 GOOGLE_DRIVE: "googleDrive", | 218 GOOGLE_DRIVE: "googleDrive", |
214 | 219 |
215 // Indicates that the client supports the video frame-recording extension. | 220 // Indicates that the client supports the video frame-recording extension. |
216 VIDEO_RECORDER: 'videoRecorder', | 221 VIDEO_RECORDER: 'videoRecorder', |
217 | 222 |
218 // Indicates that the client supports 'cast'ing the video stream to a | 223 // Indicates that the client supports 'cast'ing the video stream to a |
219 // cast-enabled device. | 224 // cast-enabled device. |
(...skipping 238 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
458 remoting.ClientSession.prototype.onSetCapabilities = function(capabilities) { | 463 remoting.ClientSession.prototype.onSetCapabilities = function(capabilities) { |
459 if (this.capabilities_ != null) { | 464 if (this.capabilities_ != null) { |
460 console.error('onSetCapabilities_() is called more than once'); | 465 console.error('onSetCapabilities_() is called more than once'); |
461 return; | 466 return; |
462 } | 467 } |
463 | 468 |
464 this.capabilities_ = capabilities; | 469 this.capabilities_ = capabilities; |
465 if (this.hasCapability(remoting.ClientSession.Capability.GOOGLE_DRIVE)) { | 470 if (this.hasCapability(remoting.ClientSession.Capability.GOOGLE_DRIVE)) { |
466 this.sendGoogleDriveAccessToken_(); | 471 this.sendGoogleDriveAccessToken_(); |
467 } | 472 } |
473 if (this.hasCapability(remoting.ClientSession.Capability.TOUCH_EVENTS)) { | |
474 this.plugin_.enableTouchEvents(true); | |
475 } | |
468 }; | 476 }; |
469 | 477 |
470 /** | 478 /** |
471 * @param {string} type | 479 * @param {string} type |
472 * @param {string} data | 480 * @param {string} data |
473 */ | 481 */ |
474 remoting.ClientSession.prototype.onExtensionMessage = function(type, data) { | 482 remoting.ClientSession.prototype.onExtensionMessage = function(type, data) { |
475 this.onExtensionMessageHandler_(type, data); | 483 this.onExtensionMessageHandler_(type, data); |
476 }; | 484 }; |
477 | 485 |
(...skipping 117 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
595 var googleDriveScopes = [ | 603 var googleDriveScopes = [ |
596 'https://docs.google.com/feeds/', | 604 'https://docs.google.com/feeds/', |
597 'https://www.googleapis.com/auth/drive' | 605 'https://www.googleapis.com/auth/drive' |
598 ]; | 606 ]; |
599 remoting.identity.getNewToken(googleDriveScopes). | 607 remoting.identity.getNewToken(googleDriveScopes). |
600 then(sendToken). | 608 then(sendToken). |
601 catch(remoting.Error.handler(sendError)); | 609 catch(remoting.Error.handler(sendError)); |
602 window.setTimeout(this.sendGoogleDriveAccessToken_.bind(this), | 610 window.setTimeout(this.sendGoogleDriveAccessToken_.bind(this), |
603 remoting.ACCESS_TOKEN_RESEND_INTERVAL_MS); | 611 remoting.ACCESS_TOKEN_RESEND_INTERVAL_MS); |
604 }; | 612 }; |
605 | |
OLD | NEW |