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

Side by Side Diff: remoting/webapp/app_remoting/js/feedback_consent.js

Issue 907203002: Switch feedback consent dialog to use oauth2_api_impl. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 5 years, 10 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 unified diff | Download patch
« no previous file with comments | « remoting/webapp/app_remoting/html/feedback_consent.html ('k') | no next file » | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 // Copyright 2014 The Chromium Authors. All rights reserved. 1 // Copyright 2014 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 'use strict'; 5 'use strict';
6 6
7 /** 7 /**
8 * @type {string} The host id corresponding to the user's VM. The @pending 8 * @type {string} The host id corresponding to the user's VM. The @pending
9 * place-holder instructs the Orchestrator to abandon any pending host, 9 * place-holder instructs the Orchestrator to abandon any pending host,
10 * and is used if no host id is provided by the main window. 10 * and is used if no host id is provided by the main window.
(...skipping 93 matching lines...) Expand 10 before | Expand all | Expand 10 after
104 var idArray = new Uint8Array(20); 104 var idArray = new Uint8Array(20);
105 crypto.getRandomValues(idArray); 105 crypto.getRandomValues(idArray);
106 return btoa(String.fromCharCode.apply(null, idArray)); 106 return btoa(String.fromCharCode.apply(null, idArray));
107 } 107 }
108 108
109 /** 109 /**
110 * @param {string} token 110 * @param {string} token
111 */ 111 */
112 function onToken(token) { 112 function onToken(token) {
113 var getUserInfo = function() { 113 var getUserInfo = function() {
114 remoting.OAuth2Api.getUserInfo( 114 var oauth2Api = new remoting.OAuth2ApiImpl();
115 oauth2Api.getUserInfo(
115 onUserInfo, onUserInfo.bind(null, 'unknown', 'unknown'), token); 116 onUserInfo, onUserInfo.bind(null, 'unknown', 'unknown'), token);
116 }; 117 };
117 if (!token) { 118 if (!token) {
118 onUserInfo('unknown', 'unknown'); 119 onUserInfo('unknown', 'unknown');
119 } else { 120 } else {
120 if (abandonHost == 'yes') { 121 if (abandonHost == 'yes') {
121 var body = { 122 var body = {
122 'abandonHost': 'true', 123 'abandonHost': 'true',
123 'crashServiceReportId': crashServiceReportId 124 'crashServiceReportId': crashServiceReportId
124 }; 125 };
(...skipping 95 matching lines...) Expand 10 before | Expand all | Expand 10 after
220 var method = /** @type {string} */ (event.data['method']); 221 var method = /** @type {string} */ (event.data['method']);
221 if (method == 'init') { 222 if (method == 'init') {
222 if (event.data['hostId']) { 223 if (event.data['hostId']) {
223 hostId = /** @type {string} */ (event.data['hostId']); 224 hostId = /** @type {string} */ (event.data['hostId']);
224 } 225 }
225 connectionStats = /** @type {string} */ (event.data['connectionStats']); 226 connectionStats = /** @type {string} */ (event.data['connectionStats']);
226 } 227 }
227 }; 228 };
228 229
229 window.addEventListener('load', onLoad, false); 230 window.addEventListener('load', onLoad, false);
OLDNEW
« no previous file with comments | « remoting/webapp/app_remoting/html/feedback_consent.html ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698