| OLD | NEW |
| (Empty) |
| 1 <!doctype html> | |
| 2 <!-- | |
| 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 | |
| 5 found in the LICENSE file. | |
| 6 --> | |
| 7 | |
| 8 <html> | |
| 9 <head> | |
| 10 <script src="oauth2.js"></script> | |
| 11 <script src="xhr.js"></script> | |
| 12 </head> | |
| 13 <body> | |
| 14 <script> | |
| 15 function retrieveRefreshToken(query) { | |
| 16 var parts = query.split('&'); | |
| 17 var queryArgs = {}; | |
| 18 for (var i = 0; i < parts.length; i++) { | |
| 19 var pair = parts[i].split('='); | |
| 20 queryArgs[pair[0]] = pair[1]; | |
| 21 } | |
| 22 if ('code' in queryArgs) { | |
| 23 var oauth2 = new remoting.OAuth2(); | |
| 24 oauth2.exchangeCodeForToken(queryArgs['code'], function() { | |
| 25 window.location.replace(chrome.extension.getURL('choice.html')); | |
| 26 }); | |
| 27 } else { | |
| 28 window.location.replace(chrome.extension.getURL('choice.html')); | |
| 29 } | |
| 30 } | |
| 31 | |
| 32 retrieveRefreshToken(window.location.search.substring(1)); | |
| 33 </script> | |
| 34 </body> | |
| 35 </html> | |
| OLD | NEW |