kelvinp | 95f54840 | 2014-11-13 21:42:20 | [diff] [blame] | 1 | // Copyright 2014 The Chromium Authors. All rights reserved. |
| 2 | // Use of this source code is governed by a BSD-style license that can be |
| 3 | // found in the LICENSE file. |
| 4 | |
| 5 | #ifndef REMOTING_HOST_INPUT_INJECTOR_CHROMEOS_H_ |
| 6 | #define REMOTING_HOST_INPUT_INJECTOR_CHROMEOS_H_ |
| 7 | |
avi | c5960f3 | 2015-12-22 22:49:48 | [diff] [blame] | 8 | #include "base/macros.h" |
kelvinp | 95f54840 | 2014-11-13 21:42:20 | [diff] [blame] | 9 | #include "base/single_thread_task_runner.h" |
| 10 | #include "remoting/host/input_injector.h" |
| 11 | |
| 12 | namespace remoting { |
| 13 | |
| 14 | // InputInjector implementation that translates input to ui::Events and passes |
| 15 | // them to a supplied delegate for injection into ChromeOS. |
| 16 | class InputInjectorChromeos : public InputInjector { |
| 17 | public: |
| 18 | explicit InputInjectorChromeos( |
| 19 | scoped_refptr<base::SingleThreadTaskRunner> task_runner); |
| 20 | |
| 21 | ~InputInjectorChromeos() override; |
| 22 | |
| 23 | // Clipboard stub interface. |
| 24 | void InjectClipboardEvent(const protocol::ClipboardEvent& event) override; |
| 25 | |
| 26 | // InputStub interface. |
| 27 | void InjectKeyEvent(const protocol::KeyEvent& event) override; |
| 28 | void InjectTextEvent(const protocol::TextEvent& event) override; |
| 29 | void InjectMouseEvent(const protocol::MouseEvent& event) override; |
rkuroiwa | 0e68803f | 2015-02-26 19:41:42 | [diff] [blame] | 30 | void InjectTouchEvent(const protocol::TouchEvent& event) override; |
kelvinp | 95f54840 | 2014-11-13 21:42:20 | [diff] [blame] | 31 | |
| 32 | // InputInjector interface. |
dcheng | 0765c49 | 2016-04-06 22:41:53 | [diff] [blame] | 33 | void Start( |
| 34 | std::unique_ptr<protocol::ClipboardStub> client_clipboard) override; |
kelvinp | 95f54840 | 2014-11-13 21:42:20 | [diff] [blame] | 35 | |
| 36 | private: |
kelvinp | cc35531 | 2014-12-09 21:44:25 | [diff] [blame] | 37 | class Core; |
| 38 | |
kelvinp | 95f54840 | 2014-11-13 21:42:20 | [diff] [blame] | 39 | // Task runner for input injection. |
| 40 | scoped_refptr<base::SingleThreadTaskRunner> input_task_runner_; |
dcheng | 0765c49 | 2016-04-06 22:41:53 | [diff] [blame] | 41 | std::unique_ptr<Core> core_; |
kelvinp | 95f54840 | 2014-11-13 21:42:20 | [diff] [blame] | 42 | |
| 43 | DISALLOW_COPY_AND_ASSIGN(InputInjectorChromeos); |
| 44 | }; |
| 45 | |
| 46 | } // namespace remoting |
| 47 | |
| 48 | #endif // REMOTING_HOST_INPUT_INJECTOR_CHROMEOS_H_ |