summaryrefslogtreecommitdiffstats
path: root/remoting
diff options
context:
space:
mode:
authorjamiewalch@chromium.org <jamiewalch@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2012-11-30 04:18:05 +0000
committerjamiewalch@chromium.org <jamiewalch@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2012-11-30 04:18:05 +0000
commitf2626379c1a5d0b2b5b4070ef870ac5490f23671 (patch)
tree70db67e59fc55073f71b94317593317f16ed86d7 /remoting
parent65555ac0547a9e3e0c9085d3c52bcb245ca3dc5a (diff)
downloadchromium_src-f2626379c1a5d0b2b5b4070ef870ac5490f23671.zip
chromium_src-f2626379c1a5d0b2b5b4070ef870ac5490f23671.tar.gz
chromium_src-f2626379c1a5d0b2b5b4070ef870ac5490f23671.tar.bz2
Improve curtain mode error message.
BUG=161158 Review URL: https://chromiumcodereview.appspot.com/11316231 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@170397 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'remoting')
-rw-r--r--remoting/host/remoting_me2me_host.cc17
-rw-r--r--remoting/webapp/client_screen.js10
2 files changed, 19 insertions, 8 deletions
diff --git a/remoting/host/remoting_me2me_host.cc b/remoting/host/remoting_me2me_host.cc
index 3b98715..6307b44 100644
--- a/remoting/host/remoting_me2me_host.cc
+++ b/remoting/host/remoting_me2me_host.cc
@@ -212,7 +212,9 @@ class HostProcess
void OnAuthFailed();
- void RejectAuthenticatingClient();
+ void OnCurtainModeFailed();
+
+ void OnRemoteSessionSwitchedToConsole();
// Invoked when the user uses the Disconnect windows to terminate
// the sessions, or when the local session is activated in curtain mode.
@@ -312,9 +314,9 @@ HostProcess::HostProcess(scoped_ptr<ChromotingHostContext> context,
// Create the platform-specific curtain-mode implementation.
// TODO(wez): Create this on the network thread?
curtain_ = CurtainMode::Create(
- base::Bind(&HostProcess::OnDisconnectRequested,
+ base::Bind(&HostProcess::OnRemoteSessionSwitchedToConsole,
base::Unretained(this)),
- base::Bind(&HostProcess::RejectAuthenticatingClient,
+ base::Bind(&HostProcess::OnCurtainModeFailed,
base::Unretained(this)));
StartOnUiThread();
@@ -934,12 +936,19 @@ void HostProcess::OnAuthFailed() {
Shutdown(kInvalidOauthCredentialsExitCode);
}
-void HostProcess::RejectAuthenticatingClient() {
+void HostProcess::OnCurtainModeFailed() {
DCHECK(context_->network_task_runner()->BelongsToCurrentThread());
DCHECK(host_);
+ LOG(ERROR) << "Curtain mode failed to activate. Closing connection.";
host_->RejectAuthenticatingClient();
}
+void HostProcess::OnRemoteSessionSwitchedToConsole() {
+ LOG(INFO) << "The remote session switched was to the console."
+ " Closing connection.";
+ OnDisconnectRequested();
+}
+
// Invoked when the user uses the Disconnect windows to terminate
// the sessions, or when the local session is activated in curtain mode.
void HostProcess::OnDisconnectRequested() {
diff --git a/remoting/webapp/client_screen.js b/remoting/webapp/client_screen.js
index 3ffb0f8..da8d82a 100644
--- a/remoting/webapp/client_screen.js
+++ b/remoting/webapp/client_screen.js
@@ -255,10 +255,12 @@ function onClientStateChange_(oldState, newState) {
remoting.setMode(remoting.AppMode.CLIENT_SESSION_FINISHED_ME2ME);
}
} else {
- // The transition from CONNECTING to CLOSED state may happen
- // only with older client plugins. Current version should go the
- // FAILED state when connection fails.
- showConnectError_(remoting.Error.INVALID_ACCESS_CODE);
+ // A state transition from CONNECTING -> CLOSED can happen if the host
+ // closes the connection without an error message instead of accepting it.
+ // For example, it does this if it fails to activate curtain mode. Since
+ // there's no way of knowing exactly what went wrong, we rely on server-
+ // side logs in this case and show a generic error message.
+ showConnectError_(remoting.Error.UNEXPECTED);
}
} else if (newState == remoting.ClientSession.State.FAILED) {