summaryrefslogtreecommitdiffstats
path: root/remoting/host/event_executor_win.cc
diff options
context:
space:
mode:
authordmaclach@chromium.org <dmaclach@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2011-04-04 22:44:11 +0000
committerdmaclach@chromium.org <dmaclach@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2011-04-04 22:44:11 +0000
commit0b7e42805341699a240997b202d4d23aed4b458b (patch)
tree44b31edf61ace0f552a113dd56368768d9774598 /remoting/host/event_executor_win.cc
parent167d52bbfbfc80f2232474eddfeb8bc587008d71 (diff)
downloadchromium_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_win.cc')
-rw-r--r--remoting/host/event_executor_win.cc49
1 files changed, 36 insertions, 13 deletions
diff --git a/remoting/host/event_executor_win.cc b/remoting/host/event_executor_win.cc
index b87119d..53c550a 100644
--- a/remoting/host/event_executor_win.cc
+++ b/remoting/host/event_executor_win.cc
@@ -1,13 +1,13 @@
-// 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_win.h"
+#include "remoting/host/event_executor.h"
#include <windows.h>
+#include "base/compiler_specific.h"
#include "base/message_loop.h"
-#include "base/stl_util-inl.h"
#include "remoting/host/capturer.h"
#include "remoting/proto/event.pb.h"
#include "ui/base/keycodes/keyboard_codes.h"
@@ -17,15 +17,33 @@ namespace remoting {
using protocol::MouseEvent;
using protocol::KeyEvent;
-EventExecutorWin::EventExecutorWin(
- MessageLoopForUI* message_loop, Capturer* capturer)
+namespace {
+
+// A class to generate events on Windows.
+class EventExecutorWin : public EventExecutor {
+ public:
+ EventExecutorWin(MessageLoopForUI* message_loop, Capturer* capturer);
+ virtual ~EventExecutorWin() {}
+
+ virtual void InjectKeyEvent(const KeyEvent* event, Task* done) OVERRIDE;
+ virtual void InjectMouseEvent(const MouseEvent* event, Task* done) OVERRIDE;
+
+ private:
+ void HandleKey(const KeyEvent* event);
+ void HandleMouse(const MouseEvent* event);
+
+ MessageLoopForUI* message_loop_;
+ Capturer* capturer_;
+
+ DISALLOW_COPY_AND_ASSIGN(EventExecutorWin);
+};
+
+EventExecutorWin::EventExecutorWin(MessageLoopForUI* message_loop,
+ Capturer* capturer)
: message_loop_(message_loop),
capturer_(capturer) {
}
-EventExecutorWin::~EventExecutorWin() {
-}
-
void EventExecutorWin::InjectKeyEvent(const KeyEvent* event, Task* done) {
if (MessageLoop::current() != message_loop_) {
message_loop_->PostTask(
@@ -82,11 +100,6 @@ void EventExecutorWin::HandleKey(const KeyEvent* event) {
SendInput(1, &input, sizeof(INPUT));
}
-protocol::InputStub* CreateEventExecutor(MessageLoopForUI* message_loop,
- Capturer* capturer) {
- return new EventExecutorWin(message_loop, capturer);
-}
-
void EventExecutorWin::HandleMouse(const MouseEvent* event) {
// TODO(garykac) Collapse mouse (x,y) and button events into a single
// input event when possible.
@@ -153,4 +166,14 @@ void EventExecutorWin::HandleMouse(const MouseEvent* event) {
}
}
+} // namespace
+
+EventExecutor* EventExecutor::Create(MessageLoopForUI* message_loop,
+ Capturer* capturer) {
+ return new EventExecutorWin(message_loop, capturer);
+}
+
} // namespace remoting
+
+DISABLE_RUNNABLE_METHOD_REFCOUNT(remoting::EventExecutorWin);
+