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