OLD | NEW |
1 // Copyright 2015 The Chromium Authors. All rights reserved. | 1 // Copyright 2015 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 /** @suppress {duplicate} */ | 5 /** @suppress {duplicate} */ |
6 var remoting = remoting || {}; | 6 var remoting = remoting || {}; |
7 | 7 |
8 (function() { | 8 (function() { |
9 | 9 |
10 'use strict'; | 10 'use strict'; |
(...skipping 29 matching lines...) Expand all Loading... |
40 * @param {boolean=} opt_suppressOfflineError | 40 * @param {boolean=} opt_suppressOfflineError |
41 * @return {void} Nothing. | 41 * @return {void} Nothing. |
42 */ | 42 */ |
43 remoting.DesktopRemotingActivity.prototype.start = | 43 remoting.DesktopRemotingActivity.prototype.start = |
44 function(host, credentialsProvider, opt_suppressOfflineError) { | 44 function(host, credentialsProvider, opt_suppressOfflineError) { |
45 var that = this; | 45 var that = this; |
46 this.sessionFactory_.createSession(this).then( | 46 this.sessionFactory_.createSession(this).then( |
47 function(/** remoting.ClientSession */ session) { | 47 function(/** remoting.ClientSession */ session) { |
48 that.session_ = session; | 48 that.session_ = session; |
49 session.logHostOfflineErrors(!opt_suppressOfflineError); | 49 session.logHostOfflineErrors(!opt_suppressOfflineError); |
| 50 session.getLogger().setHostVersion(host.hostVersion); |
50 session.connect(host, credentialsProvider); | 51 session.connect(host, credentialsProvider); |
51 }); | 52 }); |
52 }; | 53 }; |
53 | 54 |
54 remoting.DesktopRemotingActivity.prototype.stop = function() { | 55 remoting.DesktopRemotingActivity.prototype.stop = function() { |
55 if (this.session_) { | 56 if (this.session_) { |
56 this.session_.disconnect(remoting.Error.none()); | 57 this.session_.disconnect(remoting.Error.none()); |
57 console.log('Disconnected.'); | 58 console.log('Disconnected.'); |
58 } | 59 } |
59 }; | 60 }; |
(...skipping 71 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
131 }; | 132 }; |
132 | 133 |
133 /** | 134 /** |
134 * @return {remoting.ClientSession}. | 135 * @return {remoting.ClientSession}. |
135 */ | 136 */ |
136 remoting.DesktopRemotingActivity.prototype.getSession = function() { | 137 remoting.DesktopRemotingActivity.prototype.getSession = function() { |
137 return this.session_; | 138 return this.session_; |
138 }; | 139 }; |
139 | 140 |
140 })(); | 141 })(); |
OLD | NEW |