summaryrefslogtreecommitdiffstats
path: root/remoting/host
diff options
context:
space:
mode:
authorsergeyu@chromium.org <sergeyu@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2010-12-02 20:23:35 +0000
committersergeyu@chromium.org <sergeyu@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2010-12-02 20:23:35 +0000
commit2c22968fe57ea2f1e6a4e4d1fdca3c38d3dc483c (patch)
treee7f154f5f3fb1a27144bee9881e5f4c2a1fd30a9 /remoting/host
parent1a6e72c054869c988f224e68a45d4a580d596be8 (diff)
downloadchromium_src-2c22968fe57ea2f1e6a4e4d1fdca3c38d3dc483c.zip
chromium_src-2c22968fe57ea2f1e6a4e4d1fdca3c38d3dc483c.tar.gz
chromium_src-2c22968fe57ea2f1e6a4e4d1fdca3c38d3dc483c.tar.bz2
Move move classes to the remoting::protocol namespace. Minor cleanups.
BUG=None TEST=compiles, unittests Review URL: http://codereview.chromium.org/5068001 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@68056 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'remoting/host')
-rw-r--r--remoting/host/event_executor_linux.cc15
-rw-r--r--remoting/host/event_executor_linux.h4
-rw-r--r--remoting/host/event_executor_mac.cc3
-rw-r--r--remoting/host/event_executor_mac.h4
-rw-r--r--remoting/host/event_executor_win.cc14
-rw-r--r--remoting/host/event_executor_win.h8
6 files changed, 29 insertions, 19 deletions
diff --git a/remoting/host/event_executor_linux.cc b/remoting/host/event_executor_linux.cc
index f540d44..5096fac 100644
--- a/remoting/host/event_executor_linux.cc
+++ b/remoting/host/event_executor_linux.cc
@@ -15,18 +15,22 @@
namespace remoting {
-static int MouseButtonToX11ButtonNumber(MouseButton button) {
+using protocol::MouseEvent;
+using protocol::KeyEvent;
+
+static int MouseButtonToX11ButtonNumber(
+ protocol::MouseEvent::MouseButton button) {
switch (button) {
- case MouseButtonLeft:
+ case MouseEvent::BUTTON_LEFT:
return 1;
- case MouseButtonRight:
+ case MouseEvent::BUTTON_RIGHT:
return 2;
- case MouseButtonMiddle:
+ case MouseEvent::BUTTON_MIDDLE:
return 3;
- case MouseButtonUndefined:
+ case MouseEvent::BUTTON_UNDEFINED:
default:
return -1;
}
@@ -202,6 +206,7 @@ class EventExecutorLinuxPimpl {
~EventExecutorLinuxPimpl();
bool Init(); // TODO(ajwong): Do we really want this to be synchronous?
+
void HandleMouse(const MouseEvent* message);
void HandleKey(const KeyEvent* key_event);
diff --git a/remoting/host/event_executor_linux.h b/remoting/host/event_executor_linux.h
index af765f8..c20b06f 100644
--- a/remoting/host/event_executor_linux.h
+++ b/remoting/host/event_executor_linux.h
@@ -24,8 +24,8 @@ class EventExecutorLinux : public protocol::InputStub {
Capturer* capturer);
virtual ~EventExecutorLinux();
- virtual void InjectKeyEvent(const KeyEvent* event, Task* done);
- virtual void InjectMouseEvent(const MouseEvent* event, Task* done);
+ virtual void InjectKeyEvent(const protocol::KeyEvent* event, Task* done);
+ virtual void InjectMouseEvent(const protocol::MouseEvent* event, Task* done);
private:
MessageLoop* message_loop_;
diff --git a/remoting/host/event_executor_mac.cc b/remoting/host/event_executor_mac.cc
index e89ad33..37041a8 100644
--- a/remoting/host/event_executor_mac.cc
+++ b/remoting/host/event_executor_mac.cc
@@ -10,6 +10,9 @@
namespace remoting {
+using protocol::MouseEvent;
+using protocol::KeyEvent;
+
EventExecutorMac::EventExecutorMac(
MessageLoop* message_loop, Capturer* capturer)
: message_loop_(message_loop),
diff --git a/remoting/host/event_executor_mac.h b/remoting/host/event_executor_mac.h
index 0e38852..758ccc0 100644
--- a/remoting/host/event_executor_mac.h
+++ b/remoting/host/event_executor_mac.h
@@ -19,8 +19,8 @@ class EventExecutorMac : public protocol::InputStub {
EventExecutorMac(MessageLoop* message_loop, Capturer* capturer);
virtual ~EventExecutorMac();
- virtual void InjectKeyEvent(const KeyEvent* event, Task* done);
- virtual void InjectMouseEvent(const MouseEvent* event, Task* done);
+ virtual void InjectKeyEvent(const protocol::KeyEvent* event, Task* done);
+ virtual void InjectMouseEvent(const protocol::MouseEvent* event, Task* done);
private:
MessageLoop* message_loop_;
diff --git a/remoting/host/event_executor_win.cc b/remoting/host/event_executor_win.cc
index f79d9eb..1fe3beb 100644
--- a/remoting/host/event_executor_win.cc
+++ b/remoting/host/event_executor_win.cc
@@ -14,6 +14,9 @@
namespace remoting {
+using protocol::MouseEvent;
+using protocol::KeyEvent;
+
EventExecutorWin::EventExecutorWin(
MessageLoop* message_loop, Capturer* capturer)
: message_loop_(message_loop),
@@ -36,8 +39,7 @@ void EventExecutorWin::InjectKeyEvent(const KeyEvent* event, Task* done) {
delete done;
}
-void EventExecutorWin::InjectMouseEvent(const MouseEvent* event,
- Task* done) {
+void EventExecutorWin::InjectMouseEvent(const MouseEvent* event, Task* done) {
if (MessageLoop::current() != message_loop_) {
message_loop_->PostTask(
FROM_HERE,
@@ -126,15 +128,15 @@ void EventExecutorWin::HandleMouse(const MouseEvent* event) {
button_event.mi.dx = 0;
button_event.mi.dy = 0;
- MouseButton button = event->button();
+ MouseEvent::MouseButton button = event->button();
bool down = event->button_down();
- if (button == MouseButtonLeft) {
+ if (button == MouseEvent::BUTTON_LEFT) {
button_event.mi.dwFlags =
down ? MOUSEEVENTF_LEFTDOWN : MOUSEEVENTF_LEFTUP;
- } else if (button == MouseButtonMiddle) {
+ } else if (button == MouseEvent::BUTTON_MIDDLE) {
button_event.mi.dwFlags =
down ? MOUSEEVENTF_MIDDLEDOWN : MOUSEEVENTF_MIDDLEUP;
- } else if (button == MouseButtonRight) {
+ } else if (button == MouseEvent::BUTTON_RIGHT) {
button_event.mi.dwFlags =
down ? MOUSEEVENTF_RIGHTDOWN : MOUSEEVENTF_RIGHTUP;
} else {
diff --git a/remoting/host/event_executor_win.h b/remoting/host/event_executor_win.h
index b7be3c8..4ba4aad 100644
--- a/remoting/host/event_executor_win.h
+++ b/remoting/host/event_executor_win.h
@@ -23,12 +23,12 @@ class EventExecutorWin : public protocol::InputStub {
EventExecutorWin(MessageLoop* message_loop, Capturer* capturer);
virtual ~EventExecutorWin();
- virtual void InjectKeyEvent(const KeyEvent* event, Task* done);
- virtual void InjectMouseEvent(const MouseEvent* event, Task* done);
+ virtual void InjectKeyEvent(const protocol::KeyEvent* event, Task* done);
+ virtual void InjectMouseEvent(const protocol::MouseEvent* event, Task* done);
private:
- void HandleKey(const KeyEvent* event);
- void HandleMouse(const MouseEvent* event);
+ void HandleKey(const protocol::KeyEvent* event);
+ void HandleMouse(const protocol::MouseEvent* event);
MessageLoop* message_loop_;
Capturer* capturer_;