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

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

Issue 187313007: Reimplemented string array resources. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Rebase Created 6 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
« no previous file with comments | « no previous file | remoting/android/java/src/org/chromium/chromoting/jni/JniInterface.java » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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 1abc5b8f3b447897cd6821625f5bbb2979c53171..8a8f74c74c55a433a83391cc3e70ddc6bf1241c1 100644
--- a/remoting/android/java/src/org/chromium/chromoting/Chromoting.java
+++ b/remoting/android/java/src/org/chromium/chromoting/Chromoting.java
@@ -224,6 +224,14 @@ public class Chromoting extends Activity implements JniInterface.ConnectionListe
/** Called when the user taps on a host entry. */
public void connectToHost(HostInfo host) {
+ mProgressIndicator = ProgressDialog.show(this,
+ host.name, getString(R.string.footer_connecting), true, true,
+ new DialogInterface.OnCancelListener() {
+ @Override
+ public void onCancel(DialogInterface dialog) {
+ JniInterface.disconnectFromHost();
+ }
+ });
SessionConnector connector = new SessionConnector(this, this, mHostListLoader);
connector.connectToHost(mAccount.name, mToken, host);
}
@@ -360,41 +368,23 @@ public class Chromoting extends Activity implements JniInterface.ConnectionListe
@Override
public void onConnectionState(JniInterface.ConnectionListener.State state,
JniInterface.ConnectionListener.Error error) {
- String stateText = getResources().getStringArray(R.array.protoc_states)[state.value()];
boolean dismissProgress = false;
switch (state) {
case INITIALIZING:
case CONNECTING:
case AUTHENTICATED:
- // The connection is still being established, so we'll report the current progress.
- if (mProgressIndicator == null) {
- mProgressIndicator = ProgressDialog.show(this,
- getString(R.string.footer_connecting), stateText, true, true,
- new DialogInterface.OnCancelListener() {
- @Override
- public void onCancel(DialogInterface dialog) {
- JniInterface.disconnectFromHost();
- }
- });
- } else {
- mProgressIndicator.setMessage(stateText);
- }
+ // The connection is still being established.
break;
case CONNECTED:
dismissProgress = true;
- Toast.makeText(this, stateText, Toast.LENGTH_SHORT).show();
-
// Display the remote desktop.
startActivityForResult(new Intent(this, Desktop.class), 0);
break;
case FAILED:
dismissProgress = true;
- Toast.makeText(this, stateText + ": "
- + getResources().getStringArray(R.array.protoc_errors)[error.value()],
- Toast.LENGTH_LONG).show();
-
+ Toast.makeText(this, getString(error.message()), Toast.LENGTH_LONG).show();
// Close the Desktop view, if it is currently running.
finishActivity(0);
break;
« no previous file with comments | « no previous file | remoting/android/java/src/org/chromium/chromoting/jni/JniInterface.java » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698