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 479 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
490 }; | 490 }; |
491 | 491 |
492 /** | 492 /** |
493 * Called when the user clicks the button next to the error message. The action | 493 * Called when the user clicks the button next to the error message. The action |
494 * depends on the error. | 494 * depends on the error. |
495 * | 495 * |
496 * @private | 496 * @private |
497 */ | 497 */ |
498 remoting.HostList.prototype.onErrorClick_ = function() { | 498 remoting.HostList.prototype.onErrorClick_ = function() { |
499 if (this.lastError_ == remoting.Error.AUTHENTICATION_FAILED) { | 499 if (this.lastError_ == remoting.Error.AUTHENTICATION_FAILED) { |
500 remoting.oauth2.doAuthRedirect(); | 500 remoting.oauth2.doAuthRedirect(function() { |
| 501 window.location.reload(); |
| 502 }); |
501 } else { | 503 } else { |
502 this.refresh(remoting.updateLocalHostState); | 504 this.refresh(remoting.updateLocalHostState); |
503 } | 505 } |
504 }; | 506 }; |
505 | 507 |
506 /** | 508 /** |
507 * Save the host list to local storage. | 509 * Save the host list to local storage. |
508 */ | 510 */ |
509 remoting.HostList.prototype.save_ = function() { | 511 remoting.HostList.prototype.save_ = function() { |
510 var items = {}; | 512 var items = {}; |
511 items[remoting.HostList.HOSTS_KEY] = JSON.stringify(this.hosts_); | 513 items[remoting.HostList.HOSTS_KEY] = JSON.stringify(this.hosts_); |
512 chrome.storage.local.set(items); | 514 chrome.storage.local.set(items); |
513 }; | 515 }; |
514 | 516 |
515 /** | 517 /** |
516 * Key name under which Me2Me hosts are cached. | 518 * Key name under which Me2Me hosts are cached. |
517 */ | 519 */ |
518 remoting.HostList.HOSTS_KEY = 'me2me-cached-hosts'; | 520 remoting.HostList.HOSTS_KEY = 'me2me-cached-hosts'; |
519 | 521 |
520 /** @type {remoting.HostList} */ | 522 /** @type {remoting.HostList} */ |
521 remoting.hostList = null; | 523 remoting.hostList = null; |
OLD | NEW |