Chromium Code Reviews| 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 |