Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(266)

Side by Side Diff: remoting/host/me2me_desktop_environment.cc

Issue 1033913003: Touch Events capability negotiation (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: add capabiility_names.h Created 5 years, 7 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
OLDNEW
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 "remoting/protocol/capability_names.h"
20 #include "third_party/webrtc/modules/desktop_capture/desktop_capture_options.h" 21 #include "third_party/webrtc/modules/desktop_capture/desktop_capture_options.h"
21 #include "third_party/webrtc/modules/desktop_capture/screen_capturer.h" 22 #include "third_party/webrtc/modules/desktop_capture/screen_capturer.h"
22 23
23 #if defined(OS_POSIX) 24 #if defined(OS_POSIX)
24 #include <sys/types.h> 25 #include <sys/types.h>
25 #include <unistd.h> 26 #include <unistd.h>
26 #endif // defined(OS_POSIX) 27 #endif // defined(OS_POSIX)
27 28
28 const char kRateLimitResizeRequests[] = "rateLimitResizeRequests";
29
30 namespace remoting { 29 namespace remoting {
31 30
32 Me2MeDesktopEnvironment::~Me2MeDesktopEnvironment() { 31 Me2MeDesktopEnvironment::~Me2MeDesktopEnvironment() {
33 DCHECK(caller_task_runner()->BelongsToCurrentThread()); 32 DCHECK(caller_task_runner()->BelongsToCurrentThread());
34 } 33 }
35 34
36 scoped_ptr<ScreenControls> Me2MeDesktopEnvironment::CreateScreenControls() { 35 scoped_ptr<ScreenControls> Me2MeDesktopEnvironment::CreateScreenControls() {
37 DCHECK(caller_task_runner()->BelongsToCurrentThread()); 36 DCHECK(caller_task_runner()->BelongsToCurrentThread());
38 37
39 return make_scoped_ptr(new ResizingHostObserver(DesktopResizer::Create())); 38 return make_scoped_ptr(new ResizingHostObserver(DesktopResizer::Create()));
40 } 39 }
41 40
42 std::string Me2MeDesktopEnvironment::GetCapabilities() const { 41 std::string Me2MeDesktopEnvironment::GetCapabilities() const {
43 return kRateLimitResizeRequests; 42 std::string result = BasicDesktopEnvironment::GetCapabilities();
43 if (!result.empty())
44 return result + " " + protocol::kRateLimitResizeRequests;
45
46 return protocol::kRateLimitResizeRequests;
Wez 2015/05/21 00:59:14 Suggest restructuring this as: std::string capabi
Rintaro Kuroiwa 2015/05/21 21:53:30 Done.
44 } 47 }
45 48
46 Me2MeDesktopEnvironment::Me2MeDesktopEnvironment( 49 Me2MeDesktopEnvironment::Me2MeDesktopEnvironment(
47 scoped_refptr<base::SingleThreadTaskRunner> caller_task_runner, 50 scoped_refptr<base::SingleThreadTaskRunner> caller_task_runner,
48 scoped_refptr<base::SingleThreadTaskRunner> input_task_runner, 51 scoped_refptr<base::SingleThreadTaskRunner> input_task_runner,
49 scoped_refptr<base::SingleThreadTaskRunner> ui_task_runner) 52 scoped_refptr<base::SingleThreadTaskRunner> ui_task_runner)
50 : BasicDesktopEnvironment(caller_task_runner, 53 : BasicDesktopEnvironment(caller_task_runner,
51 input_task_runner, 54 input_task_runner,
52 ui_task_runner), 55 ui_task_runner),
53 gnubby_auth_enabled_(false) { 56 gnubby_auth_enabled_(false) {
(...skipping 88 matching lines...) Expand 10 before | Expand all | Expand 10 after
142 145
143 scoped_ptr<Me2MeDesktopEnvironment> desktop_environment( 146 scoped_ptr<Me2MeDesktopEnvironment> desktop_environment(
144 new Me2MeDesktopEnvironment(caller_task_runner(), 147 new Me2MeDesktopEnvironment(caller_task_runner(),
145 input_task_runner(), 148 input_task_runner(),
146 ui_task_runner())); 149 ui_task_runner()));
147 if (!desktop_environment->InitializeSecurity(client_session_control, 150 if (!desktop_environment->InitializeSecurity(client_session_control,
148 curtain_enabled_)) { 151 curtain_enabled_)) {
149 return nullptr; 152 return nullptr;
150 } 153 }
151 desktop_environment->SetEnableGnubbyAuth(gnubby_auth_enabled_); 154 desktop_environment->SetEnableGnubbyAuth(gnubby_auth_enabled_);
155 desktop_environment->set_supports_touch_events(
156 supports_touch_events());
152 157
153 return desktop_environment.Pass(); 158 return desktop_environment.Pass();
154 } 159 }
155 160
156 void Me2MeDesktopEnvironmentFactory::SetEnableCurtaining(bool enable) { 161 void Me2MeDesktopEnvironmentFactory::SetEnableCurtaining(bool enable) {
157 DCHECK(caller_task_runner()->BelongsToCurrentThread()); 162 DCHECK(caller_task_runner()->BelongsToCurrentThread());
158 163
159 curtain_enabled_ = enable; 164 curtain_enabled_ = enable;
160 } 165 }
161 166
162 void Me2MeDesktopEnvironmentFactory::SetEnableGnubbyAuth( 167 void Me2MeDesktopEnvironmentFactory::SetEnableGnubbyAuth(
163 bool gnubby_auth_enabled) { 168 bool gnubby_auth_enabled) {
164 gnubby_auth_enabled_ = gnubby_auth_enabled; 169 gnubby_auth_enabled_ = gnubby_auth_enabled;
165 } 170 }
166 171
167 } // namespace remoting 172 } // namespace remoting
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698