Lines Matching refs:ClientSession
9 * The ClientSession class controls lifetime of the client plugin
51 * @param {remoting.ClientSession.Mode} mode The mode of this connection.
59 remoting.ClientSession = function(signalStrategy, container, hostDisplayName,
65 this.state_ = remoting.ClientSession.State.CREATED;
171 this.defineEvents(Object.keys(remoting.ClientSession.Events));
174 base.extend(remoting.ClientSession, base.EventSource);
177 remoting.ClientSession.Events = {
189 remoting.ClientSession.prototype.getHostDisplayName = function() {
200 remoting.ClientSession.prototype.updateScrollbarVisibility = function() {
235 remoting.ClientSession.prototype.getShrinkToFit = function() {
242 remoting.ClientSession.prototype.getResizeToClient = function() {
251 remoting.ClientSession.State = {
265 * @return {remoting.ClientSession.State} The session state enum value.
267 remoting.ClientSession.State.fromString = function(state) {
268 if (!remoting.ClientSession.State.hasOwnProperty(state)) {
269 throw "Invalid ClientSession.State: " + state;
271 return remoting.ClientSession.State[state];
276 @param {remoting.ClientSession.State} current
277 @param {remoting.ClientSession.State} previous
279 remoting.ClientSession.StateEvent = function(current, previous) {
280 /** @type {remoting.ClientSession.State} */
283 /** @type {remoting.ClientSession.State} */
288 remoting.ClientSession.ConnectionError = {
300 * @return {remoting.ClientSession.ConnectionError} The connection error enum.
302 remoting.ClientSession.ConnectionError.fromString = function(error) {
303 if (!remoting.ClientSession.ConnectionError.hasOwnProperty(error)) {
304 console.error('Unexpected ClientSession.ConnectionError string: ', error);
305 return remoting.ClientSession.ConnectionError.UNKNOWN;
307 return remoting.ClientSession.ConnectionError[error];
312 remoting.ClientSession.Mode = {
321 remoting.ClientSession.PerfStats = function() {};
323 remoting.ClientSession.PerfStats.prototype.videoBandwidth;
325 remoting.ClientSession.PerfStats.prototype.videoFrameRate;
327 remoting.ClientSession.PerfStats.prototype.captureLatency;
329 remoting.ClientSession.PerfStats.prototype.encodeLatency;
331 remoting.ClientSession.PerfStats.prototype.decodeLatency;
333 remoting.ClientSession.PerfStats.prototype.renderLatency;
335 remoting.ClientSession.PerfStats.prototype.roundtripLatency;
338 remoting.ClientSession.STATS_KEY_VIDEO_BANDWIDTH = 'videoBandwidth';
339 remoting.ClientSession.STATS_KEY_VIDEO_FRAME_RATE = 'videoFrameRate';
340 remoting.ClientSession.STATS_KEY_CAPTURE_LATENCY = 'captureLatency';
341 remoting.ClientSession.STATS_KEY_ENCODE_LATENCY = 'encodeLatency';
342 remoting.ClientSession.STATS_KEY_DECODE_LATENCY = 'decodeLatency';
343 remoting.ClientSession.STATS_KEY_RENDER_LATENCY = 'renderLatency';
344 remoting.ClientSession.STATS_KEY_ROUNDTRIP_LATENCY = 'roundtripLatency';
347 remoting.ClientSession.KEY_REMAP_KEYS = 'remapKeys';
348 remoting.ClientSession.KEY_RESIZE_TO_CLIENT = 'resizeToClient';
349 remoting.ClientSession.KEY_SHRINK_TO_FIT = 'shrinkToFit';
356 remoting.ClientSession.Capability = {
371 remoting.ClientSession.prototype.capabilities_ = null;
374 * @param {remoting.ClientSession.Capability} capability The capability to test
380 remoting.ClientSession.prototype.hasCapability_ = function(capability) {
390 remoting.ClientSession.prototype.pluginGotFocus_ = function() {
397 remoting.ClientSession.prototype.pluginLostFocus_ = function() {
418 remoting.ClientSession.prototype.createPluginAndConnect =
432 remoting.ClientSession.prototype.onHostSettingsLoaded_ = function(options) {
433 if (remoting.ClientSession.KEY_REMAP_KEYS in options &&
434 typeof(options[remoting.ClientSession.KEY_REMAP_KEYS]) ==
437 options[remoting.ClientSession.KEY_REMAP_KEYS];
439 if (remoting.ClientSession.KEY_RESIZE_TO_CLIENT in options &&
440 typeof(options[remoting.ClientSession.KEY_RESIZE_TO_CLIENT]) ==
443 options[remoting.ClientSession.KEY_RESIZE_TO_CLIENT];
445 if (remoting.ClientSession.KEY_SHRINK_TO_FIT in options &&
446 typeof(options[remoting.ClientSession.KEY_SHRINK_TO_FIT]) ==
449 options[remoting.ClientSession.KEY_SHRINK_TO_FIT];
460 remoting.ClientSession.prototype.setFocusHandlers_ = function() {
471 remoting.ClientSession.prototype.resetWithError_ = function(error) {
476 this.setState_(remoting.ClientSession.State.FAILED);
482 remoting.ClientSession.prototype.onPluginInitialized_ = function(initialized) {
500 } else if (this.mode_ != remoting.ClientSession.Mode.ME2ME) {
558 remoting.ClientSession.prototype.removePlugin = function() {
601 remoting.ClientSession.prototype.disconnect = function(error) {
603 remoting.ClientSession.State.CLOSED :
604 remoting.ClientSession.State.FAILED;
618 remoting.ClientSession.prototype.cleanup = function() {
636 * @return {remoting.ClientSession.Mode} The current state.
638 remoting.ClientSession.prototype.getMode = function() {
643 * @return {remoting.ClientSession.State} The current state.
645 remoting.ClientSession.prototype.getState = function() {
652 remoting.ClientSession.prototype.getError = function() {
664 remoting.ClientSession.prototype.sendKeyCombination_ = function(keys) {
678 remoting.ClientSession.prototype.sendCtrlAltDel = function() {
688 remoting.ClientSession.prototype.sendPrintScreen = function() {
698 remoting.ClientSession.prototype.setRemapKeys = function(remappings) {
706 options[remoting.ClientSession.KEY_REMAP_KEYS] = this.remapKeys_;
715 remoting.ClientSession.prototype.applyRemapKeys_ = function(apply) {
764 remoting.ClientSession.prototype.setScreenMode =
782 options[remoting.ClientSession.KEY_SHRINK_TO_FIT] = this.shrinkToFit_;
783 options[remoting.ClientSession.KEY_RESIZE_TO_CLIENT] = this.resizeToClient_;
799 remoting.ClientSession.prototype.onFirstFrameReceived = function() {
806 remoting.ClientSession.prototype.hasReceivedFrame = function() {
817 remoting.ClientSession.prototype.sendIq_ = function(message) {
843 remoting.ClientSession.prototype.onIncomingMessage_ = function(message) {
856 remoting.ClientSession.prototype.initiateConnection_ = function() {
857 /** @type {remoting.ClientSession} */
878 remoting.ClientSession.prototype.getSharedSecret_ = function(callback) {
879 /** @type remoting.ClientSession */
919 remoting.ClientSession.prototype.onConnectionStatusUpdate_ =
921 if (status == remoting.ClientSession.State.CONNECTED) {
944 } else if (status == remoting.ClientSession.State.FAILED) {
946 case remoting.ClientSession.ConnectionError.HOST_IS_OFFLINE:
949 case remoting.ClientSession.ConnectionError.SESSION_REJECTED:
952 case remoting.ClientSession.ConnectionError.INCOMPATIBLE_PROTOCOL:
955 case remoting.ClientSession.ConnectionError.NETWORK_FAILURE:
958 case remoting.ClientSession.ConnectionError.HOST_OVERLOAD:
965 this.setState_(/** @type {remoting.ClientSession.State} */ (status));
975 remoting.ClientSession.prototype.onConnectionReady_ = function(ready) {
982 ClientSession.Events.videoChannelStateChanged,
994 remoting.ClientSession.prototype.onSetCapabilities_ = function(capabilities) {
1002 remoting.ClientSession.Capability.SEND_INITIAL_RESOLUTION)) {
1009 remoting.ClientSession.Capability.VIDEO_RECORDER)) {
1016 * @param {remoting.ClientSession.State} newState The new state for the session.
1019 remoting.ClientSession.prototype.setState_ = function(newState) {
1023 if (oldState == remoting.ClientSession.State.CONNECTING) {
1024 if (this.state_ == remoting.ClientSession.State.CLOSED) {
1025 state = remoting.ClientSession.State.CONNECTION_CANCELED;
1026 } else if (this.state_ == remoting.ClientSession.State.FAILED &&
1032 state = remoting.ClientSession.State.CONNECTION_CANCELED;
1034 } else if (oldState == remoting.ClientSession.State.CONNECTED &&
1035 this.state_ == remoting.ClientSession.State.FAILED) {
1036 state = remoting.ClientSession.State.CONNECTION_DROPPED;
1039 if (this.state_ == remoting.ClientSession.State.CONNECTED) {
1044 this.raiseEvent(remoting.ClientSession.Events.stateChanged,
1045 new remoting.ClientSession.StateEvent(newState, oldState)
1054 remoting.ClientSession.prototype.onResize = function() {
1067 remoting.ClientSession.Capability.RATE_LIMIT_RESIZE_REQUESTS)) {
1092 remoting.ClientSession.prototype.pauseVideo = function(pause) {
1104 remoting.ClientSession.prototype.pauseAudio = function(pause) {
1117 remoting.ClientSession.prototype.onDesktopSizeChanged_ = function() {
1133 remoting.ClientSession.prototype.updateDimensions = function() {
1217 * @return {remoting.ClientSession.PerfStats} The connection statistics.
1219 remoting.ClientSession.prototype.getPerfStats = function() {
1226 * @param {remoting.ClientSession.PerfStats} stats
1228 remoting.ClientSession.prototype.logStatistics = function(stats) {
1240 remoting.ClientSession.prototype.logHostOfflineErrors = function(enable) {
1251 remoting.ClientSession.prototype.requestPairing = function(clientName, onDone) {
1265 remoting.ClientSession.prototype.onFullScreenChanged_ = function (fullscreen) {
1288 remoting.ClientSession.prototype.scroll_ = function(dx, dy) {
1323 remoting.ClientSession.prototype.resetScroll_ = function() {
1334 remoting.ClientSession.prototype.enableBumpScroll_ = function(enable) {
1351 remoting.ClientSession.prototype.onMouseMove_ = function(event) {
1378 this.raiseEvent(remoting.ClientSession.Events.bumpScrollStarted);
1379 /** @type {remoting.ClientSession} */
1393 that.raiseEvent(remoting.ClientSession.Events.bumpScrollStopped);
1410 remoting.ClientSession.prototype.sendClipboardItem = function(mimeType, item) {
1420 remoting.ClientSession.prototype.sendGnubbyAuthMessage = function(data) {
1431 remoting.ClientSession.prototype.processGnubbyAuthMessage_ = function(data) {
1449 remoting.ClientSession.prototype.createGnubbyAuthHandler_ = function() {
1450 if (this.mode_ == remoting.ClientSession.Mode.ME2ME) {
1463 remoting.ClientSession.prototype.getClientArea_ = function() {
1474 remoting.ClientSession.prototype.updateMouseCursorImage_ =
1487 remoting.ClientSession.prototype.getPluginPositionForTesting = function() {
1499 remoting.ClientSession.prototype.sendCastExtensionMessage = function(data) {
1510 remoting.ClientSession.prototype.processCastExtensionMessage_ = function(data) {
1528 remoting.ClientSession.prototype.createCastExtensionHandler_ = function() {
1529 if (remoting.enableCast && this.mode_ == remoting.ClientSession.Mode.ME2ME) {
1535 * Returns true if the ClientSession can record video frames to a file.
1538 remoting.ClientSession.prototype.canRecordVideo = function() {
1543 * Returns true if the ClientSession is currently recording video frames.
1546 remoting.ClientSession.prototype.isRecordingVideo = function() {
1556 remoting.ClientSession.prototype.startStopRecording = function() {
1568 remoting.ClientSession.prototype.handleExtensionMessage =