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 // Host & client support touch. Client can always support multi touch | |
211 // because if the client is not a touch device, it cannot send touch events to | |
212 // the host. What really matters is whether the host supports this. | |
213 // If not the plugin should not handle touch events and get synthesized | |
214 // mouse events from PPAPI. | |
Wez
2015/03/30 17:10:07
Suggest rewording:
"Host & client support touch.
Rintaro Kuroiwa
2015/04/08 03:27:43
Done.
| |
215 MULTI_TOUCH: 'multiTouch', | |
216 | |
210 // Indicates that host/client supports Google Drive integration, and that the | 217 // 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 | 218 // client should send to the host the OAuth tokens to be used by Google Drive |
212 // on the host. | 219 // on the host. |
213 GOOGLE_DRIVE: "googleDrive", | 220 GOOGLE_DRIVE: "googleDrive", |
214 | 221 |
215 // Indicates that the client supports the video frame-recording extension. | 222 // Indicates that the client supports the video frame-recording extension. |
216 VIDEO_RECORDER: 'videoRecorder', | 223 VIDEO_RECORDER: 'videoRecorder', |
217 | 224 |
218 // Indicates that the client supports 'cast'ing the video stream to a | 225 // Indicates that the client supports 'cast'ing the video stream to a |
219 // cast-enabled device. | 226 // cast-enabled device. |
(...skipping 238 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
458 remoting.ClientSession.prototype.onSetCapabilities = function(capabilities) { | 465 remoting.ClientSession.prototype.onSetCapabilities = function(capabilities) { |
459 if (this.capabilities_ != null) { | 466 if (this.capabilities_ != null) { |
460 console.error('onSetCapabilities_() is called more than once'); | 467 console.error('onSetCapabilities_() is called more than once'); |
461 return; | 468 return; |
462 } | 469 } |
463 | 470 |
464 this.capabilities_ = capabilities; | 471 this.capabilities_ = capabilities; |
465 if (this.hasCapability(remoting.ClientSession.Capability.GOOGLE_DRIVE)) { | 472 if (this.hasCapability(remoting.ClientSession.Capability.GOOGLE_DRIVE)) { |
466 this.sendGoogleDriveAccessToken_(); | 473 this.sendGoogleDriveAccessToken_(); |
467 } | 474 } |
475 | |
Wez
2015/03/30 17:10:07
nit: No need for blank line.
Rintaro Kuroiwa
2015/04/08 03:27:43
Done.
| |
476 if (this.hasCapability(remoting.ClientSession.Capability.MULTI_TOUCH)) { | |
477 this.plugin_.enableTouchEvents(); | |
478 } | |
468 }; | 479 }; |
469 | 480 |
470 /** | 481 /** |
471 * @param {string} type | 482 * @param {string} type |
472 * @param {string} data | 483 * @param {string} data |
473 */ | 484 */ |
474 remoting.ClientSession.prototype.onExtensionMessage = function(type, data) { | 485 remoting.ClientSession.prototype.onExtensionMessage = function(type, data) { |
475 this.onExtensionMessageHandler_(type, data); | 486 this.onExtensionMessageHandler_(type, data); |
476 }; | 487 }; |
477 | 488 |
(...skipping 117 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
595 var googleDriveScopes = [ | 606 var googleDriveScopes = [ |
596 'https://docs.google.com/feeds/', | 607 'https://docs.google.com/feeds/', |
597 'https://www.googleapis.com/auth/drive' | 608 'https://www.googleapis.com/auth/drive' |
598 ]; | 609 ]; |
599 remoting.identity.getNewToken(googleDriveScopes). | 610 remoting.identity.getNewToken(googleDriveScopes). |
600 then(sendToken). | 611 then(sendToken). |
601 catch(remoting.Error.handler(sendError)); | 612 catch(remoting.Error.handler(sendError)); |
602 window.setTimeout(this.sendGoogleDriveAccessToken_.bind(this), | 613 window.setTimeout(this.sendGoogleDriveAccessToken_.bind(this), |
603 remoting.ACCESS_TOKEN_RESEND_INTERVAL_MS); | 614 remoting.ACCESS_TOKEN_RESEND_INTERVAL_MS); |
604 }; | 615 }; |
605 | |
OLD | NEW |