Chromium Code Reviews| Index: remoting/host/event_executor_mac.cc |
| diff --git a/remoting/host/event_executor_mac.cc b/remoting/host/event_executor_mac.cc |
| index 808f964f1e96de2ecb9990d2f489997805ae5ac5..80524dd02a17363446eb939c924cb029319ce084 100644 |
| --- a/remoting/host/event_executor_mac.cc |
| +++ b/remoting/host/event_executor_mac.cc |
| @@ -2,11 +2,12 @@ |
| // Use of this source code is governed by a BSD-style license that can be |
| // found in the LICENSE file. |
| -#include "remoting/host/event_executor_mac.h" |
| +#include "remoting/host/event_executor.h" |
| #include <ApplicationServices/ApplicationServices.h> |
| #include <Carbon/Carbon.h> |
| +#include "base/compiler_specific.h" |
| #include "base/message_loop.h" |
| #include "base/task.h" |
| #include "base/mac/scoped_cftyperef.h" |
|
Lambros
2011/04/01 15:54:00
Nit: alphabetize
dmac
2011/04/01 21:15:07
Done.
|
| @@ -16,9 +17,29 @@ |
| namespace remoting { |
| +namespace { |
| + |
| using protocol::MouseEvent; |
| using protocol::KeyEvent; |
| +// A class to generate events on Mac. |
| +class EventExecutorMac : public EventExecutor { |
| + public: |
| + EventExecutorMac(MessageLoopForUI* message_loop, Capturer* capturer); |
| + virtual ~EventExecutorMac() {} |
| + |
| + virtual void InjectKeyEvent(const KeyEvent* event, Task* done) OVERRIDE; |
| + virtual void InjectMouseEvent(const MouseEvent* event, Task* done) OVERRIDE; |
| + |
| + private: |
| + MessageLoopForUI* message_loop_; |
| + Capturer* capturer_; |
| + int last_x_, last_y_; |
| + int modifiers_, mouse_buttons_; |
| + |
| + DISALLOW_COPY_AND_ASSIGN(EventExecutorMac); |
| +}; |
| + |
| EventExecutorMac::EventExecutorMac( |
| MessageLoopForUI* message_loop, Capturer* capturer) |
| : message_loop_(message_loop), |
| @@ -26,9 +47,6 @@ EventExecutorMac::EventExecutorMac( |
| mouse_buttons_(0) { |
| } |
| -EventExecutorMac::~EventExecutorMac() { |
| -} |
| - |
| // Hard-coded mapping from Virtual Key codes to Mac KeySyms. |
| // This mapping is only valid if both client and host are using a |
| // US English keyboard layout. |
| @@ -287,8 +305,10 @@ void EventExecutorMac::InjectMouseEvent(const MouseEvent* event, Task* done) { |
| delete done; |
| } |
| -protocol::InputStub* CreateEventExecutor(MessageLoopForUI* message_loop, |
| - Capturer* capturer) { |
| +} // namespace |
| + |
| +EventExecutor* EventExecutor::Create(MessageLoopForUI* message_loop, |
| + Capturer* capturer) { |
| return new EventExecutorMac(message_loop, capturer); |
| } |