| 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 37 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 48 return that.host_.options.load(); | 48 return that.host_.options.load(); |
| 49 }).then(function() { | 49 }).then(function() { |
| 50 that.connect_(true); | 50 that.connect_(true); |
| 51 }).catch(function(/** remoting.Error */ error) { | 51 }).catch(function(/** remoting.Error */ error) { |
| 52 if (error.hasTag(remoting.Error.Tag.CANCELLED)) { | 52 if (error.hasTag(remoting.Error.Tag.CANCELLED)) { |
| 53 remoting.setMode(remoting.AppMode.HOME); | 53 remoting.setMode(remoting.AppMode.HOME); |
| 54 } | 54 } |
| 55 }); | 55 }); |
| 56 }; | 56 }; |
| 57 | 57 |
| 58 remoting.Me2MeActivity.prototype.stop = function() { |
| 59 this.desktopActivity_.stop(); |
| 60 }; |
| 61 |
| 58 /** @return {remoting.DesktopRemotingActivity} */ | 62 /** @return {remoting.DesktopRemotingActivity} */ |
| 59 remoting.Me2MeActivity.prototype.getDesktopActivity = function() { | 63 remoting.Me2MeActivity.prototype.getDesktopActivity = function() { |
| 60 return this.desktopActivity_; | 64 return this.desktopActivity_; |
| 61 }; | 65 }; |
| 62 | 66 |
| 63 /** | 67 /** |
| 64 * @param {boolean} suppressHostOfflineError | 68 * @param {boolean} suppressHostOfflineError |
| 65 * @private | 69 * @private |
| 66 */ | 70 */ |
| 67 remoting.Me2MeActivity.prototype.connect_ = function(suppressHostOfflineError) { | 71 remoting.Me2MeActivity.prototype.connect_ = function(suppressHostOfflineError) { |
| (...skipping 89 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 157 var plugin = connectionInfo.plugin(); | 161 var plugin = connectionInfo.plugin(); |
| 158 var session = connectionInfo.session(); | 162 var session = connectionInfo.session(); |
| 159 if (session.hasCapability(remoting.ClientSession.Capability.CAST)) { | 163 if (session.hasCapability(remoting.ClientSession.Capability.CAST)) { |
| 160 plugin.extensions().register(new remoting.CastExtensionHandler()); | 164 plugin.extensions().register(new remoting.CastExtensionHandler()); |
| 161 } | 165 } |
| 162 plugin.extensions().register(new remoting.GnubbyAuthHandler()); | 166 plugin.extensions().register(new remoting.GnubbyAuthHandler()); |
| 163 this.pinDialog_.requestPairingIfNecessary(connectionInfo.plugin()); | 167 this.pinDialog_.requestPairingIfNecessary(connectionInfo.plugin()); |
| 164 | 168 |
| 165 base.dispose(this.reconnector_); | 169 base.dispose(this.reconnector_); |
| 166 this.reconnector_ = new remoting.SmartReconnector( | 170 this.reconnector_ = new remoting.SmartReconnector( |
| 167 this.connect_.bind(this, false), connectionInfo.session()); | 171 this.connect_.bind(this, false), |
| 172 this.stop.bind(this), |
| 173 connectionInfo.session()); |
| 168 }; | 174 }; |
| 169 | 175 |
| 170 remoting.Me2MeActivity.prototype.onDisconnected = function() { | 176 remoting.Me2MeActivity.prototype.onDisconnected = function() { |
| 171 this.showFinishDialog_(remoting.AppMode.CLIENT_SESSION_FINISHED_ME2ME); | 177 this.showFinishDialog_(remoting.AppMode.CLIENT_SESSION_FINISHED_ME2ME); |
| 172 }; | 178 }; |
| 173 | 179 |
| 174 /** | 180 /** |
| 175 * @param {!remoting.Error} error | 181 * @param {!remoting.Error} error |
| 176 */ | 182 */ |
| 177 remoting.Me2MeActivity.prototype.onError = function(error) { | 183 remoting.Me2MeActivity.prototype.onError = function(error) { |
| (...skipping 135 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 313 clientName = 'Linux'; | 319 clientName = 'Linux'; |
| 314 } else { | 320 } else { |
| 315 console.log('Unrecognized client platform. Using navigator.platform.'); | 321 console.log('Unrecognized client platform. Using navigator.platform.'); |
| 316 clientName = navigator.platform; | 322 clientName = navigator.platform; |
| 317 } | 323 } |
| 318 plugin.requestPairing(clientName, onPairingComplete); | 324 plugin.requestPairing(clientName, onPairingComplete); |
| 319 } | 325 } |
| 320 }; | 326 }; |
| 321 | 327 |
| 322 })(); | 328 })(); |
| OLD | NEW |