| OLD | NEW |
| 1 // Copyright 2013 The Chromium Authors. All rights reserved. | 1 // Copyright 2013 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/it2me_desktop_environment.h" | 5 #include "remoting/host/it2me_desktop_environment.h" |
| 6 | 6 |
| 7 #include <utility> |
| 8 |
| 7 #include "base/logging.h" | 9 #include "base/logging.h" |
| 8 #include "base/single_thread_task_runner.h" | 10 #include "base/single_thread_task_runner.h" |
| 9 #include "build/build_config.h" | 11 #include "build/build_config.h" |
| 10 #include "remoting/host/client_session_control.h" | 12 #include "remoting/host/client_session_control.h" |
| 11 #include "remoting/host/host_window.h" | 13 #include "remoting/host/host_window.h" |
| 12 #include "remoting/host/host_window_proxy.h" | 14 #include "remoting/host/host_window_proxy.h" |
| 13 #include "remoting/host/local_input_monitor.h" | 15 #include "remoting/host/local_input_monitor.h" |
| 14 | 16 |
| 15 #if defined(OS_POSIX) | 17 #if defined(OS_POSIX) |
| 16 #include <sys/types.h> | 18 #include <sys/types.h> |
| (...skipping 34 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 51 // TODO(lambroslambrou): Use a better technique of detecting whether we're | 53 // TODO(lambroslambrou): Use a better technique of detecting whether we're |
| 52 // running in the LoginWindow context, and refactor this into a separate | 54 // running in the LoginWindow context, and refactor this into a separate |
| 53 // function to be used here and in CurtainMode::ActivateCurtain(). | 55 // function to be used here and in CurtainMode::ActivateCurtain(). |
| 54 want_user_interface = getuid() != 0; | 56 want_user_interface = getuid() != 0; |
| 55 #endif // defined(OS_MACOSX) | 57 #endif // defined(OS_MACOSX) |
| 56 | 58 |
| 57 // Create the continue and disconnect windows. | 59 // Create the continue and disconnect windows. |
| 58 if (want_user_interface) { | 60 if (want_user_interface) { |
| 59 continue_window_ = HostWindow::CreateContinueWindow(); | 61 continue_window_ = HostWindow::CreateContinueWindow(); |
| 60 continue_window_.reset(new HostWindowProxy( | 62 continue_window_.reset(new HostWindowProxy( |
| 61 caller_task_runner, | 63 caller_task_runner, ui_task_runner, std::move(continue_window_))); |
| 62 ui_task_runner, | |
| 63 continue_window_.Pass())); | |
| 64 continue_window_->Start(client_session_control); | 64 continue_window_->Start(client_session_control); |
| 65 | 65 |
| 66 disconnect_window_ = HostWindow::CreateDisconnectWindow(); | 66 disconnect_window_ = HostWindow::CreateDisconnectWindow(); |
| 67 disconnect_window_.reset(new HostWindowProxy( | 67 disconnect_window_.reset(new HostWindowProxy( |
| 68 caller_task_runner, | 68 caller_task_runner, ui_task_runner, std::move(disconnect_window_))); |
| 69 ui_task_runner, | |
| 70 disconnect_window_.Pass())); | |
| 71 disconnect_window_->Start(client_session_control); | 69 disconnect_window_->Start(client_session_control); |
| 72 } | 70 } |
| 73 } | 71 } |
| 74 | 72 |
| 75 It2MeDesktopEnvironmentFactory::It2MeDesktopEnvironmentFactory( | 73 It2MeDesktopEnvironmentFactory::It2MeDesktopEnvironmentFactory( |
| 76 scoped_refptr<base::SingleThreadTaskRunner> caller_task_runner, | 74 scoped_refptr<base::SingleThreadTaskRunner> caller_task_runner, |
| 77 scoped_refptr<base::SingleThreadTaskRunner> input_task_runner, | 75 scoped_refptr<base::SingleThreadTaskRunner> input_task_runner, |
| 78 scoped_refptr<base::SingleThreadTaskRunner> ui_task_runner) | 76 scoped_refptr<base::SingleThreadTaskRunner> ui_task_runner) |
| 79 : BasicDesktopEnvironmentFactory(caller_task_runner, | 77 : BasicDesktopEnvironmentFactory(caller_task_runner, |
| 80 input_task_runner, | 78 input_task_runner, |
| 81 ui_task_runner) { | 79 ui_task_runner) { |
| 82 } | 80 } |
| 83 | 81 |
| 84 It2MeDesktopEnvironmentFactory::~It2MeDesktopEnvironmentFactory() { | 82 It2MeDesktopEnvironmentFactory::~It2MeDesktopEnvironmentFactory() { |
| 85 } | 83 } |
| 86 | 84 |
| 87 scoped_ptr<DesktopEnvironment> It2MeDesktopEnvironmentFactory::Create( | 85 scoped_ptr<DesktopEnvironment> It2MeDesktopEnvironmentFactory::Create( |
| 88 base::WeakPtr<ClientSessionControl> client_session_control) { | 86 base::WeakPtr<ClientSessionControl> client_session_control) { |
| 89 DCHECK(caller_task_runner()->BelongsToCurrentThread()); | 87 DCHECK(caller_task_runner()->BelongsToCurrentThread()); |
| 90 | 88 |
| 91 return make_scoped_ptr(new It2MeDesktopEnvironment(caller_task_runner(), | 89 return make_scoped_ptr(new It2MeDesktopEnvironment(caller_task_runner(), |
| 92 input_task_runner(), | 90 input_task_runner(), |
| 93 ui_task_runner(), | 91 ui_task_runner(), |
| 94 client_session_control, | 92 client_session_control, |
| 95 supports_touch_events())); | 93 supports_touch_events())); |
| 96 } | 94 } |
| 97 | 95 |
| 98 } // namespace remoting | 96 } // namespace remoting |
| OLD | NEW |