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

Side by Side Diff: remoting/webapp/me2mom/oauth2_callback.html

Issue 7574019: Removed oauth2_callback.html, merged functionality into remoting.js and improved 'No thanks' UX. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Reverted to using an interstitial oauth2 page. Created 9 years, 4 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 <!doctype html> 1 <!doctype html>
2 <!-- 2 <!--
3 Copyright (c) 2011 The Chromium Authors. All rights reserved. 3 Copyright (c) 2011 The Chromium Authors. All rights reserved.
4 Use of this source code is governed by a BSD-style license that can be 4 Use of this source code is governed by a BSD-style license that can be
5 found in the LICENSE file. 5 found in the LICENSE file.
6 --> 6 -->
7 7
8 <html> 8 <html>
9 <head> 9 <head>
10 <script src="oauth2.js"></script> 10 <script src="oauth2.js"></script>
11 <script src="xhr.js"></script> 11 <script src="xhr.js"></script>
12 </head> 12 </head>
13 <body> 13 <body>
14 <div id="error" style="display:none;">
15 Something went wrong getting OAuth2 token.
16 </div>
17 <script> 14 <script>
18 function retrieveRefreshToken(query) { 15 function retrieveRefreshToken(query) {
19 var parts = query.split('&'); 16 var parts = query.split('&');
20 var queryArgs = {}; 17 var queryArgs = {};
21 for (var i = 0; i < parts.length; i++) { 18 for (var i = 0; i < parts.length; i++) {
22 var pair = parts[i].split('='); 19 var pair = parts[i].split('=');
23 queryArgs[pair[0]] = pair[1]; 20 queryArgs[pair[0]] = pair[1];
24 } 21 }
25 if ('code' in queryArgs) { 22 if ('code' in queryArgs) {
26 var oauth2 = new remoting.OAuth2(); 23 var oauth2 = new remoting.OAuth2();
27 oauth2.exchangeCodeForToken(queryArgs['code'], function() { 24 oauth2.exchangeCodeForToken(queryArgs['code'], function() {
28 window.location.replace(chrome.extension.getURL('choice.html')); 25 window.location.replace(chrome.extension.getURL('choice.html'));
29 }); 26 });
30 } else { 27 } else {
31 document.getElementById('error').style.display = 'block'; 28 window.location.replace(chrome.extension.getURL('choice.html'));
32 } 29 }
33 } 30 }
34 31
35 retrieveRefreshToken(window.location.search.substring(1)); 32 retrieveRefreshToken(window.location.search.substring(1));
36 </script> 33 </script>
37 </body> 34 </body>
38 </html> 35 </html>
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