| 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 191 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 202 | 202 |
| 203 clipboard_->Start(client_clipboard.Pass()); | 203 clipboard_->Start(client_clipboard.Pass()); |
| 204 } | 204 } |
| 205 | 205 |
| 206 void InputInjectorWin::Core::Stop() { | 206 void InputInjectorWin::Core::Stop() { |
| 207 if (!ui_task_runner_->BelongsToCurrentThread()) { | 207 if (!ui_task_runner_->BelongsToCurrentThread()) { |
| 208 ui_task_runner_->PostTask(FROM_HERE, base::Bind(&Core::Stop, this)); | 208 ui_task_runner_->PostTask(FROM_HERE, base::Bind(&Core::Stop, this)); |
| 209 return; | 209 return; |
| 210 } | 210 } |
| 211 | 211 |
| 212 clipboard_->Stop(); | 212 clipboard_.reset(); |
| 213 } | 213 } |
| 214 | 214 |
| 215 InputInjectorWin::Core::~Core() {} | 215 InputInjectorWin::Core::~Core() {} |
| 216 | 216 |
| 217 void InputInjectorWin::Core::HandleKey(const KeyEvent& event) { | 217 void InputInjectorWin::Core::HandleKey(const KeyEvent& event) { |
| 218 // HostEventDispatcher should filter events missing the pressed field. | 218 // HostEventDispatcher should filter events missing the pressed field. |
| 219 DCHECK(event.has_pressed() && event.has_usb_keycode()); | 219 DCHECK(event.has_pressed() && event.has_usb_keycode()); |
| 220 | 220 |
| 221 // Reset the system idle suspend timeout. | 221 // Reset the system idle suspend timeout. |
| 222 SetThreadExecutionState(ES_SYSTEM_REQUIRED); | 222 SetThreadExecutionState(ES_SYSTEM_REQUIRED); |
| (...skipping 100 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 323 } // namespace | 323 } // namespace |
| 324 | 324 |
| 325 scoped_ptr<InputInjector> InputInjector::Create( | 325 scoped_ptr<InputInjector> InputInjector::Create( |
| 326 scoped_refptr<base::SingleThreadTaskRunner> main_task_runner, | 326 scoped_refptr<base::SingleThreadTaskRunner> main_task_runner, |
| 327 scoped_refptr<base::SingleThreadTaskRunner> ui_task_runner) { | 327 scoped_refptr<base::SingleThreadTaskRunner> ui_task_runner) { |
| 328 return make_scoped_ptr( | 328 return make_scoped_ptr( |
| 329 new InputInjectorWin(main_task_runner, ui_task_runner)); | 329 new InputInjectorWin(main_task_runner, ui_task_runner)); |
| 330 } | 330 } |
| 331 | 331 |
| 332 } // namespace remoting | 332 } // namespace remoting |
| OLD | NEW |