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/win/session_input_injector.h" | 5 #include "remoting/host/win/session_input_injector.h" |
6 | 6 |
7 #include <set> | 7 #include <set> |
8 #include <string> | 8 #include <string> |
9 | 9 |
10 #include "base/bind.h" | 10 #include "base/bind.h" |
(...skipping 172 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
183 input_task_runner_->PostTask( | 183 input_task_runner_->PostTask( |
184 FROM_HERE, base::Bind(&Core::InjectMouseEvent, this, event)); | 184 FROM_HERE, base::Bind(&Core::InjectMouseEvent, this, event)); |
185 return; | 185 return; |
186 } | 186 } |
187 | 187 |
188 SwitchToInputDesktop(); | 188 SwitchToInputDesktop(); |
189 nested_executor_->InjectMouseEvent(event); | 189 nested_executor_->InjectMouseEvent(event); |
190 } | 190 } |
191 | 191 |
192 void SessionInputInjectorWin::Core::InjectTouchEvent(const TouchEvent& event) { | 192 void SessionInputInjectorWin::Core::InjectTouchEvent(const TouchEvent& event) { |
193 NOTIMPLEMENTED(); | 193 if (!input_task_runner_->BelongsToCurrentThread()) { |
| 194 input_task_runner_->PostTask( |
| 195 FROM_HERE, base::Bind(&Core::InjectTouchEvent, this, event)); |
| 196 return; |
| 197 } |
| 198 |
| 199 SwitchToInputDesktop(); |
| 200 nested_executor_->InjectTouchEvent(event); |
194 } | 201 } |
195 | 202 |
196 SessionInputInjectorWin::Core::~Core() { | 203 SessionInputInjectorWin::Core::~Core() { |
197 } | 204 } |
198 | 205 |
199 void SessionInputInjectorWin::Core::SwitchToInputDesktop() { | 206 void SessionInputInjectorWin::Core::SwitchToInputDesktop() { |
200 // Switch to the desktop receiving user input if different from the current | 207 // Switch to the desktop receiving user input if different from the current |
201 // one. | 208 // one. |
202 scoped_ptr<webrtc::Desktop> input_desktop( | 209 scoped_ptr<webrtc::Desktop> input_desktop( |
203 webrtc::Desktop::GetInputDesktop()); | 210 webrtc::Desktop::GetInputDesktop()); |
(...skipping 39 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
243 const protocol::MouseEvent& event) { | 250 const protocol::MouseEvent& event) { |
244 core_->InjectMouseEvent(event); | 251 core_->InjectMouseEvent(event); |
245 } | 252 } |
246 | 253 |
247 void SessionInputInjectorWin::InjectTouchEvent( | 254 void SessionInputInjectorWin::InjectTouchEvent( |
248 const protocol::TouchEvent& event) { | 255 const protocol::TouchEvent& event) { |
249 core_->InjectTouchEvent(event); | 256 core_->InjectTouchEvent(event); |
250 } | 257 } |
251 | 258 |
252 } // namespace remoting | 259 } // namespace remoting |
OLD | NEW |