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

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

Issue 105943010: Android Chromoting - Close the Desktop view on disconnection (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Created 7 years 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/Chromoting.java
diff --git a/remoting/android/java/src/org/chromium/chromoting/Chromoting.java b/remoting/android/java/src/org/chromium/chromoting/Chromoting.java
index 264d8a2eab9e55ecc6636b4da0897c5ddec2d0aa..a9844190dd258ff3070f90aa370d51e4a3bb94a5 100644
--- a/remoting/android/java/src/org/chromium/chromoting/Chromoting.java
+++ b/remoting/android/java/src/org/chromium/chromoting/Chromoting.java
@@ -38,7 +38,7 @@ import java.util.Scanner;
* The user interface for querying and displaying a user's host list from the directory server. It
* also requests and renews authentication tokens using the system account manager.
*/
-public class Chromoting extends Activity {
+public class Chromoting extends Activity implements JniInterface.ConnectionListener {
/** Only accounts of this type will be selectable for authentication. */
private static final String ACCOUNT_TYPE = "com.google";
@@ -187,13 +187,7 @@ public class Chromoting extends Activity {
try {
synchronized (mLock) {
JniInterface.connectToHost(mAccount.name, mToken, host.getString("jabberId"),
- host.getString("hostId"), host.getString("publicKey"),
- new Runnable() {
- @Override
- public void run() {
- startActivity(new Intent(Chromoting.this, Desktop.class));
- }
- });
+ host.getString("hostId"), host.getString("publicKey"), this);
}
} catch (JSONException ex) {
Log.w("host", ex);
@@ -360,4 +354,14 @@ public class Chromoting extends Activity {
finish();
}
}
+
+ @Override
+ public void onConnected() {
+ startActivityForResult(new Intent(Chromoting.this, Desktop.class), 0);
+ }
+
+ @Override
+ public void onDisconnected() {
+ finishActivity(0);
+ }
}

Powered by Google App Engine
This is Rietveld 408576698