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

Side by Side Diff: remoting/webapp/crd/js/session_connector_impl.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, 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
« no previous file with comments | « remoting/webapp/crd/js/remoting.js ('k') | remoting/webapp/crd/js/third_party_token_fetcher.js » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 // Copyright 2013 The Chromium Authors. All rights reserved. 1 // Copyright 2013 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 * Connect set-up state machine for Me2Me and IT2Me 7 * Connect set-up state machine for Me2Me and IT2Me
8 */ 8 */
9 9
10 'use strict'; 10 'use strict';
(...skipping 397 matching lines...) Expand 10 before | Expand all | Expand 10 after
408 * Continue an IT2Me connection once the host JID has been looked up. 408 * Continue an IT2Me connection once the host JID has been looked up.
409 * 409 *
410 * @param {XMLHttpRequest} xhr The server response to the support-hosts query. 410 * @param {XMLHttpRequest} xhr The server response to the support-hosts query.
411 * @return {void} Nothing. 411 * @return {void} Nothing.
412 * @private 412 * @private
413 */ 413 */
414 remoting.SessionConnectorImpl.prototype.onIT2MeHostInfo_ = function(xhr) { 414 remoting.SessionConnectorImpl.prototype.onIT2MeHostInfo_ = function(xhr) {
415 this.pendingXhr_ = null; 415 this.pendingXhr_ = null;
416 if (xhr.status == 200) { 416 if (xhr.status == 200) {
417 var host = /** @type {{data: {jabberId: string, publicKey: string}}} */ 417 var host = /** @type {{data: {jabberId: string, publicKey: string}}} */
418 jsonParseSafe(xhr.responseText); 418 base.jsonParseSafe(xhr.responseText);
419 if (host && host.data && host.data.jabberId && host.data.publicKey) { 419 if (host && host.data && host.data.jabberId && host.data.publicKey) {
420 this.hostJid_ = host.data.jabberId; 420 this.hostJid_ = host.data.jabberId;
421 this.hostPublicKey_ = host.data.publicKey; 421 this.hostPublicKey_ = host.data.publicKey;
422 this.hostDisplayName_ = this.hostJid_.split('/')[0]; 422 this.hostDisplayName_ = this.hostJid_.split('/')[0];
423 this.connectSignaling_(); 423 this.connectSignaling_();
424 return; 424 return;
425 } else { 425 } else {
426 console.error('Invalid "support-hosts" response from server.'); 426 console.error('Invalid "support-hosts" response from server.');
427 } 427 }
428 } else { 428 } else {
(...skipping 166 matching lines...) Expand 10 before | Expand all | Expand 10 after
595 * @param {function(remoting.Error):void} onError Callback on error. 595 * @param {function(remoting.Error):void} onError Callback on error.
596 * @param {function(string, string):boolean} onExtensionMessage The handler for 596 * @param {function(string, string):boolean} onExtensionMessage The handler for
597 * protocol extension messages. Returns true if a message is recognized; 597 * protocol extension messages. Returns true if a message is recognized;
598 * false otherwise. 598 * false otherwise.
599 */ 599 */
600 remoting.DefaultSessionConnectorFactory.prototype.createConnector = 600 remoting.DefaultSessionConnectorFactory.prototype.createConnector =
601 function(clientContainer, onConnected, onError, onExtensionMessage) { 601 function(clientContainer, onConnected, onError, onExtensionMessage) {
602 return new remoting.SessionConnectorImpl( 602 return new remoting.SessionConnectorImpl(
603 clientContainer, onConnected, onError, onExtensionMessage); 603 clientContainer, onConnected, onError, onExtensionMessage);
604 }; 604 };
OLDNEW
« no previous file with comments | « remoting/webapp/crd/js/remoting.js ('k') | remoting/webapp/crd/js/third_party_token_fetcher.js » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698