| 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 79 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 90 | 90 |
| 91 DISALLOW_COPY_AND_ASSIGN(Core); | 91 DISALLOW_COPY_AND_ASSIGN(Core); |
| 92 }; | 92 }; |
| 93 | 93 |
| 94 SessionInputInjectorWin::Core::Core( | 94 SessionInputInjectorWin::Core::Core( |
| 95 scoped_refptr<base::SingleThreadTaskRunner> input_task_runner, | 95 scoped_refptr<base::SingleThreadTaskRunner> input_task_runner, |
| 96 scoped_ptr<InputInjector> nested_executor, | 96 scoped_ptr<InputInjector> nested_executor, |
| 97 scoped_refptr<base::SingleThreadTaskRunner> inject_sas_task_runner, | 97 scoped_refptr<base::SingleThreadTaskRunner> inject_sas_task_runner, |
| 98 const base::Closure& inject_sas) | 98 const base::Closure& inject_sas) |
| 99 : input_task_runner_(input_task_runner), | 99 : input_task_runner_(input_task_runner), |
| 100 nested_executor_(nested_executor.Pass()), | 100 nested_executor_(std::move(nested_executor)), |
| 101 inject_sas_task_runner_(inject_sas_task_runner), | 101 inject_sas_task_runner_(inject_sas_task_runner), |
| 102 inject_sas_(inject_sas) { | 102 inject_sas_(inject_sas) { |
| 103 } | 103 } |
| 104 | 104 |
| 105 void SessionInputInjectorWin::Core::Start( | 105 void SessionInputInjectorWin::Core::Start( |
| 106 scoped_ptr<protocol::ClipboardStub> client_clipboard) { | 106 scoped_ptr<protocol::ClipboardStub> client_clipboard) { |
| 107 if (!input_task_runner_->BelongsToCurrentThread()) { | 107 if (!input_task_runner_->BelongsToCurrentThread()) { |
| 108 input_task_runner_->PostTask( | 108 input_task_runner_->PostTask( |
| 109 FROM_HERE, | 109 FROM_HERE, |
| 110 base::Bind(&Core::Start, this, base::Passed(&client_clipboard))); | 110 base::Bind(&Core::Start, this, base::Passed(&client_clipboard))); |
| 111 return; | 111 return; |
| 112 } | 112 } |
| 113 | 113 |
| 114 nested_executor_->Start(client_clipboard.Pass()); | 114 nested_executor_->Start(std::move(client_clipboard)); |
| 115 } | 115 } |
| 116 | 116 |
| 117 void SessionInputInjectorWin::Core::InjectClipboardEvent( | 117 void SessionInputInjectorWin::Core::InjectClipboardEvent( |
| 118 const ClipboardEvent& event) { | 118 const ClipboardEvent& event) { |
| 119 if (!input_task_runner_->BelongsToCurrentThread()) { | 119 if (!input_task_runner_->BelongsToCurrentThread()) { |
| 120 input_task_runner_->PostTask( | 120 input_task_runner_->PostTask( |
| 121 FROM_HERE, base::Bind(&Core::InjectClipboardEvent, this, event)); | 121 FROM_HERE, base::Bind(&Core::InjectClipboardEvent, this, event)); |
| 122 return; | 122 return; |
| 123 } | 123 } |
| 124 | 124 |
| (...skipping 84 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 209 // So we can continue capture screen bits, just from a diffected desktop. | 209 // So we can continue capture screen bits, just from a diffected desktop. |
| 210 desktop_.SetThreadDesktop(input_desktop.release()); | 210 desktop_.SetThreadDesktop(input_desktop.release()); |
| 211 } | 211 } |
| 212 } | 212 } |
| 213 | 213 |
| 214 SessionInputInjectorWin::SessionInputInjectorWin( | 214 SessionInputInjectorWin::SessionInputInjectorWin( |
| 215 scoped_refptr<base::SingleThreadTaskRunner> input_task_runner, | 215 scoped_refptr<base::SingleThreadTaskRunner> input_task_runner, |
| 216 scoped_ptr<InputInjector> nested_executor, | 216 scoped_ptr<InputInjector> nested_executor, |
| 217 scoped_refptr<base::SingleThreadTaskRunner> inject_sas_task_runner, | 217 scoped_refptr<base::SingleThreadTaskRunner> inject_sas_task_runner, |
| 218 const base::Closure& inject_sas) { | 218 const base::Closure& inject_sas) { |
| 219 core_ = new Core(input_task_runner, nested_executor.Pass(), | 219 core_ = new Core(input_task_runner, std::move(nested_executor), |
| 220 inject_sas_task_runner, inject_sas); | 220 inject_sas_task_runner, inject_sas); |
| 221 } | 221 } |
| 222 | 222 |
| 223 SessionInputInjectorWin::~SessionInputInjectorWin() { | 223 SessionInputInjectorWin::~SessionInputInjectorWin() { |
| 224 } | 224 } |
| 225 | 225 |
| 226 void SessionInputInjectorWin::Start( | 226 void SessionInputInjectorWin::Start( |
| 227 scoped_ptr<protocol::ClipboardStub> client_clipboard) { | 227 scoped_ptr<protocol::ClipboardStub> client_clipboard) { |
| 228 core_->Start(client_clipboard.Pass()); | 228 core_->Start(std::move(client_clipboard)); |
| 229 } | 229 } |
| 230 | 230 |
| 231 void SessionInputInjectorWin::InjectClipboardEvent( | 231 void SessionInputInjectorWin::InjectClipboardEvent( |
| 232 const protocol::ClipboardEvent& event) { | 232 const protocol::ClipboardEvent& event) { |
| 233 core_->InjectClipboardEvent(event); | 233 core_->InjectClipboardEvent(event); |
| 234 } | 234 } |
| 235 | 235 |
| 236 void SessionInputInjectorWin::InjectKeyEvent(const protocol::KeyEvent& event) { | 236 void SessionInputInjectorWin::InjectKeyEvent(const protocol::KeyEvent& event) { |
| 237 core_->InjectKeyEvent(event); | 237 core_->InjectKeyEvent(event); |
| 238 } | 238 } |
| 239 | 239 |
| 240 void SessionInputInjectorWin::InjectTextEvent( | 240 void SessionInputInjectorWin::InjectTextEvent( |
| 241 const protocol::TextEvent& event) { | 241 const protocol::TextEvent& event) { |
| 242 core_->InjectTextEvent(event); | 242 core_->InjectTextEvent(event); |
| 243 } | 243 } |
| 244 | 244 |
| 245 void SessionInputInjectorWin::InjectMouseEvent( | 245 void SessionInputInjectorWin::InjectMouseEvent( |
| 246 const protocol::MouseEvent& event) { | 246 const protocol::MouseEvent& event) { |
| 247 core_->InjectMouseEvent(event); | 247 core_->InjectMouseEvent(event); |
| 248 } | 248 } |
| 249 | 249 |
| 250 void SessionInputInjectorWin::InjectTouchEvent( | 250 void SessionInputInjectorWin::InjectTouchEvent( |
| 251 const protocol::TouchEvent& event) { | 251 const protocol::TouchEvent& event) { |
| 252 core_->InjectTouchEvent(event); | 252 core_->InjectTouchEvent(event); |
| 253 } | 253 } |
| 254 | 254 |
| 255 } // namespace remoting | 255 } // namespace remoting |
| OLD | NEW |