From 0b7e42805341699a240997b202d4d23aed4b458b Mon Sep 17 00:00:00 2001 From: "dmaclach@chromium.org" Date: Mon, 4 Apr 2011 22:44:11 +0000 Subject: 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 --- remoting/host/event_executor_mac.cc | 39 ++++++++++++++++++++++++++++--------- 1 file changed, 30 insertions(+), 9 deletions(-) (limited to 'remoting/host/event_executor_mac.cc') 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 #include +#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); } -- cgit v1.1