| OLD | NEW |
| 1 // Copyright (c) 2011 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2011 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 #ifndef LOCAL_INPUT_MONITOR_THREAD_LINUX_H_ | 5 #ifndef LOCAL_INPUT_MONITOR_THREAD_LINUX_H_ |
| 6 #define LOCAL_INPUT_MONITOR_THREAD_LINUX_H_ | 6 #define LOCAL_INPUT_MONITOR_THREAD_LINUX_H_ |
| 7 | 7 |
| 8 #include "base/callback.h" |
| 8 #include "base/compiler_specific.h" | 9 #include "base/compiler_specific.h" |
| 9 #include "base/memory/ref_counted.h" | 10 #include "base/memory/ref_counted.h" |
| 10 #include "base/threading/simple_thread.h" | 11 #include "base/threading/simple_thread.h" |
| 11 #include "third_party/skia/include/core/SkPoint.h" | 12 #include "remoting/host/local_input_monitor.h" |
| 12 | 13 |
| 13 typedef struct _XDisplay Display; | 14 typedef struct _XDisplay Display; |
| 14 | 15 |
| 16 struct SkIPoint; |
| 17 |
| 15 namespace remoting { | 18 namespace remoting { |
| 16 | 19 |
| 17 class ChromotingHost; | 20 class MouseMoveObserver; |
| 18 | 21 |
| 19 class LocalInputMonitorThread : public base::SimpleThread { | 22 class LocalInputMonitorThread : public base::SimpleThread { |
| 20 public: | 23 public: |
| 21 explicit LocalInputMonitorThread(ChromotingHost* host); | 24 LocalInputMonitorThread( |
| 25 MouseMoveObserver* mouse_move_observer, |
| 26 const base::Closure& disconnect_callback); |
| 22 virtual ~LocalInputMonitorThread(); | 27 virtual ~LocalInputMonitorThread(); |
| 23 | 28 |
| 24 void Stop(); | 29 void Stop(); |
| 25 virtual void Run() OVERRIDE; | 30 virtual void Run() OVERRIDE; |
| 26 | 31 |
| 27 void LocalMouseMoved(const SkIPoint& pos); | 32 void LocalMouseMoved(const SkIPoint& pos); |
| 28 void LocalKeyPressed(int key_code, bool down); | 33 void LocalKeyPressed(int key_code, bool down); |
| 29 | 34 |
| 30 private: | 35 private: |
| 31 scoped_refptr<ChromotingHost> host_; | 36 MouseMoveObserver* mouse_move_observer_; |
| 37 base::Closure disconnect_callback_; |
| 32 int wakeup_pipe_[2]; | 38 int wakeup_pipe_[2]; |
| 33 Display* display_; | 39 Display* display_; |
| 34 bool alt_pressed_; | 40 bool alt_pressed_; |
| 35 bool ctrl_pressed_; | 41 bool ctrl_pressed_; |
| 36 | 42 |
| 37 DISALLOW_COPY_AND_ASSIGN(LocalInputMonitorThread); | 43 DISALLOW_COPY_AND_ASSIGN(LocalInputMonitorThread); |
| 38 }; | 44 }; |
| 39 | 45 |
| 40 } // namespace remoting | 46 } // namespace remoting |
| 41 | 47 |
| 42 #endif | 48 #endif |
| OLD | NEW |