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/input_injector.h" | 5 #include "remoting/host/input_injector.h" |
6 | 6 |
7 #include <windows.h> | 7 #include <windows.h> |
8 | 8 |
9 #include "base/bind.h" | 9 #include "base/bind.h" |
10 #include "base/compiler_specific.h" | 10 #include "base/compiler_specific.h" |
(...skipping 131 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
142 void InputInjectorWin::InjectMouseEvent(const MouseEvent& event) { | 142 void InputInjectorWin::InjectMouseEvent(const MouseEvent& event) { |
143 core_->InjectMouseEvent(event); | 143 core_->InjectMouseEvent(event); |
144 } | 144 } |
145 | 145 |
146 void InputInjectorWin::InjectTouchEvent(const TouchEvent& event) { | 146 void InputInjectorWin::InjectTouchEvent(const TouchEvent& event) { |
147 core_->InjectTouchEvent(event); | 147 core_->InjectTouchEvent(event); |
148 } | 148 } |
149 | 149 |
150 void InputInjectorWin::Start( | 150 void InputInjectorWin::Start( |
151 scoped_ptr<protocol::ClipboardStub> client_clipboard) { | 151 scoped_ptr<protocol::ClipboardStub> client_clipboard) { |
152 core_->Start(client_clipboard.Pass()); | 152 core_->Start(std::move(client_clipboard)); |
153 } | 153 } |
154 | 154 |
155 InputInjectorWin::Core::Core( | 155 InputInjectorWin::Core::Core( |
156 scoped_refptr<base::SingleThreadTaskRunner> main_task_runner, | 156 scoped_refptr<base::SingleThreadTaskRunner> main_task_runner, |
157 scoped_refptr<base::SingleThreadTaskRunner> ui_task_runner) | 157 scoped_refptr<base::SingleThreadTaskRunner> ui_task_runner) |
158 : main_task_runner_(main_task_runner), | 158 : main_task_runner_(main_task_runner), |
159 ui_task_runner_(ui_task_runner), | 159 ui_task_runner_(ui_task_runner), |
160 clipboard_(Clipboard::Create()) { | 160 clipboard_(Clipboard::Create()) { |
161 } | 161 } |
162 | 162 |
(...skipping 50 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
213 | 213 |
214 void InputInjectorWin::Core::Start( | 214 void InputInjectorWin::Core::Start( |
215 scoped_ptr<protocol::ClipboardStub> client_clipboard) { | 215 scoped_ptr<protocol::ClipboardStub> client_clipboard) { |
216 if (!ui_task_runner_->BelongsToCurrentThread()) { | 216 if (!ui_task_runner_->BelongsToCurrentThread()) { |
217 ui_task_runner_->PostTask( | 217 ui_task_runner_->PostTask( |
218 FROM_HERE, | 218 FROM_HERE, |
219 base::Bind(&Core::Start, this, base::Passed(&client_clipboard))); | 219 base::Bind(&Core::Start, this, base::Passed(&client_clipboard))); |
220 return; | 220 return; |
221 } | 221 } |
222 | 222 |
223 clipboard_->Start(client_clipboard.Pass()); | 223 clipboard_->Start(std::move(client_clipboard)); |
224 touch_injector_.Init(); | 224 touch_injector_.Init(); |
225 } | 225 } |
226 | 226 |
227 void InputInjectorWin::Core::Stop() { | 227 void InputInjectorWin::Core::Stop() { |
228 if (!ui_task_runner_->BelongsToCurrentThread()) { | 228 if (!ui_task_runner_->BelongsToCurrentThread()) { |
229 ui_task_runner_->PostTask(FROM_HERE, base::Bind(&Core::Stop, this)); | 229 ui_task_runner_->PostTask(FROM_HERE, base::Bind(&Core::Stop, this)); |
230 return; | 230 return; |
231 } | 231 } |
232 | 232 |
233 clipboard_.reset(); | 233 clipboard_.reset(); |
(...skipping 121 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
355 return make_scoped_ptr( | 355 return make_scoped_ptr( |
356 new InputInjectorWin(main_task_runner, ui_task_runner)); | 356 new InputInjectorWin(main_task_runner, ui_task_runner)); |
357 } | 357 } |
358 | 358 |
359 // static | 359 // static |
360 bool InputInjector::SupportsTouchEvents() { | 360 bool InputInjector::SupportsTouchEvents() { |
361 return TouchInjectorWinDelegate::Create(); | 361 return TouchInjectorWinDelegate::Create(); |
362 } | 362 } |
363 | 363 |
364 } // namespace remoting | 364 } // namespace remoting |
OLD | NEW |