diff options
author | dmaclach@chromium.org <dmaclach@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2011-04-04 22:44:11 +0000 |
---|---|---|
committer | dmaclach@chromium.org <dmaclach@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2011-04-04 22:44:11 +0000 |
commit | 0b7e42805341699a240997b202d4d23aed4b458b (patch) | |
tree | 44b31edf61ace0f552a113dd56368768d9774598 /remoting/host/event_executor_mac.cc | |
parent | 167d52bbfbfc80f2232474eddfeb8bc587008d71 (diff) | |
download | chromium_src-0b7e42805341699a240997b202d4d23aed4b458b.zip chromium_src-0b7e42805341699a240997b202d4d23aed4b458b.tar.gz chromium_src-0b7e42805341699a240997b202d4d23aed4b458b.tar.bz2 |
Clean up remoting project
Cleaned up some file names so it simplifies our project, and gets us more inline with chromium standards.
Removed several unnecessary headers that were cluttering the remoting namespace.
Simplified some of the double pimpl implementations that we had on Linux to hide X11 stuff.
Got HostAuthentication working reasonably well as a mock.
BUG=NONE
TEST=BUILD
Review URL: http://codereview.chromium.org/6780014
git-svn-id: svn://svn.chromium.org/chrome/trunk/src@80385 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'remoting/host/event_executor_mac.cc')
-rw-r--r-- | remoting/host/event_executor_mac.cc | 39 |
1 files changed, 30 insertions, 9 deletions
diff --git a/remoting/host/event_executor_mac.cc b/remoting/host/event_executor_mac.cc index 808f964..e38f514 100644 --- a/remoting/host/event_executor_mac.cc +++ b/remoting/host/event_executor_mac.cc @@ -1,24 +1,46 @@ -// Copyright (c) 2010 The Chromium Authors. All rights reserved. +// Copyright (c) 2011 The Chromium Authors. All rights reserved. // 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/basictypes.h" +#include "base/compiler_specific.h" +#include "base/mac/scoped_cftyperef.h" #include "base/message_loop.h" #include "base/task.h" -#include "base/mac/scoped_cftyperef.h" #include "remoting/host/capturer.h" -#include "remoting/protocol/message_decoder.h" #include "remoting/proto/internal.pb.h" +#include "remoting/protocol/message_decoder.h" 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 +48,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 +306,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); } |