OLD | NEW |
1 // Copyright (c) 2010 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2010 The Chromium Authors. All rights reserved. |
2 // Use of this source code is governed by a BSD-style license that can be | 2 // Use of this source code is governed by a BSD-style license that can be |
3 // found in the LICENSE file. | 3 // found in the LICENSE file. |
4 | 4 |
5 #include "remoting/client/plugin/pepper_input_handler.h" | 5 #include "remoting/client/plugin/pepper_input_handler.h" |
6 | 6 |
7 namespace remoting { | 7 namespace remoting { |
8 | 8 |
9 PepperInputHandler::PepperInputHandler(ClientContext* context, | 9 PepperInputHandler::PepperInputHandler(ClientContext* context, |
10 HostConnection* connection, | 10 HostConnection* connection, |
11 ChromotingView* view) | 11 ChromotingView* view) |
12 : InputHandler(context, connection, view) { | 12 : InputHandler(context, connection, view) { |
13 } | 13 } |
14 | 14 |
15 PepperInputHandler::~PepperInputHandler() { | 15 PepperInputHandler::~PepperInputHandler() { |
16 } | 16 } |
17 | 17 |
18 void PepperInputHandler::Initialize() { | 18 void PepperInputHandler::Initialize() { |
19 // TODO(garykac): Implement this. | 19 } |
| 20 |
| 21 void PepperInputHandler::HandleMouseMoveEvent(const PP_Event_Mouse& event) { |
| 22 SendMouseMoveEvent(static_cast<int>(event.x), |
| 23 static_cast<int>(event.y)); |
| 24 } |
| 25 |
| 26 void PepperInputHandler::HandleMouseButtonEvent(bool button_down, |
| 27 const PP_Event_Mouse& event) { |
| 28 MouseButton button = MouseButtonUndefined; |
| 29 if (event.button == PP_EVENT_MOUSEBUTTON_LEFT) { |
| 30 button = MouseButtonLeft; |
| 31 } else if (event.button == PP_EVENT_MOUSEBUTTON_MIDDLE) { |
| 32 button = MouseButtonMiddle; |
| 33 } else if (event.button == PP_EVENT_MOUSEBUTTON_RIGHT) { |
| 34 button = MouseButtonRight; |
| 35 } |
| 36 |
| 37 if (button != MouseButtonUndefined) { |
| 38 SendMouseButtonEvent(button_down, button); |
| 39 } |
20 } | 40 } |
21 | 41 |
22 } // namespace remoting | 42 } // namespace remoting |
OLD | NEW |