Index: remoting/host/local_input_monitor_thread_linux.cc |
diff --git a/remoting/host/local_input_monitor_thread_linux.cc b/remoting/host/local_input_monitor_thread_linux.cc |
index 1adb05498617a56f17ade25a1b4f7decf3aa2cf7..86932cc171df63bbb1e44b6facc10236e18f3cde 100644 |
--- a/remoting/host/local_input_monitor_thread_linux.cc |
+++ b/remoting/host/local_input_monitor_thread_linux.cc |
@@ -10,8 +10,11 @@ |
#include <X11/keysymdef.h> |
#include "base/basictypes.h" |
+#include "base/callback.h" |
#include "base/eintr_wrapper.h" |
-#include "remoting/host/chromoting_host.h" |
+#include "base/logging.h" |
+#include "remoting/host/mouse_move_observer.h" |
+#include "third_party/skia/include/core/SkPoint.h" |
// These includes need to be later than dictated by the style guide due to |
// Xlib header pollution, specifically the min, max, and Status macros. |
@@ -62,9 +65,15 @@ static void ProcessReply(XPointer thread, |
XRecordFreeData(data); |
} |
-LocalInputMonitorThread::LocalInputMonitorThread(ChromotingHost* host) |
+LocalInputMonitorThread::LocalInputMonitorThread( |
+ MouseMoveObserver* mouse_move_observer, |
+ const base::Closure& disconnect_callback) |
: base::SimpleThread("LocalInputMonitor"), |
- host_(host), display_(NULL), alt_pressed_(false), ctrl_pressed_(false) { |
+ mouse_move_observer_(mouse_move_observer), |
+ disconnect_callback_(disconnect_callback), |
+ display_(NULL), |
+ alt_pressed_(false), |
+ ctrl_pressed_(false) { |
wakeup_pipe_[0] = -1; |
wakeup_pipe_[1] = -1; |
CHECK_EQ(pipe(wakeup_pipe_), 0); |
@@ -164,7 +173,7 @@ void LocalInputMonitorThread::Run() { |
} |
void LocalInputMonitorThread::LocalMouseMoved(const SkIPoint& pos) { |
- host_->LocalMouseMoved(pos); |
+ mouse_move_observer_->OnLocalMouseMoved(pos); |
} |
void LocalInputMonitorThread::LocalKeyPressed(int key_code, bool down) { |
@@ -174,7 +183,7 @@ void LocalInputMonitorThread::LocalKeyPressed(int key_code, bool down) { |
} else if (key_sym == XK_Alt_L || key_sym == XK_Alt_R) { |
alt_pressed_ = down; |
} else if (alt_pressed_ && ctrl_pressed_ && key_sym == XK_Escape && down) { |
- host_->Shutdown(base::Closure()); |
+ disconnect_callback_.Run(); |
} |
} |