Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(326)

Side by Side Diff: remoting/webapp/host_controller.js

Issue 10332234: If getDaemonVersion() fails then log that the host version is not available. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Created 8 years, 7 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch | Annotate | Revision Log
« no previous file with comments | « no previous file | no next file » | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
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 this.plugin_.getDaemonVersion(printVersion); 27 try {
28 this.plugin_.getDaemonVersion(printVersion);
29 } catch (err) {
30 console.log('Host version not available.');
Jamie 2012/05/18 01:13:35 Optional: I think I'd just call printVersion('')
31 }
28 }; 32 };
29 33
30 // Note that the values in the enums below are copied from 34 // Note that the values in the enums below are copied from
31 // daemon_controller.h and must be kept in sync. 35 // daemon_controller.h and must be kept in sync.
32 /** @enum {number} */ 36 /** @enum {number} */
33 remoting.HostController.State = { 37 remoting.HostController.State = {
34 NOT_IMPLEMENTED: -1, 38 NOT_IMPLEMENTED: -1,
35 NOT_INSTALLED: 0, 39 NOT_INSTALLED: 0,
36 INSTALLING: 1, 40 INSTALLING: 1,
37 STOPPED: 2, 41 STOPPED: 2,
(...skipping 319 matching lines...) Expand 10 before | Expand all | Expand 10 after
357 try { 361 try {
358 this.plugin_.getDaemonConfig(onConfig); 362 this.plugin_.getDaemonConfig(onConfig);
359 } catch (err) { 363 } catch (err) {
360 this.setHost(null); 364 this.setHost(null);
361 onDone(); 365 onDone();
362 } 366 }
363 }; 367 };
364 368
365 /** @type {remoting.HostController} */ 369 /** @type {remoting.HostController} */
366 remoting.hostController = null; 370 remoting.hostController = null;
OLDNEW
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698