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 /** @return {remoting.HostPlugin} */ | 12 /** @return {remoting.HostPlugin} */ |
13 var createPluginForMe2Me = function() { | 13 var createPluginForMe2Me = function() { |
14 var plugin = remoting.HostSession.createPlugin(); | 14 var plugin = remoting.HostSession.createPlugin(); |
15 /** @type {HTMLElement} @private */ | 15 /** @type {HTMLElement} @private */ |
16 var container = document.getElementById('daemon-plugin-container'); | 16 var container = document.getElementById('daemon-plugin-container'); |
17 container.appendChild(plugin); | 17 container.appendChild(plugin); |
18 if (plugin.getDaemonState === undefined) { | |
weitao
2014/01/31 18:37:11
Remoting.js uses a different way of detecting the
Sergey Ulanov
2014/01/31 23:34:17
It's essentially the same, except we are using dif
| |
19 container.removeChild(plugin); | |
20 return null; | |
21 } | |
18 return plugin; | 22 return plugin; |
19 }; | 23 }; |
20 | 24 |
21 /** @type {remoting.HostDispatcher} @private */ | 25 /** @type {remoting.HostDispatcher} @private */ |
22 this.hostDispatcher_ = new remoting.HostDispatcher(createPluginForMe2Me); | 26 this.hostDispatcher_ = new remoting.HostDispatcher(createPluginForMe2Me); |
23 | 27 |
24 /** @param {string} version */ | 28 /** @param {string} version */ |
25 var printVersion = function(version) { | 29 var printVersion = function(version) { |
26 if (version == '') { | 30 if (version == '') { |
27 console.log('Host not installed.'); | 31 console.log('Host not installed.'); |
(...skipping 439 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
467 * @param {function(remoting.Error):void} onError Error callback. | 471 * @param {function(remoting.Error):void} onError Error callback. |
468 * @return {void} | 472 * @return {void} |
469 */ | 473 */ |
470 remoting.HostController.prototype.clearPairedClients = function( | 474 remoting.HostController.prototype.clearPairedClients = function( |
471 onDone, onError) { | 475 onDone, onError) { |
472 this.hostDispatcher_.clearPairedClients(onDone, onError); | 476 this.hostDispatcher_.clearPairedClients(onDone, onError); |
473 }; | 477 }; |
474 | 478 |
475 /** @type {remoting.HostController} */ | 479 /** @type {remoting.HostController} */ |
476 remoting.hostController = null; | 480 remoting.hostController = null; |
OLD | NEW |