| 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 'use strict'; | 5 'use strict'; |
| 6 | 6 |
| 7 /** @suppress {duplicate} */ | 7 /** @suppress {duplicate} */ |
| 8 var remoting = remoting || {}; | 8 var remoting = remoting || {}; |
| 9 | 9 |
| 10 /** @constructor */ | 10 /** @constructor */ |
| 11 remoting.HostController = function() { | 11 remoting.HostController = function() { |
| 12 /** @type {remoting.HostPlugin} @private */ | 12 /** @type {remoting.HostPlugin} @private */ |
| 13 this.plugin_ = remoting.HostSession.createPlugin(); | 13 this.plugin_ = remoting.HostSession.createPlugin(); |
| 14 /** @type {HTMLElement} @private */ | 14 /** @type {HTMLElement} @private */ |
| 15 this.container_ = document.getElementById('daemon-plugin-container'); | 15 this.container_ = document.getElementById('daemon-plugin-container'); |
| 16 this.container_.appendChild(this.plugin_); | 16 this.container_.appendChild(this.plugin_); |
| 17 /** @type {remoting.Host?} */ | 17 /** @type {remoting.Host?} */ |
| 18 this.localHost = null; | 18 this.localHost = null; |
| 19 /** @param {string} version */ | 19 /** @param {string} version */ |
| 20 var printVersion = function(version) { | 20 var printVersion = function(version) { |
| 21 if (version == '') { | 21 if (version == '') { |
| 22 console.log('Host not installed.'); | 22 console.log('Host not installed.'); |
| 23 } else { | 23 } else { |
| 24 console.log('Host version:', version); | 24 console.log('Host version: ' + version); |
| 25 } | 25 } |
| 26 }; | 26 }; |
| 27 try { | 27 try { |
| 28 this.plugin_.getDaemonVersion(printVersion); | 28 this.plugin_.getDaemonVersion(printVersion); |
| 29 } catch (err) { | 29 } catch (err) { |
| 30 console.log('Host version not available.'); | 30 console.log('Host version not available.'); |
| 31 } | 31 } |
| 32 }; | 32 }; |
| 33 | 33 |
| 34 // Note that the values in the enums below are copied from | 34 // Note that the values in the enums below are copied from |
| (...skipping 338 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 373 try { | 373 try { |
| 374 this.plugin_.getDaemonConfig(onConfig); | 374 this.plugin_.getDaemonConfig(onConfig); |
| 375 } catch (err) { | 375 } catch (err) { |
| 376 this.setHost(null); | 376 this.setHost(null); |
| 377 onDone(); | 377 onDone(); |
| 378 } | 378 } |
| 379 }; | 379 }; |
| 380 | 380 |
| 381 /** @type {remoting.HostController} */ | 381 /** @type {remoting.HostController} */ |
| 382 remoting.hostController = null; | 382 remoting.hostController = null; |
| OLD | NEW |