Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(439)

Unified Diff: remoting/host/event_executor_win.cc

Issue 6780014: Clean up remoting project (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: got rid of ref counting on user authenticator Created 9 years, 9 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « remoting/host/event_executor_win.h ('k') | remoting/host/host_mock_objects.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: remoting/host/event_executor_win.cc
diff --git a/remoting/host/event_executor_win.cc b/remoting/host/event_executor_win.cc
index b87119df01e71b109ef1e0371352479ff19aec00..53c550accc52af6f3f694425be0da83259454761 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);
+
« no previous file with comments | « remoting/host/event_executor_win.h ('k') | remoting/host/host_mock_objects.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698