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

Side by Side 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 unified diff | Download patch | Annotate | Revision Log
« no previous file with comments | « remoting/remoting.gyp ('k') | remoting/webapp/jscompiler_hacks.js » ('j') | 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) 2012 The Chromium Authors. All rights reserved. 1 // Copyright (c) 2012 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 // For open-source builds, the redirect URL ends in /dev. For official builds, 5 // For open-source builds, the redirect URL ends in /dev. For official builds,
6 // it ends in /rel/{extension-id}. This distinction is handled by the manifest; 6 // it ends in /rel/{extension-id}. This distinction is handled by the manifest;
7 // all we have to do here is check the extension id in the case that there is 7 // all we have to do here is check the extension id in the case that there is
8 // one, to allow the official beta and dev channels to co-exist. 8 // one, to allow the official beta and dev channels to co-exist.
9 9
10 var extensionId = chrome.i18n.getMessage('@@extension_id'); 10 var extensionId = chrome.i18n.getMessage('@@extension_id');
11 var officialPath = '/talkgadget/oauth/chrome-remote-desktop/rel/' + extensionId; 11 var officialPath = '/talkgadget/oauth/chrome-remote-desktop/rel/' + extensionId;
12 var unofficialPath = '/talkgadget/oauth/chrome-remote-desktop/dev'; 12 var unofficialPath = '/talkgadget/oauth/chrome-remote-desktop/dev';
13 13
14 if (window.location.pathname == officialPath || 14 if (window.location.pathname == officialPath ||
15 window.location.pathname == unofficialPath) { 15 window.location.pathname == unofficialPath) {
16 window.location.replace( 16 var query = window.location.search.substring(1);
17 chrome.extension.getURL('oauth2_callback.html') + window.location.search); 17 var parts = query.split('&');
18 var queryArgs = {};
19 for (var i = 0; i < parts.length; i++) {
20 var pair = parts[i].split('=');
21 queryArgs[decodeURIComponent(pair[0])] = decodeURIComponent(pair[1]);
22 }
23
24 chrome.extension.sendMessage(queryArgs);
25 window.close();
18 } 26 }
OLDNEW
« 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