| Index: remoting/host/chromoting_host.cc
|
| diff --git a/remoting/host/chromoting_host.cc b/remoting/host/chromoting_host.cc
|
| index 40f136e15ea51c6890497c270869cca77448d318..6fe3d11a7d756bf17e501dd7c21a935850538791 100644
|
| --- a/remoting/host/chromoting_host.cc
|
| +++ b/remoting/host/chromoting_host.cc
|
| @@ -11,7 +11,6 @@
|
| #include "build/build_config.h"
|
| #include "remoting/base/constants.h"
|
| #include "remoting/host/chromoting_host_context.h"
|
| -#include "remoting/host/desktop_environment.h"
|
| #include "remoting/host/desktop_environment_factory.h"
|
| #include "remoting/host/event_executor.h"
|
| #include "remoting/host/host_config.h"
|
| @@ -307,10 +306,6 @@ void ChromotingHost::OnIncomingSession(
|
|
|
| LOG(INFO) << "Client connected: " << session->jid();
|
|
|
| - // Create the desktop integration implementation for the client to use.
|
| - scoped_ptr<DesktopEnvironment> desktop_environment =
|
| - desktop_environment_factory_->Create();
|
| -
|
| // Create a client object.
|
| scoped_ptr<protocol::ConnectionToClient> connection(
|
| new protocol::ConnectionToClient(session));
|
| @@ -320,7 +315,7 @@ void ChromotingHost::OnIncomingSession(
|
| encode_task_runner_,
|
| network_task_runner_,
|
| connection.Pass(),
|
| - desktop_environment.Pass(),
|
| + desktop_environment_factory_,
|
| max_session_duration_);
|
| clients_.push_back(client);
|
| clients_count_++;
|
| @@ -375,6 +370,17 @@ void ChromotingHost::DisconnectAllClients() {
|
| }
|
| }
|
|
|
| +void ChromotingHost::DisconnectClient(DesktopEnvironment* desktop_environment) {
|
| + DCHECK(network_task_runner_->BelongsToCurrentThread());
|
| +
|
| + for (ClientList::iterator i = clients_.begin(); i != clients_.end(); ++i) {
|
| + if ((*i)->desktop_environment() == desktop_environment) {
|
| + (*i)->Disconnect();
|
| + break;
|
| + }
|
| + }
|
| +}
|
| +
|
| void ChromotingHost::SetUiStrings(const UiStrings& ui_strings) {
|
| DCHECK(network_task_runner_->BelongsToCurrentThread());
|
| DCHECK_EQ(state_, kInitial);
|
|
|