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

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

Issue 2458513004: Revert of Remove supports_touch_events flag from BasicDesktopEnvironment (Closed)
Patch Set: Created 4 years, 1 month 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
« no previous file with comments | « remoting/host/me2me_desktop_environment.h ('k') | remoting/host/remoting_me2me_host.cc » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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 <utility> 7 #include <utility>
8 8
9 #include "base/logging.h" 9 #include "base/logging.h"
10 #include "base/memory/ptr_util.h" 10 #include "base/memory/ptr_util.h"
11 #include "base/single_thread_task_runner.h" 11 #include "base/single_thread_task_runner.h"
12 #include "build/build_config.h" 12 #include "build/build_config.h"
13 #include "remoting/base/logging.h" 13 #include "remoting/base/logging.h"
14 #include "remoting/host/client_session_control.h" 14 #include "remoting/host/client_session_control.h"
15 #include "remoting/host/curtain_mode.h" 15 #include "remoting/host/curtain_mode.h"
16 #include "remoting/host/desktop_resizer.h" 16 #include "remoting/host/desktop_resizer.h"
17 #include "remoting/host/host_window.h" 17 #include "remoting/host/host_window.h"
18 #include "remoting/host/host_window.h" 18 #include "remoting/host/host_window.h"
19 #include "remoting/host/host_window_proxy.h" 19 #include "remoting/host/host_window_proxy.h"
20 #include "remoting/host/input_injector.h"
21 #include "remoting/host/local_input_monitor.h" 20 #include "remoting/host/local_input_monitor.h"
22 #include "remoting/host/resizing_host_observer.h" 21 #include "remoting/host/resizing_host_observer.h"
23 #include "remoting/host/screen_controls.h" 22 #include "remoting/host/screen_controls.h"
24 #include "remoting/protocol/capability_names.h" 23 #include "remoting/protocol/capability_names.h"
25 #include "third_party/webrtc/modules/desktop_capture/desktop_capture_options.h" 24 #include "third_party/webrtc/modules/desktop_capture/desktop_capture_options.h"
26 #include "third_party/webrtc/modules/desktop_capture/screen_capturer.h" 25 #include "third_party/webrtc/modules/desktop_capture/screen_capturer.h"
27 26
28 #if defined(OS_POSIX) 27 #if defined(OS_POSIX)
29 #include <sys/types.h> 28 #include <sys/types.h>
30 #include <unistd.h> 29 #include <unistd.h>
(...skipping 12 matching lines...) Expand all
43 // We only want to restore the host resolution on disconnect if we are not 42 // We only want to restore the host resolution on disconnect if we are not
44 // curtained so we don't mess up the user's window layout unnecessarily if 43 // curtained so we don't mess up the user's window layout unnecessarily if
45 // they disconnect and reconnect. Both OS X and Windows will restore the 44 // they disconnect and reconnect. Both OS X and Windows will restore the
46 // resolution automatically when the user logs back in on the console, and on 45 // resolution automatically when the user logs back in on the console, and on
47 // Linux the curtain-mode uses a separate session. 46 // Linux the curtain-mode uses a separate session.
48 return base::WrapUnique(new ResizingHostObserver(DesktopResizer::Create(), 47 return base::WrapUnique(new ResizingHostObserver(DesktopResizer::Create(),
49 curtain_ == nullptr)); 48 curtain_ == nullptr));
50 } 49 }
51 50
52 std::string Me2MeDesktopEnvironment::GetCapabilities() const { 51 std::string Me2MeDesktopEnvironment::GetCapabilities() const {
53 std::string capabilities; 52 std::string capabilities = BasicDesktopEnvironment::GetCapabilities();
54 capabilities += protocol::kRateLimitResizeRequests; 53 if (!capabilities.empty())
55 if (InputInjector::SupportsTouchEvents()) { 54 capabilities.append(" ");
56 capabilities += " "; 55 capabilities.append(protocol::kRateLimitResizeRequests);
57 capabilities += protocol::kTouchEventsCapability; 56
58 }
59 return capabilities; 57 return capabilities;
60 } 58 }
61 59
62 Me2MeDesktopEnvironment::Me2MeDesktopEnvironment( 60 Me2MeDesktopEnvironment::Me2MeDesktopEnvironment(
63 scoped_refptr<base::SingleThreadTaskRunner> caller_task_runner, 61 scoped_refptr<base::SingleThreadTaskRunner> caller_task_runner,
64 scoped_refptr<base::SingleThreadTaskRunner> video_capture_task_runner, 62 scoped_refptr<base::SingleThreadTaskRunner> video_capture_task_runner,
65 scoped_refptr<base::SingleThreadTaskRunner> input_task_runner, 63 scoped_refptr<base::SingleThreadTaskRunner> input_task_runner,
66 scoped_refptr<base::SingleThreadTaskRunner> ui_task_runner) 64 scoped_refptr<base::SingleThreadTaskRunner> ui_task_runner,
65 bool supports_touch_events)
67 : BasicDesktopEnvironment(caller_task_runner, 66 : BasicDesktopEnvironment(caller_task_runner,
68 video_capture_task_runner, 67 video_capture_task_runner,
69 input_task_runner, 68 input_task_runner,
70 ui_task_runner) { 69 ui_task_runner,
70 supports_touch_events) {
71 DCHECK(caller_task_runner->BelongsToCurrentThread()); 71 DCHECK(caller_task_runner->BelongsToCurrentThread());
72 72
73 // X DAMAGE is not enabled by default, since it is broken on many systems - 73 // X DAMAGE is not enabled by default, since it is broken on many systems -
74 // see http://crbug.com/73423. It's safe to enable it here because it works 74 // see http://crbug.com/73423. It's safe to enable it here because it works
75 // properly under Xvfb. 75 // properly under Xvfb.
76 desktop_capture_options()->set_use_update_notifications(true); 76 desktop_capture_options()->set_use_update_notifications(true);
77 } 77 }
78 78
79 bool Me2MeDesktopEnvironment::InitializeSecurity( 79 bool Me2MeDesktopEnvironment::InitializeSecurity(
80 base::WeakPtr<ClientSessionControl> client_session_control, 80 base::WeakPtr<ClientSessionControl> client_session_control,
(...skipping 59 matching lines...) Expand 10 before | Expand all | Expand 10 after
140 ui_task_runner) {} 140 ui_task_runner) {}
141 141
142 Me2MeDesktopEnvironmentFactory::~Me2MeDesktopEnvironmentFactory() { 142 Me2MeDesktopEnvironmentFactory::~Me2MeDesktopEnvironmentFactory() {
143 } 143 }
144 144
145 std::unique_ptr<DesktopEnvironment> Me2MeDesktopEnvironmentFactory::Create( 145 std::unique_ptr<DesktopEnvironment> Me2MeDesktopEnvironmentFactory::Create(
146 base::WeakPtr<ClientSessionControl> client_session_control) { 146 base::WeakPtr<ClientSessionControl> client_session_control) {
147 DCHECK(caller_task_runner()->BelongsToCurrentThread()); 147 DCHECK(caller_task_runner()->BelongsToCurrentThread());
148 148
149 std::unique_ptr<Me2MeDesktopEnvironment> desktop_environment( 149 std::unique_ptr<Me2MeDesktopEnvironment> desktop_environment(
150 new Me2MeDesktopEnvironment(caller_task_runner(), 150 new Me2MeDesktopEnvironment(
151 video_capture_task_runner(), 151 caller_task_runner(), video_capture_task_runner(),
152 input_task_runner(), ui_task_runner())); 152 input_task_runner(), ui_task_runner(), supports_touch_events()));
153 if (!desktop_environment->InitializeSecurity(client_session_control, 153 if (!desktop_environment->InitializeSecurity(client_session_control,
154 curtain_enabled_)) { 154 curtain_enabled_)) {
155 return nullptr; 155 return nullptr;
156 } 156 }
157 157
158 return std::move(desktop_environment); 158 return std::move(desktop_environment);
159 } 159 }
160 160
161 void Me2MeDesktopEnvironmentFactory::SetEnableCurtaining(bool enable) { 161 void Me2MeDesktopEnvironmentFactory::SetEnableCurtaining(bool enable) {
162 DCHECK(caller_task_runner()->BelongsToCurrentThread()); 162 DCHECK(caller_task_runner()->BelongsToCurrentThread());
163 163
164 curtain_enabled_ = enable; 164 curtain_enabled_ = enable;
165 } 165 }
166 166
167 } // namespace remoting 167 } // namespace remoting
OLDNEW
« no previous file with comments | « remoting/host/me2me_desktop_environment.h ('k') | remoting/host/remoting_me2me_host.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698