| OLD | NEW |
| 1 // Copyright 2013 The Chromium Authors. All rights reserved. | 1 // Copyright 2013 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 "media/base/user_input_monitor.h" | 5 #include "media/base/user_input_monitor.h" |
| 6 | 6 |
| 7 #include <sys/select.h> | 7 #include <sys/select.h> |
| 8 #include <unistd.h> | 8 #include <unistd.h> |
| 9 #define XK_MISCELLANY | 9 #define XK_MISCELLANY |
| 10 #include <X11/keysymdef.h> | 10 #include <X11/keysymdef.h> |
| (...skipping 50 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 61 private: | 61 private: |
| 62 // base::MessagePumpLibevent::Watcher interface. | 62 // base::MessagePumpLibevent::Watcher interface. |
| 63 void OnFileCanReadWithoutBlocking(int fd) override; | 63 void OnFileCanReadWithoutBlocking(int fd) override; |
| 64 void OnFileCanWriteWithoutBlocking(int fd) override; | 64 void OnFileCanWriteWithoutBlocking(int fd) override; |
| 65 | 65 |
| 66 // Processes key and mouse events. | 66 // Processes key and mouse events. |
| 67 void ProcessXEvent(xEvent* event); | 67 void ProcessXEvent(xEvent* event); |
| 68 static void ProcessReply(XPointer self, XRecordInterceptData* data); | 68 static void ProcessReply(XPointer self, XRecordInterceptData* data); |
| 69 | 69 |
| 70 scoped_refptr<base::SingleThreadTaskRunner> io_task_runner_; | 70 scoped_refptr<base::SingleThreadTaskRunner> io_task_runner_; |
| 71 scoped_refptr<ObserverListThreadSafe<UserInputMonitor::MouseEventListener> > | 71 scoped_refptr<base::ObserverListThreadSafe< |
| 72 mouse_listeners_; | 72 UserInputMonitor::MouseEventListener>> mouse_listeners_; |
| 73 | 73 |
| 74 // | 74 // |
| 75 // The following members should only be accessed on the IO thread. | 75 // The following members should only be accessed on the IO thread. |
| 76 // | 76 // |
| 77 base::MessagePumpLibevent::FileDescriptorWatcher controller_; | 77 base::MessagePumpLibevent::FileDescriptorWatcher controller_; |
| 78 Display* x_control_display_; | 78 Display* x_control_display_; |
| 79 Display* x_record_display_; | 79 Display* x_record_display_; |
| 80 XRecordRange* x_record_range_[2]; | 80 XRecordRange* x_record_range_[2]; |
| 81 XRecordContext x_record_context_; | 81 XRecordContext x_record_context_; |
| 82 KeyboardEventCounter counter_; | 82 KeyboardEventCounter counter_; |
| (...skipping 292 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 375 } // namespace | 375 } // namespace |
| 376 | 376 |
| 377 scoped_ptr<UserInputMonitor> UserInputMonitor::Create( | 377 scoped_ptr<UserInputMonitor> UserInputMonitor::Create( |
| 378 const scoped_refptr<base::SingleThreadTaskRunner>& io_task_runner, | 378 const scoped_refptr<base::SingleThreadTaskRunner>& io_task_runner, |
| 379 const scoped_refptr<base::SingleThreadTaskRunner>& ui_task_runner) { | 379 const scoped_refptr<base::SingleThreadTaskRunner>& ui_task_runner) { |
| 380 return scoped_ptr<UserInputMonitor>( | 380 return scoped_ptr<UserInputMonitor>( |
| 381 new UserInputMonitorLinux(io_task_runner)); | 381 new UserInputMonitorLinux(io_task_runner)); |
| 382 } | 382 } |
| 383 | 383 |
| 384 } // namespace media | 384 } // namespace media |
| OLD | NEW |