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 /** | 5 /** |
6 * @fileoverview | 6 * @fileoverview |
7 * Class representing the host-list portion of the home screen UI. | 7 * Class representing the host-list portion of the home screen UI. |
8 */ | 8 */ |
9 | 9 |
10 'use strict'; | 10 'use strict'; |
(...skipping 30 matching lines...) Expand all Loading... |
41 this.errorMsg_ = errorMsg; | 41 this.errorMsg_ = errorMsg; |
42 /** @private {Element} */ | 42 /** @private {Element} */ |
43 this.errorButton_ = errorButton; | 43 this.errorButton_ = errorButton; |
44 /** @private {HTMLElement} */ | 44 /** @private {HTMLElement} */ |
45 this.loadingIndicator_ = loadingIndicator; | 45 this.loadingIndicator_ = loadingIndicator; |
46 /** @private {Array<remoting.HostTableEntry>} */ | 46 /** @private {Array<remoting.HostTableEntry>} */ |
47 this.hostTableEntries_ = []; | 47 this.hostTableEntries_ = []; |
48 /** @private {Array<remoting.Host>} */ | 48 /** @private {Array<remoting.Host>} */ |
49 this.hosts_ = []; | 49 this.hosts_ = []; |
50 /** @private {!remoting.Error} */ | 50 /** @private {!remoting.Error} */ |
51 this.lastError_ = remoting.Error.NONE; | 51 this.lastError_ = remoting.Error.none(); |
52 /** @private {remoting.LocalHostSection} */ | 52 /** @private {remoting.LocalHostSection} */ |
53 this.localHostSection_ = new remoting.LocalHostSection( | 53 this.localHostSection_ = new remoting.LocalHostSection( |
54 /** @type {HTMLElement} */ (document.querySelector('.daemon-control')), | 54 /** @type {HTMLElement} */ (document.querySelector('.daemon-control')), |
55 new remoting.LocalHostSection.Controller( | 55 new remoting.LocalHostSection.Controller( |
56 this, new remoting.HostSetupDialog(remoting.hostController))); | 56 this, new remoting.HostSetupDialog(remoting.hostController))); |
57 | 57 |
58 /** @private {number} */ | 58 /** @private {number} */ |
59 this.webappMajorVersion_ = parseInt(chrome.runtime.getManifest().version, 10); | 59 this.webappMajorVersion_ = parseInt(chrome.runtime.getManifest().version, 10); |
60 | 60 |
61 this.errorButton_.addEventListener('click', | 61 this.errorButton_.addEventListener('click', |
(...skipping 88 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
150 * Handle the results of the host list request. A success response will | 150 * Handle the results of the host list request. A success response will |
151 * include a JSON-encoded list of host descriptions, which we display if we're | 151 * include a JSON-encoded list of host descriptions, which we display if we're |
152 * able to successfully parse it. | 152 * able to successfully parse it. |
153 * | 153 * |
154 * @param {function(boolean):void} onDone The callback passed to |refresh|. | 154 * @param {function(boolean):void} onDone The callback passed to |refresh|. |
155 * @param {Array<remoting.Host>} hosts The list of hosts for the user. | 155 * @param {Array<remoting.Host>} hosts The list of hosts for the user. |
156 * @return {void} Nothing. | 156 * @return {void} Nothing. |
157 * @private | 157 * @private |
158 */ | 158 */ |
159 remoting.HostList.prototype.onHostListResponse_ = function(onDone, hosts) { | 159 remoting.HostList.prototype.onHostListResponse_ = function(onDone, hosts) { |
160 this.lastError_ = remoting.Error.NONE; | 160 this.lastError_ = remoting.Error.none(); |
161 this.hosts_ = hosts; | 161 this.hosts_ = hosts; |
162 this.sortHosts_(); | 162 this.sortHosts_(); |
163 this.save_(); | 163 this.save_(); |
164 this.loadingIndicator_.classList.remove('loading'); | 164 this.loadingIndicator_.classList.remove('loading'); |
165 onDone(true); | 165 onDone(true); |
166 }; | 166 }; |
167 | 167 |
168 /** | 168 /** |
169 * Sort the internal list of hosts. | 169 * Sort the internal list of hosts. |
170 * | 170 * |
(...skipping 244 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
415 } | 415 } |
416 }; | 416 }; |
417 | 417 |
418 /** | 418 /** |
419 * Key name under which Me2Me hosts are cached. | 419 * Key name under which Me2Me hosts are cached. |
420 */ | 420 */ |
421 remoting.HostList.HOSTS_KEY = 'me2me-cached-hosts'; | 421 remoting.HostList.HOSTS_KEY = 'me2me-cached-hosts'; |
422 | 422 |
423 /** @type {remoting.HostList} */ | 423 /** @type {remoting.HostList} */ |
424 remoting.hostList = null; | 424 remoting.hostList = null; |
OLD | NEW |