summaryrefslogtreecommitdiffstats
path: root/remoting
diff options
context:
space:
mode:
authorhclam@chromium.org <hclam@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2011-02-28 22:14:21 +0000
committerhclam@chromium.org <hclam@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2011-02-28 22:14:21 +0000
commit61942eaab1f444e15bef46e71b29f2cfbf5becae (patch)
tree285fe901b04cc98d642f928315c68d4c99eafe1b /remoting
parent91303f2f046164d743d1284887e573e1a7e4906f (diff)
downloadchromium_src-61942eaab1f444e15bef46e71b29f2cfbf5becae.zip
chromium_src-61942eaab1f444e15bef46e71b29f2cfbf5becae.tar.gz
chromium_src-61942eaab1f444e15bef46e71b29f2cfbf5becae.tar.bz2
Report authentication failure on the host side of chromoting
BUG=74436 TEST=Try a random username, it will ask for password again. Review URL: http://codereview.chromium.org/6592040 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@76275 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'remoting')
-rw-r--r--remoting/host/chromoting_host.cc14
-rw-r--r--remoting/host/chromoting_host.h1
-rw-r--r--remoting/host/desktop_environment.cc1
-rw-r--r--remoting/host/desktop_environment.h3
4 files changed, 19 insertions, 0 deletions
diff --git a/remoting/host/chromoting_host.cc b/remoting/host/chromoting_host.cc
index fa99497..56297dd 100644
--- a/remoting/host/chromoting_host.cc
+++ b/remoting/host/chromoting_host.cc
@@ -375,4 +375,18 @@ void ChromotingHost::LocalLoginSucceeded() {
recorder_->Start();
}
+void ChromotingHost::LocalLoginFailed() {
+ if (MessageLoop::current() != context_->main_message_loop()) {
+ context_->main_message_loop()->PostTask(
+ FROM_HERE,
+ NewRunnableMethod(this, &ChromotingHost::LocalLoginFailed));
+ return;
+ }
+
+ protocol::LocalLoginStatus* status = new protocol::LocalLoginStatus();
+ status->set_success(false);
+ connection_->client_stub()->BeginSessionResponse(
+ status, new DeleteTask<protocol::LocalLoginStatus>(status));
+}
+
} // namespace remoting
diff --git a/remoting/host/chromoting_host.h b/remoting/host/chromoting_host.h
index 525a0dd..5a5959f 100644
--- a/remoting/host/chromoting_host.h
+++ b/remoting/host/chromoting_host.h
@@ -107,6 +107,7 @@ class ChromotingHost : public base::RefCountedThreadSafe<ChromotingHost>,
////////////////////////////////////////////////////////////////////////////
// DesktopEnvironment::EventHandler implementations
virtual void LocalLoginSucceeded();
+ virtual void LocalLoginFailed();
// Callback for ChromotingServer.
void OnNewClientSession(
diff --git a/remoting/host/desktop_environment.cc b/remoting/host/desktop_environment.cc
index 598a632..e6e1057 100644
--- a/remoting/host/desktop_environment.cc
+++ b/remoting/host/desktop_environment.cc
@@ -52,6 +52,7 @@ void DesktopEnvironment::BeginSessionRequest(
event_handler_->LocalLoginSucceeded();
} else {
LOG(WARNING) << "Login failed for user " << credentials->username();
+ event_handler_->LocalLoginFailed();
}
done->Run();
diff --git a/remoting/host/desktop_environment.h b/remoting/host/desktop_environment.h
index 16404d7..90bab71 100644
--- a/remoting/host/desktop_environment.h
+++ b/remoting/host/desktop_environment.h
@@ -27,6 +27,9 @@ class DesktopEnvironment : public protocol::HostStub {
// Called to signal that local login has succeeded and ChromotingHost can
// proceed with the next step.
virtual void LocalLoginSucceeded() = 0;
+
+ // Called to signal that local login has failed.
+ virtual void LocalLoginFailed() = 0;
};
DesktopEnvironment(Capturer* capturer, protocol::InputStub* input_stub);