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

Unified Diff: remoting/webapp/cs_oauth2_trampoline.js

Issue 23891005: Fix OAuth "trampoline" content script to send a message with the oauth results rather than using a … (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Refresh window on new refresh token Created 7 years, 3 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 side-by-side diff with in-line comments
Download patch
« no previous file with comments | « remoting/remoting.gyp ('k') | remoting/webapp/jscompiler_hacks.js » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: remoting/webapp/cs_oauth2_trampoline.js
diff --git a/remoting/webapp/cs_oauth2_trampoline.js b/remoting/webapp/cs_oauth2_trampoline.js
index efe3fa414e4fa43c98c9acc08b2cb2bdd015cfbf..0cf2327981d514d94980f0b617e1d31e1fac321d 100644
--- a/remoting/webapp/cs_oauth2_trampoline.js
+++ b/remoting/webapp/cs_oauth2_trampoline.js
@@ -13,6 +13,14 @@ var unofficialPath = '/talkgadget/oauth/chrome-remote-desktop/dev';
if (window.location.pathname == officialPath ||
window.location.pathname == unofficialPath) {
- window.location.replace(
- chrome.extension.getURL('oauth2_callback.html') + window.location.search);
+ var query = window.location.search.substring(1);
+ var parts = query.split('&');
+ var queryArgs = {};
+ for (var i = 0; i < parts.length; i++) {
+ var pair = parts[i].split('=');
+ queryArgs[decodeURIComponent(pair[0])] = decodeURIComponent(pair[1]);
+ }
+
+ chrome.extension.sendMessage(queryArgs);
+ window.close();
}
« no previous file with comments | « remoting/remoting.gyp ('k') | remoting/webapp/jscompiler_hacks.js » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698