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 390 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
401 // client should send to the host the OAuth tokens to be used by Google Drive | 401 // client should send to the host the OAuth tokens to be used by Google Drive |
402 // on the host. | 402 // on the host. |
403 GOOGLE_DRIVE: "googleDrive", | 403 GOOGLE_DRIVE: "googleDrive", |
404 | 404 |
405 // Indicates that the client supports the video frame-recording extension. | 405 // Indicates that the client supports the video frame-recording extension. |
406 VIDEO_RECORDER: 'videoRecorder', | 406 VIDEO_RECORDER: 'videoRecorder', |
407 | 407 |
408 // Indicates that the client supports 'cast'ing the video stream to a | 408 // Indicates that the client supports 'cast'ing the video stream to a |
409 // cast-enabled device. | 409 // cast-enabled device. |
410 CAST: 'casting', | 410 CAST: 'casting', |
411 | |
412 // When enabled, this capability results in the client informing the host | |
413 // that it supports Gnubby-based authentication. | |
414 GNUBBY_AUTH: 'gnubbyAuth' | |
415 }; | 411 }; |
416 | 412 |
417 /** | 413 /** |
418 * The set of capabilities negotiated between the client and host. | 414 * The set of capabilities negotiated between the client and host. |
419 * @type {Array.<string>} | 415 * @type {Array.<string>} |
420 * @private | 416 * @private |
421 */ | 417 */ |
422 remoting.ClientSession.prototype.capabilities_ = null; | 418 remoting.ClientSession.prototype.capabilities_ = null; |
423 | 419 |
424 /** | 420 /** |
(...skipping 1140 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1565 console.error('Received unexpected gnubby message'); | 1561 console.error('Received unexpected gnubby message'); |
1566 } | 1562 } |
1567 }; | 1563 }; |
1568 | 1564 |
1569 /** | 1565 /** |
1570 * Create a gnubby auth handler and inform the host that gnubby auth is | 1566 * Create a gnubby auth handler and inform the host that gnubby auth is |
1571 * supported. | 1567 * supported. |
1572 * @private | 1568 * @private |
1573 */ | 1569 */ |
1574 remoting.ClientSession.prototype.createGnubbyAuthHandler_ = function() { | 1570 remoting.ClientSession.prototype.createGnubbyAuthHandler_ = function() { |
1575 if (this.hasCapability_(remoting.ClientSession.Capability.GNUBBY_AUTH) && | 1571 if (this.mode_ == remoting.ClientSession.Mode.ME2ME) { |
1576 this.mode_ == remoting.ClientSession.Mode.ME2ME) { | |
1577 this.gnubbyAuthHandler_ = new remoting.GnubbyAuthHandler(this); | 1572 this.gnubbyAuthHandler_ = new remoting.GnubbyAuthHandler(this); |
1578 // TODO(psj): Move to more generic capabilities mechanism. | 1573 // TODO(psj): Move to more generic capabilities mechanism. |
1579 this.sendGnubbyAuthMessage({'type': 'control', 'option': 'auth-v1'}); | 1574 this.sendGnubbyAuthMessage({'type': 'control', 'option': 'auth-v1'}); |
1580 } | 1575 } |
1581 }; | 1576 }; |
1582 | 1577 |
1583 /** | 1578 /** |
1584 * Timer callback to send the access token to the host. | 1579 * Timer callback to send the access token to the host. |
1585 * @private | 1580 * @private |
1586 */ | 1581 */ |
(...skipping 139 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1726 * @param {Object} message The parsed extension message data. | 1721 * @param {Object} message The parsed extension message data. |
1727 * @return {boolean} True if the message was recognized, false otherwise. | 1722 * @return {boolean} True if the message was recognized, false otherwise. |
1728 */ | 1723 */ |
1729 remoting.ClientSession.prototype.handleExtensionMessage = | 1724 remoting.ClientSession.prototype.handleExtensionMessage = |
1730 function(type, message) { | 1725 function(type, message) { |
1731 if (this.videoFrameRecorder_) { | 1726 if (this.videoFrameRecorder_) { |
1732 return this.videoFrameRecorder_.handleMessage(type, message); | 1727 return this.videoFrameRecorder_.handleMessage(type, message); |
1733 } | 1728 } |
1734 return false; | 1729 return false; |
1735 } | 1730 } |
OLD | NEW |