| 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_WIN_H_ | 5 #ifndef LOCAL_INPUT_MONITOR_THREAD_WIN_H_ |
| 6 #define LOCAL_INPUT_MONITOR_THREAD_WIN_H_ | 6 #define LOCAL_INPUT_MONITOR_THREAD_WIN_H_ |
| 7 | 7 |
| 8 #include <set> | 8 #include <set> |
| 9 | 9 |
| 10 #include "base/compiler_specific.h" | 10 #include "base/compiler_specific.h" |
| 11 #include "base/memory/ref_counted.h" | 11 #include "base/memory/ref_counted.h" |
| 12 #include "base/synchronization/lock.h" | 12 #include "base/synchronization/lock.h" |
| 13 #include "base/threading/simple_thread.h" | 13 #include "base/threading/simple_thread.h" |
| 14 #include "remoting/host/chromoting_host.h" | 14 |
| 15 struct SkIPoint; |
| 15 | 16 |
| 16 namespace remoting { | 17 namespace remoting { |
| 17 | 18 |
| 19 class MouseMoveObserver; |
| 20 |
| 18 class LocalInputMonitorThread : public base::SimpleThread { | 21 class LocalInputMonitorThread : public base::SimpleThread { |
| 19 public: | 22 public: |
| 20 static void AddHostToInputMonitor(ChromotingHost* host); | 23 static void AddMouseMoveObserver(MouseMoveObserver* mouse_move_observer); |
| 21 static void RemoveHostFromInputMonitor(ChromotingHost* host); | 24 static void RemoveMouseMoveObserver(MouseMoveObserver* mouse_move_observer); |
| 22 | 25 |
| 23 private: | 26 private: |
| 24 LocalInputMonitorThread(); | 27 LocalInputMonitorThread(); |
| 25 virtual ~LocalInputMonitorThread(); | 28 virtual ~LocalInputMonitorThread(); |
| 26 | 29 |
| 27 void AddHost(ChromotingHost* host); | 30 void AddObserver(MouseMoveObserver* mouse_move_observer); |
| 28 bool RemoveHost(ChromotingHost* host); | 31 bool RemoveObserver(MouseMoveObserver* mouse_move_observer); |
| 29 | 32 |
| 30 void Stop(); | 33 void Stop(); |
| 31 virtual void Run() OVERRIDE; // Overridden from SimpleThread. | 34 virtual void Run() OVERRIDE; // Overridden from SimpleThread. |
| 32 | 35 |
| 33 void LocalMouseMoved(const SkIPoint& mouse_position); | 36 void LocalMouseMoved(const SkIPoint& mouse_position); |
| 34 static LRESULT WINAPI HandleLowLevelMouseEvent(int code, | 37 static LRESULT WINAPI HandleLowLevelMouseEvent(int code, |
| 35 WPARAM event_type, | 38 WPARAM event_type, |
| 36 LPARAM event_data); | 39 LPARAM event_data); |
| 37 | 40 |
| 38 base::Lock hosts_lock_; | 41 base::Lock lock_; |
| 39 typedef std::set<scoped_refptr<ChromotingHost> > ChromotingHosts; | 42 typedef std::set<MouseMoveObserver*> MouseMoveObservers; |
| 40 ChromotingHosts hosts_; | 43 MouseMoveObservers observers_; |
| 41 | 44 |
| 42 DISALLOW_COPY_AND_ASSIGN(LocalInputMonitorThread); | 45 DISALLOW_COPY_AND_ASSIGN(LocalInputMonitorThread); |
| 43 }; | 46 }; |
| 44 | 47 |
| 45 } // namespace remoting | 48 } // namespace remoting |
| 46 | 49 |
| 47 #endif | 50 #endif |
| OLD | NEW |