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 41 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
52 using protocol::KeyEvent; | 52 using protocol::KeyEvent; |
53 using protocol::TextEvent; | 53 using protocol::TextEvent; |
54 using protocol::MouseEvent; | 54 using protocol::MouseEvent; |
55 using protocol::TouchEvent; | 55 using protocol::TouchEvent; |
56 | 56 |
57 // A class to generate events on Windows. | 57 // A class to generate events on Windows. |
58 class InputInjectorWin : public InputInjector { | 58 class InputInjectorWin : public InputInjector { |
59 public: | 59 public: |
60 InputInjectorWin(scoped_refptr<base::SingleThreadTaskRunner> main_task_runner, | 60 InputInjectorWin(scoped_refptr<base::SingleThreadTaskRunner> main_task_runner, |
61 scoped_refptr<base::SingleThreadTaskRunner> ui_task_runner); | 61 scoped_refptr<base::SingleThreadTaskRunner> ui_task_runner); |
62 virtual ~InputInjectorWin(); | 62 ~InputInjectorWin() override; |
63 | 63 |
64 // ClipboardStub interface. | 64 // ClipboardStub interface. |
65 virtual void InjectClipboardEvent(const ClipboardEvent& event) override; | 65 void InjectClipboardEvent(const ClipboardEvent& event) override; |
66 | 66 |
67 // InputStub interface. | 67 // InputStub interface. |
68 virtual void InjectKeyEvent(const KeyEvent& event) override; | 68 void InjectKeyEvent(const KeyEvent& event) override; |
69 virtual void InjectTextEvent(const TextEvent& event) override; | 69 void InjectTextEvent(const TextEvent& event) override; |
70 virtual void InjectMouseEvent(const MouseEvent& event) override; | 70 void InjectMouseEvent(const MouseEvent& event) override; |
71 virtual void InjectTouchEvent(const TouchEvent& event) override; | 71 void InjectTouchEvent(const TouchEvent& event) override; |
72 | 72 |
73 // InputInjector interface. | 73 // InputInjector interface. |
74 virtual void Start( | 74 void Start( |
75 scoped_ptr<protocol::ClipboardStub> client_clipboard) override; | 75 scoped_ptr<protocol::ClipboardStub> client_clipboard) override; |
76 | 76 |
77 private: | 77 private: |
78 // The actual implementation resides in InputInjectorWin::Core class. | 78 // The actual implementation resides in InputInjectorWin::Core class. |
79 class Core : public base::RefCountedThreadSafe<Core> { | 79 class Core : public base::RefCountedThreadSafe<Core> { |
80 public: | 80 public: |
81 Core(scoped_refptr<base::SingleThreadTaskRunner> main_task_runner, | 81 Core(scoped_refptr<base::SingleThreadTaskRunner> main_task_runner, |
82 scoped_refptr<base::SingleThreadTaskRunner> ui_task_runner); | 82 scoped_refptr<base::SingleThreadTaskRunner> ui_task_runner); |
83 | 83 |
84 // Mirrors the ClipboardStub interface. | 84 // Mirrors the ClipboardStub interface. |
(...skipping 264 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
349 } // namespace | 349 } // namespace |
350 | 350 |
351 scoped_ptr<InputInjector> InputInjector::Create( | 351 scoped_ptr<InputInjector> InputInjector::Create( |
352 scoped_refptr<base::SingleThreadTaskRunner> main_task_runner, | 352 scoped_refptr<base::SingleThreadTaskRunner> main_task_runner, |
353 scoped_refptr<base::SingleThreadTaskRunner> ui_task_runner) { | 353 scoped_refptr<base::SingleThreadTaskRunner> ui_task_runner) { |
354 return make_scoped_ptr( | 354 return make_scoped_ptr( |
355 new InputInjectorWin(main_task_runner, ui_task_runner)); | 355 new InputInjectorWin(main_task_runner, ui_task_runner)); |
356 } | 356 } |
357 | 357 |
358 } // namespace remoting | 358 } // namespace remoting |
OLD | NEW |