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

Side by Side Diff: remoting/webapp/me2mom/remoting.js

Issue 7048020: Don't use letters in me2mom access code. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Created 9 years, 7 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 | Annotate | Revision Log
« no previous file with comments | « no previous file | 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 (c) 2011 The Chromium Authors. All rights reserved. 1 // Copyright (c) 2011 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 var remoting = chrome.extension.getBackgroundPage().remoting; 5 var remoting = chrome.extension.getBackgroundPage().remoting;
6 XMPP_LOGIN_NAME = 'xmpp_login'; 6 XMPP_LOGIN_NAME = 'xmpp_login';
7 XMPP_TOKEN_NAME = 'xmpp_token'; 7 XMPP_TOKEN_NAME = 'xmpp_token';
8 OAUTH2_TOKEN_NAME = 'oauth2_token'; 8 OAUTH2_TOKEN_NAME = 'oauth2_token';
9 HOST_PLUGIN_ID = 'host_plugin_id'; 9 HOST_PLUGIN_ID = 'host_plugin_id';
10 10
(...skipping 237 matching lines...) Expand 10 before | Expand all | Expand 10 after
248 var host = JSON.parse(xhr.responseText); 248 var host = JSON.parse(xhr.responseText);
249 if (host.data && host.data.jabberId) { 249 if (host.data && host.data.jabberId) {
250 remoting.hostjid = host.data.jabberId; 250 remoting.hostjid = host.data.jabberId;
251 startSession_(); 251 startSession_();
252 return; 252 return;
253 } 253 }
254 } 254 }
255 showConnectError_(xhr.status, xhr.responseText); 255 showConnectError_(xhr.status, xhr.responseText);
256 } 256 }
257 257
258 function normalizeAccessToken(accessCode) {
Jamie 2011/05/20 01:28:21 Do we need to do this at the client? Since we do i
Jamie 2011/05/20 01:32:50 Actually, I retract that. We should only be doing
Jamie 2011/05/20 07:46:20 And while we're at it, can we remove one of 5 and
259 return accessCode.toUpperCase().replace("I", "1").replace("O", "0");
260 }
261
258 function tryConnect(form) { 262 function tryConnect(form) {
259 remoting.accessCode = form['access_code_entry'].value; 263 remoting.accessCode = normalizeAccessToken(form['access_code_entry'].value);
260 // TODO(jamiewalch): Since the mapping from (SupportId, HostSecret) to 264 // TODO(jamiewalch): Since the mapping from (SupportId, HostSecret) to
261 // AccessCode is not yet defined, assume it's hyphen-separated for now. 265 // AccessCode is not yet defined, assume it's hyphen-separated for now.
262 var parts = remoting.accessCode.split('-'); 266 var parts = remoting.accessCode.split('-');
263 if (parts.length != 2) { 267 if (parts.length != 2) {
264 showConnectError_(404); 268 showConnectError_(404);
265 } else { 269 } else {
266 setClientMode('connecting'); 270 setClientMode('connecting');
267 var urlBase = 'https://www.googleapis.com/chromoting/v1/support-hosts/'; 271 var urlBase = 'https://www.googleapis.com/chromoting/v1/support-hosts/';
268 remoting.oauth.sendSignedRequest( 272 remoting.oauth.sendSignedRequest(
269 urlBase + '' + encodeURIComponent(parts[0]) + '', 273 urlBase + encodeURIComponent(parts[0]),
270 parseServerResponse_); 274 parseServerResponse_);
271 } 275 }
272 } 276 }
273 277
274 function cancelConnect() { 278 function cancelConnect() {
275 remoting.accessCode = ''; 279 remoting.accessCode = '';
276 setClientMode('unconnected'); 280 setClientMode('unconnected');
277 } 281 }
OLDNEW
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698