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

Side by Side Diff: remoting/webapp/crd/js/host_list.js

Issue 687873003: Allow the background page to get an OAuth token for apps v1. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 6 years, 1 month 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
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 /** 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
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;
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698