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

Unified Diff: remoting/android/java/src/org/chromium/chromoting/SessionConnector.java

Issue 981783003: Pull authentication UX code out of JniInterface (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@fix-jni-initialization
Patch Set: Fix comment Created 5 years, 9 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
Index: remoting/android/java/src/org/chromium/chromoting/SessionConnector.java
diff --git a/remoting/android/java/src/org/chromium/chromoting/SessionConnector.java b/remoting/android/java/src/org/chromium/chromoting/SessionConnector.java
index 20fad2595a3481a1cc3a02e4b30a4f6d8e7eede9..cb57a210df4dac82d37d3b91c332343bbd3374dc 100644
--- a/remoting/android/java/src/org/chromium/chromoting/SessionConnector.java
+++ b/remoting/android/java/src/org/chromium/chromoting/SessionConnector.java
@@ -15,6 +15,7 @@ public class SessionConnector implements JniInterface.ConnectionListener,
private JniInterface.ConnectionListener mConnectionCallback;
private HostListLoader.Callback mHostListCallback;
private HostListLoader mHostListLoader;
+ private SessionAuthenticator mAuthenticator;
private String mAccountName;
private String mAuthToken;
@@ -43,11 +44,13 @@ public class SessionConnector implements JniInterface.ConnectionListener,
}
/** Initiates a connection to the host. */
- public void connectToHost(String accountName, String authToken, HostInfo host) {
+ public void connectToHost(String accountName, String authToken, HostInfo host,
+ SessionAuthenticator authenticator) {
mAccountName = accountName;
mAuthToken = authToken;
mHostId = host.id;
mHostJabberId = host.jabberId;
+ mAuthenticator = authenticator;
if (hostIncomplete(host)) {
// These keys might not be present in a newly-registered host, so treat this as a
@@ -57,7 +60,7 @@ public class SessionConnector implements JniInterface.ConnectionListener,
}
JniInterface.connectToHost(accountName, authToken, host.jabberId, host.id, host.publicKey,
- this);
+ this, mAuthenticator);
}
private static boolean hostIncomplete(HostInfo host) {
@@ -108,7 +111,7 @@ public class SessionConnector implements JniInterface.ConnectionListener,
// Reconnect to the host, but use the original callback directly, instead of this
// wrapper object, so the host list is not loaded again.
JniInterface.connectToHost(mAccountName, mAuthToken, foundHost.jabberId,
- foundHost.id, foundHost.publicKey, mConnectionCallback);
+ foundHost.id, foundHost.publicKey, mConnectionCallback, mAuthenticator);
}
}

Powered by Google App Engine
This is Rietveld 408576698