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 <X11/extensions/XInput.h> | 7 #include <X11/extensions/XInput.h> |
8 #include <X11/extensions/XTest.h> | 8 #include <X11/extensions/XTest.h> |
9 #include <X11/Xlib.h> | 9 #include <X11/Xlib.h> |
10 #include <X11/XKBlib.h> | 10 #include <X11/XKBlib.h> |
(...skipping 89 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
100 virtual void InjectClipboardEvent(const ClipboardEvent& event) OVERRIDE; | 100 virtual void InjectClipboardEvent(const ClipboardEvent& event) OVERRIDE; |
101 | 101 |
102 // InputStub interface. | 102 // InputStub interface. |
103 virtual void InjectKeyEvent(const KeyEvent& event) OVERRIDE; | 103 virtual void InjectKeyEvent(const KeyEvent& event) OVERRIDE; |
104 virtual void InjectTextEvent(const TextEvent& event) OVERRIDE; | 104 virtual void InjectTextEvent(const TextEvent& event) OVERRIDE; |
105 virtual void InjectMouseEvent(const MouseEvent& event) OVERRIDE; | 105 virtual void InjectMouseEvent(const MouseEvent& event) OVERRIDE; |
106 | 106 |
107 // InputInjector interface. | 107 // InputInjector interface. |
108 virtual void Start( | 108 virtual void Start( |
109 scoped_ptr<protocol::ClipboardStub> client_clipboard) OVERRIDE; | 109 scoped_ptr<protocol::ClipboardStub> client_clipboard) OVERRIDE; |
| 110 void EnableWindowInjection(webrtc::WindowId window_id); |
110 | 111 |
111 private: | 112 private: |
112 // The actual implementation resides in InputInjectorLinux::Core class. | 113 // The actual implementation resides in InputInjectorLinux::Core class. |
113 class Core : public base::RefCountedThreadSafe<Core> { | 114 class Core : public base::RefCountedThreadSafe<Core> { |
114 public: | 115 public: |
115 explicit Core(scoped_refptr<base::SingleThreadTaskRunner> task_runner); | 116 explicit Core(scoped_refptr<base::SingleThreadTaskRunner> task_runner); |
116 | 117 |
117 bool Init(); | 118 bool Init(); |
118 | 119 |
119 // Mirrors the ClipboardStub interface. | 120 // Mirrors the ClipboardStub interface. |
(...skipping 91 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
211 | 212 |
212 void InputInjectorLinux::InjectMouseEvent(const MouseEvent& event) { | 213 void InputInjectorLinux::InjectMouseEvent(const MouseEvent& event) { |
213 core_->InjectMouseEvent(event); | 214 core_->InjectMouseEvent(event); |
214 } | 215 } |
215 | 216 |
216 void InputInjectorLinux::Start( | 217 void InputInjectorLinux::Start( |
217 scoped_ptr<protocol::ClipboardStub> client_clipboard) { | 218 scoped_ptr<protocol::ClipboardStub> client_clipboard) { |
218 core_->Start(client_clipboard.Pass()); | 219 core_->Start(client_clipboard.Pass()); |
219 } | 220 } |
220 | 221 |
| 222 void EnableWindowInjection(webrtc::WindowId window_id) { |
| 223 NOTIMPLEMENTED(); |
| 224 } |
| 225 |
221 InputInjectorLinux::Core::Core( | 226 InputInjectorLinux::Core::Core( |
222 scoped_refptr<base::SingleThreadTaskRunner> task_runner) | 227 scoped_refptr<base::SingleThreadTaskRunner> task_runner) |
223 : task_runner_(task_runner), | 228 : task_runner_(task_runner), |
224 latest_mouse_position_(-1, -1), | 229 latest_mouse_position_(-1, -1), |
225 wheel_ticks_x_(0.0f), | 230 wheel_ticks_x_(0.0f), |
226 wheel_ticks_y_(0.0f), | 231 wheel_ticks_y_(0.0f), |
227 display_(XOpenDisplay(NULL)), | 232 display_(XOpenDisplay(NULL)), |
228 root_window_(BadValue), | 233 root_window_(BadValue), |
229 saved_auto_repeat_enabled_(false) { | 234 saved_auto_repeat_enabled_(false) { |
230 } | 235 } |
(...skipping 373 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
604 scoped_ptr<InputInjector> InputInjector::Create( | 609 scoped_ptr<InputInjector> InputInjector::Create( |
605 scoped_refptr<base::SingleThreadTaskRunner> main_task_runner, | 610 scoped_refptr<base::SingleThreadTaskRunner> main_task_runner, |
606 scoped_refptr<base::SingleThreadTaskRunner> ui_task_runner) { | 611 scoped_refptr<base::SingleThreadTaskRunner> ui_task_runner) { |
607 scoped_ptr<InputInjectorLinux> injector( | 612 scoped_ptr<InputInjectorLinux> injector( |
608 new InputInjectorLinux(main_task_runner)); | 613 new InputInjectorLinux(main_task_runner)); |
609 if (!injector->Init()) | 614 if (!injector->Init()) |
610 return scoped_ptr<InputInjector>(); | 615 return scoped_ptr<InputInjector>(); |
611 return injector.PassAs<InputInjector>(); | 616 return injector.PassAs<InputInjector>(); |
612 } | 617 } |
613 | 618 |
| 619 scoped_ptr<InputInjector> InputInjector::CreateForWindow( |
| 620 scoped_refptr<base::SingleThreadTaskRunner> main_task_runner, |
| 621 scoped_refptr<base::SingleThreadTaskRunner> ui_task_runner, |
| 622 webrtc::WindowId windowId) { |
| 623 } |
| 624 |
614 } // namespace remoting | 625 } // namespace remoting |
OLD | NEW |