Chromium Code Reviews| Index: remoting/host/remoting_me2me_host.cc |
| diff --git a/remoting/host/remoting_me2me_host.cc b/remoting/host/remoting_me2me_host.cc |
| index 88a138798e5c0c37e40ad43f50b5fd7c27c6f4a8..d1e9dacff4dc422e38bc02b15bc7bd2337694973 100644 |
| --- a/remoting/host/remoting_me2me_host.cc |
| +++ b/remoting/host/remoting_me2me_host.cc |
| @@ -41,6 +41,7 @@ |
| #include "remoting/host/curtaining_host_observer.h" |
| #include "remoting/host/desktop_environment_factory.h" |
| #include "remoting/host/desktop_resizer.h" |
| +#include "remoting/host/desktop_session_connector.h" |
| #include "remoting/host/dns_blackhole_checker.h" |
| #include "remoting/host/event_executor.h" |
| #include "remoting/host/heartbeat_sender.h" |
| @@ -48,6 +49,7 @@ |
| #include "remoting/host/host_event_logger.h" |
| #include "remoting/host/host_exit_codes.h" |
| #include "remoting/host/host_user_interface.h" |
| +#include "remoting/host/ipc_desktop_environment_factory.h" |
| #include "remoting/host/json_host_config.h" |
| #include "remoting/host/log_to_server.h" |
| #include "remoting/host/network_settings.h" |
| @@ -112,9 +114,9 @@ void QuitMessageLoop(MessageLoop* message_loop) { |
| namespace remoting { |
| class HostProcess |
| - : public HeartbeatSender::Listener, |
| - public IPC::Listener, |
| - public ConfigFileWatcher::Delegate { |
| + : public ConfigFileWatcher::Delegate, |
| + public HeartbeatSender::Listener, |
| + public IPC::Listener { |
| public: |
| explicit HostProcess(scoped_ptr<ChromotingHostContext> context) |
| : context_(context.Pass()), |
| @@ -122,15 +124,9 @@ class HostProcess |
| allow_nat_traversal_(true), |
| restarting_(false), |
| shutting_down_(false), |
| -#if defined(OS_WIN) |
| - desktop_environment_factory_(new SessionDesktopEnvironmentFactory( |
| - context_->input_task_runner(), context_->ui_task_runner())), |
| -#else // !defined(OS_WIN) |
| - desktop_environment_factory_(new DesktopEnvironmentFactory( |
| - context_->input_task_runner(), context_->ui_task_runner())), |
| -#endif // !defined(OS_WIN) |
| desktop_resizer_(DesktopResizer::Create()), |
| - exit_code_(kSuccessExitCode) { |
| + exit_code_(kSuccessExitCode), |
| + desktop_session_connector_(NULL) { |
| network_change_notifier_.reset(net::NetworkChangeNotifier::Create()); |
| curtain_ = CurtainMode::Create( |
| base::Bind(&HostProcess::OnDisconnectRequested, |
| @@ -281,6 +277,9 @@ class HostProcess |
| IPC_BEGIN_MESSAGE_MAP(HostProcess, message) |
| IPC_MESSAGE_HANDLER(ChromotingDaemonNetworkMsg_Configuration, |
|
Wez
2012/10/17 17:51:57
nit: Two spaces, plz.
alexeypa (please no reviews)
2012/10/17 21:35:53
I have two on my machine. It is code review bugs,
|
| OnConfigUpdated) |
| + IPC_MESSAGE_FORWARD(ChromotingDaemonNetworkMsg_TerminalDisconnected, |
| + desktop_session_connector_, |
| + DesktopSessionConnector::OnTerminalDisconnected) |
| IPC_MESSAGE_UNHANDLED(handled = false) |
| IPC_END_MESSAGE_MAP() |
| return handled; |
| @@ -297,6 +296,31 @@ class HostProcess |
| return; |
| } |
| + // Create the proper kind of the desktop environment factory. |
|
Wez
2012/10/17 17:51:57
nit: Create a desktop environment factory appropri
alexeypa (please no reviews)
2012/10/17 21:35:53
Done.
|
| +#if defined(OS_WIN) |
| + |
| +#if defined(REMOTING_MULTI_PROCESS) |
|
Wez
2012/10/17 17:51:57
nit: Unless we define REMOTING_MULTI_PROCESS on ot
alexeypa (please no reviews)
2012/10/17 21:35:53
Currently we don't but I assume we might one day.
|
| + IpcDesktopEnvironmentFactory* desktop_environment_factory = |
| + new IpcDesktopEnvironmentFactory( |
| + daemon_channel_.get(), |
| + context_->input_task_runner(), |
| + context_->network_task_runner(), |
| + context_->ui_task_runner()); |
| + desktop_session_connector_ = desktop_environment_factory; |
| +#else // !defined(REMOTING_MULTI_PROCESS) |
| + DesktopEnvironmentFactory* desktop_environment_factory = |
| + new SessionDesktopEnvironmentFactory( |
| + context_->input_task_runner(), context_->ui_task_runner()); |
| +#endif // !defined(REMOTING_MULTI_PROCESS) |
| + |
| +#else // !defined(OS_WIN) |
| + DesktopEnvironmentFactory* desktop_environment_factory = |
| + new DesktopEnvironmentFactory( |
| + context_->input_task_runner(), context_->ui_task_runner()); |
| +#endif // !defined(OS_WIN) |
| + |
| + desktop_environment_factory_.reset(desktop_environment_factory); |
| + |
| context_->network_task_runner()->PostTask( |
| FROM_HERE, |
| base::Bind(&HostProcess::ListenForShutdownSignal, |
| @@ -692,6 +716,8 @@ class HostProcess |
| scoped_refptr<ChromotingHost> host_; |
| int exit_code_; |
| + |
| + DesktopSessionConnector* desktop_session_connector_; |
| }; |
| } // namespace remoting |