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 288 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
299 | 299 |
300 // The local host cannot be stopped or started if the host controller is not | 300 // The local host cannot be stopped or started if the host controller is not |
301 // implemented for this platform. Additionally, it cannot be started if there | 301 // implemented for this platform. Additionally, it cannot be started if there |
302 // is an error (in many error states, the start operation will fail anyway, | 302 // is an error (in many error states, the start operation will fail anyway, |
303 // but even if it succeeds, the chance of a related but hard-to-diagnose | 303 // but even if it succeeds, the chance of a related but hard-to-diagnose |
304 // future error is high). | 304 // future error is high). |
305 var state = this.localHostState_; | 305 var state = this.localHostState_; |
306 var enabled = (state == remoting.HostController.State.STARTING) || | 306 var enabled = (state == remoting.HostController.State.STARTING) || |
307 (state == remoting.HostController.State.STARTED); | 307 (state == remoting.HostController.State.STARTED); |
308 var canChangeLocalHostState = | 308 var canChangeLocalHostState = |
309 (state != remoting.HostController.State.NOT_IMPLEMENTED) && | 309 (state != remoting.HostController.State.NOT_IMPLEMENTED && |
310 state != remoting.HostController.State.UNKNOWN) && | |
Sergey Ulanov
2014/02/12 01:35:35
This is not essential for this change, but is requ
| |
310 (enabled || this.lastError_ == ''); | 311 (enabled || this.lastError_ == ''); |
311 | 312 |
312 remoting.updateModalUi(enabled ? 'enabled' : 'disabled', 'data-daemon-state'); | 313 remoting.updateModalUi(enabled ? 'enabled' : 'disabled', 'data-daemon-state'); |
313 var element = document.getElementById('daemon-control'); | 314 var element = document.getElementById('daemon-control'); |
314 element.hidden = !canChangeLocalHostState; | 315 element.hidden = !canChangeLocalHostState; |
315 element = document.getElementById('host-list-empty-hosting-supported'); | 316 element = document.getElementById('host-list-empty-hosting-supported'); |
316 element.hidden = !canChangeLocalHostState; | 317 element.hidden = !canChangeLocalHostState; |
317 element = document.getElementById('host-list-empty-hosting-unsupported'); | 318 element = document.getElementById('host-list-empty-hosting-unsupported'); |
318 element.hidden = canChangeLocalHostState; | 319 element.hidden = canChangeLocalHostState; |
319 }; | 320 }; |
(...skipping 190 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
510 chrome.storage.local.set(items); | 511 chrome.storage.local.set(items); |
511 }; | 512 }; |
512 | 513 |
513 /** | 514 /** |
514 * Key name under which Me2Me hosts are cached. | 515 * Key name under which Me2Me hosts are cached. |
515 */ | 516 */ |
516 remoting.HostList.HOSTS_KEY = 'me2me-cached-hosts'; | 517 remoting.HostList.HOSTS_KEY = 'me2me-cached-hosts'; |
517 | 518 |
518 /** @type {remoting.HostList} */ | 519 /** @type {remoting.HostList} */ |
519 remoting.hostList = null; | 520 remoting.hostList = null; |
OLD | NEW |