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

Unified Diff: remoting/client/plugin/pepper_input_handler.cc

Issue 6697024: client-side wheel mouse support (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: acculumate subticks Created 9 years, 2 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
Index: remoting/client/plugin/pepper_input_handler.cc
diff --git a/remoting/client/plugin/pepper_input_handler.cc b/remoting/client/plugin/pepper_input_handler.cc
index e07ff43cd7571417fd223f3b61ad9c695dbf1504..1fe6f6e543636ef8f19e70954a9797661fa6a28e 100644
--- a/remoting/client/plugin/pepper_input_handler.cc
+++ b/remoting/client/plugin/pepper_input_handler.cc
@@ -10,16 +10,15 @@
namespace remoting {
-using pp::KeyboardInputEvent;
-using pp::MouseInputEvent;
-using protocol::KeyEvent;
using protocol::MouseEvent;
PepperInputHandler::PepperInputHandler(ClientContext* context,
protocol::ConnectionToHost* connection,
PepperViewProxy* view)
: InputHandler(context, connection, view),
- pepper_view_(view) {
+ pepper_view_(view),
+ wheel_ticks_x_(0),
+ wheel_ticks_y_(0) {
}
PepperInputHandler::~PepperInputHandler() {
@@ -78,4 +77,18 @@ void PepperInputHandler::HandleMouseButtonEvent(
}
}
+void PepperInputHandler::HandleMouseWheelEvent(
+ const pp::WheelInputEvent& event) {
+ pp::FloatPoint ticks = event.GetTicks();
Lambros 2011/10/14 21:00:25 Can GetTicks() be negative? You seem to have code
Lambros 2011/10/14 21:08:45 Sorry, ignore my comment. static_cast<int> does r
+ wheel_ticks_x_ += ticks.x();
+ wheel_ticks_y_ += ticks.y();
+ int ticks_x = static_cast<int>(wheel_ticks_x_);
+ int ticks_y = static_cast<int>(wheel_ticks_y_);
+ if (ticks_x != 0 || ticks_y != 0) {
+ wheel_ticks_x_ -= ticks_x;
+ wheel_ticks_y_ -= ticks_y;
+ SendMouseWheelEvent(ticks_x, ticks_y);
+ }
+}
+
} // namespace remoting

Powered by Google App Engine
This is Rietveld 408576698