summaryrefslogtreecommitdiffstats
path: root/remoting/host
diff options
context:
space:
mode:
authorrmsousa@chromium.org <rmsousa@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2012-10-19 03:34:50 +0000
committerrmsousa@chromium.org <rmsousa@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2012-10-19 03:34:50 +0000
commit940be76667d9330fb7e817b5bc624fd32ac3acd6 (patch)
treea52e5711f95d51e48e6e01d3bccf04e7102aa951 /remoting/host
parent78237b37ee1cfd465fc64dfde9e80c3403e37f67 (diff)
downloadchromium_src-940be76667d9330fb7e817b5bc624fd32ac3acd6.zip
chromium_src-940be76667d9330fb7e817b5bc624fd32ac3acd6.tar.gz
chromium_src-940be76667d9330fb7e817b5bc624fd32ac3acd6.tar.bz2
Move it2me business logic out of the UI class
BUG=156257 Review URL: https://chromiumcodereview.appspot.com/11194069 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@162914 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'remoting/host')
-rw-r--r--remoting/host/it2me_host_user_interface.cc13
-rw-r--r--remoting/host/it2me_host_user_interface.h4
-rw-r--r--remoting/host/plugin/host_script_object.cc8
3 files changed, 8 insertions, 17 deletions
diff --git a/remoting/host/it2me_host_user_interface.cc b/remoting/host/it2me_host_user_interface.cc
index 38e0624..3f0653b 100644
--- a/remoting/host/it2me_host_user_interface.cc
+++ b/remoting/host/it2me_host_user_interface.cc
@@ -44,19 +44,6 @@ void It2MeHostUserInterface::Init() {
continue_window_ = ContinueWindow::Create();
}
-void It2MeHostUserInterface::OnClientAuthenticated(const std::string& jid) {
- if (!get_authenticated_jid().empty()) {
- // If we already authenticated another client then one of the
- // connections may be an attacker, so both are suspect and we have
- // to reject the second connection and shutdown the host.
- get_host()->RejectAuthenticatingClient();
- network_task_runner()->PostTask(FROM_HERE, base::Bind(
- &ChromotingHost::Shutdown, get_host(), base::Closure()));
- } else {
- HostUserInterface::OnClientAuthenticated(jid);
- }
-}
-
void It2MeHostUserInterface::ProcessOnClientAuthenticated(
const std::string& username) {
DCHECK(ui_task_runner()->BelongsToCurrentThread());
diff --git a/remoting/host/it2me_host_user_interface.h b/remoting/host/it2me_host_user_interface.h
index 28e3e22..7471aa0 100644
--- a/remoting/host/it2me_host_user_interface.h
+++ b/remoting/host/it2me_host_user_interface.h
@@ -32,10 +32,6 @@ class It2MeHostUserInterface : public HostUserInterface {
// HostUserInterface overrides.
virtual void Init() OVERRIDE;
- // HostStatusObserver implementation. These methods will be called from the
- // network thread.
- virtual void OnClientAuthenticated(const std::string& jid) OVERRIDE;
-
protected:
virtual void ProcessOnClientAuthenticated(
const std::string& username) OVERRIDE;
diff --git a/remoting/host/plugin/host_script_object.cc b/remoting/host/plugin/host_script_object.cc
index 664d132..52d9196 100644
--- a/remoting/host/plugin/host_script_object.cc
+++ b/remoting/host/plugin/host_script_object.cc
@@ -447,6 +447,14 @@ void HostNPScriptObject::It2MeImpl::OnClientAuthenticated(
// Ignore the new connection if we are disconnecting.
return;
}
+ if (state_ == kConnected) {
+ // If we already connected another client then one of the connections may be
+ // an attacker, so both are suspect and we have to reject the second
+ // connection and shutdown the host.
+ host_->RejectAuthenticatingClient();
+ Disconnect();
+ return;
+ }
std::string client_username = jid;
size_t pos = client_username.find('/');