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 48 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
59 this.credentialsProvider_ = credentialsProvider; | 59 this.credentialsProvider_ = credentialsProvider; |
60 | 60 |
61 /** @private */ | 61 /** @private */ |
62 this.uiHandler_ = new remoting.DesktopConnectedView( | 62 this.uiHandler_ = new remoting.DesktopConnectedView( |
63 this, container, this.host_, mode, defaultRemapKeys, | 63 this, container, this.host_, mode, defaultRemapKeys, |
64 this.onPluginInitialized_.bind(this)); | 64 this.onPluginInitialized_.bind(this)); |
65 remoting.desktopConnectedView = this.uiHandler_; | 65 remoting.desktopConnectedView = this.uiHandler_; |
66 | 66 |
67 /** @private */ | 67 /** @private */ |
68 this.sessionId_ = ''; | 68 this.sessionId_ = ''; |
69 /** @type {remoting.ClientPlugin} | 69 /** @private {remoting.ClientPlugin} */ |
70 * @private */ | |
71 this.plugin_ = null; | 70 this.plugin_ = null; |
72 /** @private */ | 71 /** @private */ |
73 this.hasReceivedFrame_ = false; | 72 this.hasReceivedFrame_ = false; |
74 this.logToServer = new remoting.LogToServer(signalStrategy, mode); | 73 this.logToServer = new remoting.LogToServer(signalStrategy, mode); |
75 | 74 |
76 /** @private */ | 75 /** @private */ |
77 this.signalStrategy_ = signalStrategy; | 76 this.signalStrategy_ = signalStrategy; |
78 base.debug.assert(this.signalStrategy_.getState() == | 77 base.debug.assert(this.signalStrategy_.getState() == |
79 remoting.SignalStrategy.State.CONNECTED); | 78 remoting.SignalStrategy.State.CONNECTED); |
80 this.signalStrategy_.setIncomingStanzaCallback( | 79 this.signalStrategy_.setIncomingStanzaCallback( |
81 this.onIncomingMessage_.bind(this)); | 80 this.onIncomingMessage_.bind(this)); |
82 remoting.formatIq.setJids(this.signalStrategy_.getJid(), host.jabberId); | 81 remoting.formatIq.setJids(this.signalStrategy_.getJid(), host.jabberId); |
83 | 82 |
84 /** | 83 /** |
85 * Allow host-offline error reporting to be suppressed in situations where it | 84 * Allow host-offline error reporting to be suppressed in situations where it |
86 * would not be useful, for example, when using a cached host JID. | 85 * would not be useful, for example, when using a cached host JID. |
87 * | 86 * |
88 * @type {boolean} @private | 87 * @type {boolean} @private |
89 */ | 88 */ |
90 this.logHostOfflineErrors_ = true; | 89 this.logHostOfflineErrors_ = true; |
91 | 90 |
92 /** @type {remoting.GnubbyAuthHandler} @private */ | 91 /** @private {remoting.GnubbyAuthHandler} */ |
93 this.gnubbyAuthHandler_ = null; | 92 this.gnubbyAuthHandler_ = null; |
94 | 93 |
95 /** @type {remoting.CastExtensionHandler} @private */ | 94 /** @private {remoting.CastExtensionHandler} */ |
96 this.castExtensionHandler_ = null; | 95 this.castExtensionHandler_ = null; |
97 | 96 |
98 this.defineEvents(Object.keys(remoting.ClientSession.Events)); | 97 this.defineEvents(Object.keys(remoting.ClientSession.Events)); |
99 }; | 98 }; |
100 | 99 |
101 base.extend(remoting.ClientSession, base.EventSourceImpl); | 100 base.extend(remoting.ClientSession, base.EventSourceImpl); |
102 | 101 |
103 /** @enum {string} */ | 102 /** @enum {string} */ |
104 remoting.ClientSession.Events = { | 103 remoting.ClientSession.Events = { |
105 stateChanged: 'stateChanged', | 104 stateChanged: 'stateChanged', |
(...skipping 660 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
766 * @param {boolean} enable True to enable rendering. | 765 * @param {boolean} enable True to enable rendering. |
767 */ | 766 */ |
768 remoting.ClientSession.prototype.enableDebugRegion = function(enable) { | 767 remoting.ClientSession.prototype.enableDebugRegion = function(enable) { |
769 if (enable) { | 768 if (enable) { |
770 this.plugin_.setDebugDirtyRegionHandler( | 769 this.plugin_.setDebugDirtyRegionHandler( |
771 this.uiHandler_.handleDebugRegion.bind(this.uiHandler_)); | 770 this.uiHandler_.handleDebugRegion.bind(this.uiHandler_)); |
772 } else { | 771 } else { |
773 this.plugin_.setDebugDirtyRegionHandler(null); | 772 this.plugin_.setDebugDirtyRegionHandler(null); |
774 } | 773 } |
775 } | 774 } |
OLD | NEW |