OLD | NEW |
---|---|
1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2012 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/me2me_desktop_environment.h" | 5 #include "remoting/host/me2me_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/base/logging.h" | 9 #include "remoting/base/logging.h" |
10 #include "remoting/host/client_session_control.h" | 10 #include "remoting/host/client_session_control.h" |
11 #include "remoting/host/curtain_mode.h" | 11 #include "remoting/host/curtain_mode.h" |
12 #include "remoting/host/desktop_resizer.h" | 12 #include "remoting/host/desktop_resizer.h" |
13 #include "remoting/host/gnubby_auth_handler.h" | 13 #include "remoting/host/gnubby_auth_handler.h" |
14 #include "remoting/host/host_window.h" | 14 #include "remoting/host/host_window.h" |
15 #include "remoting/host/host_window.h" | 15 #include "remoting/host/host_window.h" |
16 #include "remoting/host/host_window_proxy.h" | 16 #include "remoting/host/host_window_proxy.h" |
17 #include "remoting/host/local_input_monitor.h" | 17 #include "remoting/host/local_input_monitor.h" |
18 #include "remoting/host/resizing_host_observer.h" | 18 #include "remoting/host/resizing_host_observer.h" |
19 #include "remoting/host/screen_controls.h" | 19 #include "remoting/host/screen_controls.h" |
20 #include "third_party/webrtc/modules/desktop_capture/desktop_capture_options.h" | 20 #include "third_party/webrtc/modules/desktop_capture/desktop_capture_options.h" |
21 #include "third_party/webrtc/modules/desktop_capture/screen_capturer.h" | 21 #include "third_party/webrtc/modules/desktop_capture/screen_capturer.h" |
22 | 22 |
23 #if defined(OS_POSIX) | 23 #if defined(OS_POSIX) |
24 #include <sys/types.h> | 24 #include <sys/types.h> |
25 #include <unistd.h> | 25 #include <unistd.h> |
26 #endif // defined(OS_POSIX) | 26 #endif // defined(OS_POSIX) |
27 | 27 |
28 const char kRateLimitResizeRequests[] = "rateLimitResizeRequests"; | 28 const char kRateLimitResizeRequests[] = "rateLimitResizeRequests"; |
29 const char kMultiTouchCapability[] = "multiTouch"; | |
Wez
2015/04/21 02:12:12
We're calling this touchEvents elsewhere, e.g. the
Rintaro Kuroiwa
2015/04/22 19:56:00
I remember some discussion in the design doc. We d
Wez
2015/04/23 22:10:25
I'm inclining back towards just touchEvents; we ca
| |
29 | 30 |
30 namespace remoting { | 31 namespace remoting { |
31 | 32 |
32 Me2MeDesktopEnvironment::~Me2MeDesktopEnvironment() { | 33 Me2MeDesktopEnvironment::~Me2MeDesktopEnvironment() { |
33 DCHECK(caller_task_runner()->BelongsToCurrentThread()); | 34 DCHECK(caller_task_runner()->BelongsToCurrentThread()); |
34 } | 35 } |
35 | 36 |
36 scoped_ptr<ScreenControls> Me2MeDesktopEnvironment::CreateScreenControls() { | 37 scoped_ptr<ScreenControls> Me2MeDesktopEnvironment::CreateScreenControls() { |
37 DCHECK(caller_task_runner()->BelongsToCurrentThread()); | 38 DCHECK(caller_task_runner()->BelongsToCurrentThread()); |
38 | 39 |
39 return make_scoped_ptr(new ResizingHostObserver(DesktopResizer::Create())); | 40 return make_scoped_ptr(new ResizingHostObserver(DesktopResizer::Create())); |
40 } | 41 } |
41 | 42 |
42 std::string Me2MeDesktopEnvironment::GetCapabilities() const { | 43 std::string Me2MeDesktopEnvironment::GetCapabilities() const { |
43 return kRateLimitResizeRequests; | 44 std::string result = kRateLimitResizeRequests; |
45 | |
46 if (multi_touch_enabled()) | |
47 result = result + " " + kMultiTouchCapability; | |
Wez
2015/04/21 02:12:12
Since you're only adding this in Me2MeDesktopEnvir
Rintaro Kuroiwa
2015/04/22 19:56:00
BasicDE does implement GetCapabilities and checks
Wez
2015/04/23 22:10:25
Aha, missed that. I think it'd be cleaner to have
Rintaro Kuroiwa
2015/04/24 01:55:01
Done.
| |
48 | |
49 return result; | |
44 } | 50 } |
45 | 51 |
46 Me2MeDesktopEnvironment::Me2MeDesktopEnvironment( | 52 Me2MeDesktopEnvironment::Me2MeDesktopEnvironment( |
47 scoped_refptr<base::SingleThreadTaskRunner> caller_task_runner, | 53 scoped_refptr<base::SingleThreadTaskRunner> caller_task_runner, |
48 scoped_refptr<base::SingleThreadTaskRunner> input_task_runner, | 54 scoped_refptr<base::SingleThreadTaskRunner> input_task_runner, |
49 scoped_refptr<base::SingleThreadTaskRunner> ui_task_runner) | 55 scoped_refptr<base::SingleThreadTaskRunner> ui_task_runner) |
50 : BasicDesktopEnvironment(caller_task_runner, | 56 : BasicDesktopEnvironment(caller_task_runner, |
51 input_task_runner, | 57 input_task_runner, |
52 ui_task_runner), | 58 ui_task_runner), |
53 gnubby_auth_enabled_(false) { | 59 gnubby_auth_enabled_(false) { |
(...skipping 88 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
142 | 148 |
143 scoped_ptr<Me2MeDesktopEnvironment> desktop_environment( | 149 scoped_ptr<Me2MeDesktopEnvironment> desktop_environment( |
144 new Me2MeDesktopEnvironment(caller_task_runner(), | 150 new Me2MeDesktopEnvironment(caller_task_runner(), |
145 input_task_runner(), | 151 input_task_runner(), |
146 ui_task_runner())); | 152 ui_task_runner())); |
147 if (!desktop_environment->InitializeSecurity(client_session_control, | 153 if (!desktop_environment->InitializeSecurity(client_session_control, |
148 curtain_enabled_)) { | 154 curtain_enabled_)) { |
149 return nullptr; | 155 return nullptr; |
150 } | 156 } |
151 desktop_environment->SetEnableGnubbyAuth(gnubby_auth_enabled_); | 157 desktop_environment->SetEnableGnubbyAuth(gnubby_auth_enabled_); |
158 desktop_environment->SetEnableMultiTouch(multi_touch_enabled()); | |
152 | 159 |
153 return desktop_environment.Pass(); | 160 return desktop_environment.Pass(); |
154 } | 161 } |
155 | 162 |
156 void Me2MeDesktopEnvironmentFactory::SetEnableCurtaining(bool enable) { | 163 void Me2MeDesktopEnvironmentFactory::SetEnableCurtaining(bool enable) { |
157 DCHECK(caller_task_runner()->BelongsToCurrentThread()); | 164 DCHECK(caller_task_runner()->BelongsToCurrentThread()); |
158 | 165 |
159 curtain_enabled_ = enable; | 166 curtain_enabled_ = enable; |
160 } | 167 } |
161 | 168 |
162 void Me2MeDesktopEnvironmentFactory::SetEnableGnubbyAuth( | 169 void Me2MeDesktopEnvironmentFactory::SetEnableGnubbyAuth( |
163 bool gnubby_auth_enabled) { | 170 bool gnubby_auth_enabled) { |
164 gnubby_auth_enabled_ = gnubby_auth_enabled; | 171 gnubby_auth_enabled_ = gnubby_auth_enabled; |
165 } | 172 } |
166 | 173 |
167 } // namespace remoting | 174 } // namespace remoting |
OLD | NEW |