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

Unified Diff: remoting/client/input_handler.cc

Issue 8985007: Refactoring of the client-side input pipeline and scaling dimension management. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Created 9 years 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
Index: remoting/client/input_handler.cc
diff --git a/remoting/client/input_handler.cc b/remoting/client/input_handler.cc
deleted file mode 100644
index 48beddedd523414cad69cfb65da912424c3d306d..0000000000000000000000000000000000000000
--- a/remoting/client/input_handler.cc
+++ /dev/null
@@ -1,84 +0,0 @@
-// 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/client/input_handler.h"
-
-#include "remoting/client/chromoting_view.h"
-#include "remoting/proto/event.pb.h"
-#include "remoting/protocol/connection_to_host.h"
-#include "remoting/protocol/input_stub.h"
-
-namespace remoting {
-
-using protocol::KeyEvent;
-using protocol::MouseEvent;
-
-InputHandler::InputHandler(ClientContext* context,
- protocol::ConnectionToHost* connection,
- ChromotingView* view)
- : context_(context),
- connection_(connection),
- view_(view) {
-}
-
-InputHandler::~InputHandler() {
-}
-
-void InputHandler::SendKeyEvent(bool press, int keycode) {
- protocol::InputStub* stub = connection_->input_stub();
- if (stub) {
- if (press) {
- pressed_keys_.insert(keycode);
- } else {
- pressed_keys_.erase(keycode);
- }
-
- KeyEvent event;
- event.set_keycode(keycode);
- event.set_pressed(press);
- stub->InjectKeyEvent(event);
- }
-}
-
-void InputHandler::SendMouseMoveEvent(int x, int y) {
- protocol::InputStub* stub = connection_->input_stub();
- if (stub) {
- MouseEvent event;
- event.set_x(x);
- event.set_y(y);
- stub->InjectMouseEvent(event);
- }
-}
-
-void InputHandler::SendMouseButtonEvent(bool button_down,
- MouseEvent::MouseButton button) {
- protocol::InputStub* stub = connection_->input_stub();
- if (stub) {
- MouseEvent event;
- event.set_button(button);
- event.set_button_down(button_down);
- stub->InjectMouseEvent(event);
- }
-}
-
-void InputHandler::SendMouseWheelEvent(int dx, int dy) {
- protocol::InputStub* stub = connection_->input_stub();
- if (stub) {
- MouseEvent event;
- event.set_wheel_offset_x(dx);
- event.set_wheel_offset_y(dy);
- stub->InjectMouseEvent(event);
- }
-}
-
-void InputHandler::ReleaseAllKeys() {
- std::set<int> pressed_keys_copy = pressed_keys_;
- std::set<int>::iterator i;
- for (i = pressed_keys_copy.begin(); i != pressed_keys_copy.end(); ++i) {
- SendKeyEvent(false, *i);
- }
- pressed_keys_.clear();
-}
-
-} // namespace remoting

Powered by Google App Engine
This is Rietveld 408576698