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

Unified 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: Move jsonParseSafe into base namespace. Created 6 years, 2 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 side-by-side diff with in-line comments
Download patch
« no previous file with comments | « remoting/webapp/crd/js/host_controller.js ('k') | remoting/webapp/crd/js/host_settings.js » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: remoting/webapp/crd/js/host_list.js
diff --git a/remoting/webapp/crd/js/host_list.js b/remoting/webapp/crd/js/host_list.js
index ce7c18ecd3e7c28b2e55a0973ffcd4e01a6b5215..aa5f1fc1b4eebaaa47f6ed63598d9e7631e51a55 100644
--- a/remoting/webapp/crd/js/host_list.js
+++ b/remoting/webapp/crd/js/host_list.js
@@ -114,7 +114,7 @@ remoting.HostList.prototype.load = function(onDone) {
/** @param {Object.<string>} items */
var storeHostList = function(items) {
if (items[remoting.HostList.HOSTS_KEY]) {
- var cached = jsonParseSafe(items[remoting.HostList.HOSTS_KEY]);
+ var cached = base.jsonParseSafe(items[remoting.HostList.HOSTS_KEY]);
if (cached) {
that.hosts_ = /** @type {Array} */ cached;
} else {
@@ -198,8 +198,8 @@ remoting.HostList.prototype.parseHostListResponse_ = function(onDone, xhr) {
this.lastError_ = '';
try {
if (xhr.status == 200) {
- var response =
- /** @type {{data: {items: Array}}} */ jsonParseSafe(xhr.responseText);
+ var response = /** @type {{data: {items: Array}}} */
+ (base.jsonParseSafe(xhr.responseText));
if (response && response.data) {
if (response.data.items) {
this.hosts_ = response.data.items;
@@ -497,7 +497,9 @@ remoting.HostList.prototype.onLocalHostStarted = function(
*/
remoting.HostList.prototype.onErrorClick_ = function() {
if (this.lastError_ == remoting.Error.AUTHENTICATION_FAILED) {
- remoting.oauth2.doAuthRedirect();
+ remoting.oauth2.doAuthRedirect(function() {
+ window.location.reload();
+ });
} else {
this.refresh(remoting.updateLocalHostState);
}
« no previous file with comments | « remoting/webapp/crd/js/host_controller.js ('k') | remoting/webapp/crd/js/host_settings.js » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698