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

Unified Diff: remoting/client/appengine/static_files/client.js

Issue 7054029: Add in support for connecting with just the OAuth2 token. Default to OAuth2. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: address Jamie's comments 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 side-by-side diff with in-line comments
Download patch
« no previous file with comments | « remoting/client/appengine/static_files/chromoting_session.js ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: remoting/client/appengine/static_files/client.js
diff --git a/remoting/client/appengine/static_files/client.js b/remoting/client/appengine/static_files/client.js
index e2ed6f81f9adcb67d3a3ba23ca1c8037705205e4..d5a1acc4348766635c2197e990e68787e1f844bd 100644
--- a/remoting/client/appengine/static_files/client.js
+++ b/remoting/client/appengine/static_files/client.js
@@ -171,6 +171,23 @@ function appendHostLinks(hostlist) {
}
}
+function openSession(hostname, hostjid, method) {
+ var proxy = document.getElementById('oauth2_proxy').value;
+ var token_type = 'oauth2';
+ if (document.getElementById('use_clientlogin').checked) {
+ proxy = document.getElementById('clientlogin_proxy').value;
+ token_type = 'clientlogin';
+ }
+
+ var url = 'session?hostname=' + encodeURIComponent(hostname)
+ + '&hostjid=' + encodeURIComponent(hostjid)
+ + '&http_xmpp_proxy=' + encodeURIComponent(proxy)
+ + '&token_type=' + encodeURIComponent(token_type) +
+ '&connect_method=' + encodeURIComponent(method);
+
+ window.open(url);
+}
+
// Create a single host description element.
function addHostInfo(host) {
var hostEntry = document.createElement('div');
@@ -189,21 +206,17 @@ function addHostInfo(host) {
connect.setAttribute('type', 'button');
connect.setAttribute('value', 'Connect');
- connect.setAttribute('onclick', "window.open('session?hostname=" +
- encodeURIComponent(host.hostName) +
- "&hostjid=" + encodeURIComponent(host.jabberId) +
- "');");
+ connect.setAttribute('onclick',
+ "openSession('" + host.hostName + "', "
+ + "'" + host.jabberId + "', 'direct');");
span.appendChild(connect);
var connectSandboxed = document.createElement('input');
connectSandboxed.setAttribute('type', 'button');
connectSandboxed.setAttribute('value', 'Connect Sandboxed');
connectSandboxed.setAttribute('onclick',
- "window.open('session?hostname=" + encodeURIComponent(host.hostName) +
- "&hostjid=" + encodeURIComponent(host.jabberId) +
- "&http_xmpp_proxy=" + encodeURIComponent(
- document.getElementById('http_xmpp_proxy').value) +
- "&connect_method=sandboxed');");
+ "openSession('" + host.hostName + "', "
+ + "'" + host.jabberId + "', 'sandboxed');");
span.appendChild(connectSandboxed);
hostEntry.appendChild(span);
« no previous file with comments | « remoting/client/appengine/static_files/chromoting_session.js ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698