diff options
Diffstat (limited to 'remoting/android')
-rw-r--r-- | remoting/android/java/src/org/chromium/chromoting/Chromoting.java | 21 |
1 files changed, 19 insertions, 2 deletions
diff --git a/remoting/android/java/src/org/chromium/chromoting/Chromoting.java b/remoting/android/java/src/org/chromium/chromoting/Chromoting.java index 05523c7..8727d95 100644 --- a/remoting/android/java/src/org/chromium/chromoting/Chromoting.java +++ b/remoting/android/java/src/org/chromium/chromoting/Chromoting.java @@ -38,8 +38,8 @@ import java.util.Arrays; * also requests and renews authentication tokens using the system account manager. */ public class Chromoting extends Activity implements JniInterface.ConnectionListener, - AccountManagerCallback<Bundle>, ActionBar.OnNavigationListener, - HostListLoader.Callback { + AccountManagerCallback<Bundle>, ActionBar.OnNavigationListener, HostListLoader.Callback, + View.OnClickListener { /** Only accounts of this type will be selectable for authentication. */ private static final String ACCOUNT_TYPE = "com.google"; @@ -51,6 +51,10 @@ public class Chromoting extends Activity implements JniInterface.ConnectionListe private static final String HELP_URL = "http://support.google.com/chrome/?p=mobile_crd_hostslist"; + /** Web page to be displayed when user triggers the hyperlink for setting up hosts. */ + private static final String HOST_SETUP_URL = + "https://support.google.com/chrome/answer/1649523"; + /** User's account details. */ private Account mAccount; @@ -123,6 +127,11 @@ public class Chromoting extends Activity implements JniInterface.ConnectionListe private void setHostListProgressVisible(boolean visible) { mHostListView.setVisibility(visible ? View.GONE : View.VISIBLE); mProgressView.setVisibility(visible ? View.VISIBLE : View.GONE); + + // Hiding the host-list does not automatically hide the empty view, so do that here. + if (visible) { + mHostListView.getEmptyView().setVisibility(View.GONE); + } } /** @@ -142,6 +151,8 @@ public class Chromoting extends Activity implements JniInterface.ConnectionListe mHostListView.setEmptyView(findViewById(R.id.hostList_empty)); mProgressView = findViewById(R.id.hostList_progress); + findViewById(R.id.host_setup_link_android).setOnClickListener(this); + // Bring native components online. JniInterface.loadLibrary(this); @@ -230,6 +241,12 @@ public class Chromoting extends Activity implements JniInterface.ConnectionListe } } + /** Called when the user touches hyperlinked text. */ + @Override + public void onClick(View view) { + HelpActivity.launch(this, HOST_SETUP_URL); + } + /** Called when the user taps on a host entry. */ public void connectToHost(HostInfo host) { mProgressIndicator = ProgressDialog.show(this, |