| OLD | NEW |
| 1 // Copyright (c) 2011 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2011 The Chromium Authors. All rights reserved. |
| 2 // Use of this source code is governed by a BSD-style license that can be | 2 // Use of this source code is governed by a BSD-style license that can be |
| 3 // found in the LICENSE file. | 3 // found in the LICENSE file. |
| 4 | 4 |
| 5 #include "remoting/host/chromoting_host.h" | 5 #include "remoting/host/chromoting_host.h" |
| 6 | 6 |
| 7 #include "base/bind.h" | 7 #include "base/bind.h" |
| 8 #include "base/stl_util-inl.h" | 8 #include "base/stl_util-inl.h" |
| 9 #include "base/task.h" | 9 #include "base/task.h" |
| 10 #include "build/build_config.h" | 10 #include "build/build_config.h" |
| (...skipping 20 matching lines...) Expand all Loading... |
| 31 | 31 |
| 32 using remoting::protocol::ConnectionToClient; | 32 using remoting::protocol::ConnectionToClient; |
| 33 using remoting::protocol::InputStub; | 33 using remoting::protocol::InputStub; |
| 34 | 34 |
| 35 namespace remoting { | 35 namespace remoting { |
| 36 | 36 |
| 37 // static | 37 // static |
| 38 ChromotingHost* ChromotingHost::Create(ChromotingHostContext* context, | 38 ChromotingHost* ChromotingHost::Create(ChromotingHostContext* context, |
| 39 MutableHostConfig* config) { | 39 MutableHostConfig* config) { |
| 40 Capturer* capturer = Capturer::Create(); | 40 Capturer* capturer = Capturer::Create(); |
| 41 InputStub* input_stub = CreateEventExecutor(context->ui_message_loop(), | 41 EventExecutor* event_executor = |
| 42 capturer); | 42 EventExecutor::Create(context->ui_message_loop(), capturer); |
| 43 Curtain* curtain = Curtain::Create(); | 43 Curtain* curtain = Curtain::Create(); |
| 44 return Create(context, config, | 44 return Create(context, config, |
| 45 new DesktopEnvironment(capturer, input_stub, curtain)); | 45 new DesktopEnvironment(capturer, event_executor, curtain)); |
| 46 } | 46 } |
| 47 | 47 |
| 48 // static | 48 // static |
| 49 ChromotingHost* ChromotingHost::Create(ChromotingHostContext* context, | 49 ChromotingHost* ChromotingHost::Create(ChromotingHostContext* context, |
| 50 MutableHostConfig* config, | 50 MutableHostConfig* config, |
| 51 DesktopEnvironment* environment) { | 51 DesktopEnvironment* environment) { |
| 52 return new ChromotingHost(context, config, environment); | 52 return new ChromotingHost(context, config, environment); |
| 53 } | 53 } |
| 54 | 54 |
| 55 ChromotingHost::ChromotingHost(ChromotingHostContext* context, | 55 ChromotingHost::ChromotingHost(ChromotingHostContext* context, |
| (...skipping 271 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 327 | 327 |
| 328 // We accept the connection, so create a connection object. | 328 // We accept the connection, so create a connection object. |
| 329 ConnectionToClient* connection = new ConnectionToClient( | 329 ConnectionToClient* connection = new ConnectionToClient( |
| 330 context_->network_message_loop(), this); | 330 context_->network_message_loop(), this); |
| 331 | 331 |
| 332 // Create a client object. | 332 // Create a client object. |
| 333 ClientSession* client = new ClientSession( | 333 ClientSession* client = new ClientSession( |
| 334 this, | 334 this, |
| 335 base::Bind(UserAuthenticator::Create), | 335 base::Bind(UserAuthenticator::Create), |
| 336 connection, | 336 connection, |
| 337 desktop_environment_->input_stub()); | 337 desktop_environment_->event_executor()); |
| 338 connection->set_host_stub(client); | 338 connection->set_host_stub(client); |
| 339 connection->set_input_stub(client); | 339 connection->set_input_stub(client); |
| 340 | 340 |
| 341 connection->Init(session); | 341 connection->Init(session); |
| 342 | 342 |
| 343 clients_.push_back(client); | 343 clients_.push_back(client); |
| 344 } | 344 } |
| 345 | 345 |
| 346 void ChromotingHost::set_protocol_config( | 346 void ChromotingHost::set_protocol_config( |
| 347 protocol::CandidateSessionConfig* config) { | 347 protocol::CandidateSessionConfig* config) { |
| (...skipping 111 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 459 return; | 459 return; |
| 460 } | 460 } |
| 461 | 461 |
| 462 protocol::LocalLoginStatus* status = new protocol::LocalLoginStatus(); | 462 protocol::LocalLoginStatus* status = new protocol::LocalLoginStatus(); |
| 463 status->set_success(false); | 463 status->set_success(false); |
| 464 connection->client_stub()->BeginSessionResponse( | 464 connection->client_stub()->BeginSessionResponse( |
| 465 status, new DeleteTask<protocol::LocalLoginStatus>(status)); | 465 status, new DeleteTask<protocol::LocalLoginStatus>(status)); |
| 466 } | 466 } |
| 467 | 467 |
| 468 } // namespace remoting | 468 } // namespace remoting |
| OLD | NEW |