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 #include "ppapi/c/pp_input_event.h" | 7 #include "ppapi/c/pp_input_event.h" |
8 | 8 |
9 namespace remoting { | 9 namespace remoting { |
10 | 10 |
(...skipping 15 matching lines...) Expand all Loading... |
26 void PepperInputHandler::HandleKeyEvent(bool keydown, | 26 void PepperInputHandler::HandleKeyEvent(bool keydown, |
27 const PP_InputEvent_Key& event) { | 27 const PP_InputEvent_Key& event) { |
28 SendKeyEvent(keydown, event.key_code); | 28 SendKeyEvent(keydown, event.key_code); |
29 } | 29 } |
30 | 30 |
31 void PepperInputHandler::HandleCharacterEvent( | 31 void PepperInputHandler::HandleCharacterEvent( |
32 const PP_InputEvent_Character& event) { | 32 const PP_InputEvent_Character& event) { |
33 // TODO(garykac): Coordinate key and char events. | 33 // TODO(garykac): Coordinate key and char events. |
34 } | 34 } |
35 | 35 |
36 void PepperInputHandler::HandleMouseMoveEvent(const PP_InputEvent_Mouse& event)
{ | 36 void PepperInputHandler::HandleMouseMoveEvent( |
| 37 const PP_InputEvent_Mouse& event) { |
37 SendMouseMoveEvent(static_cast<int>(event.x), | 38 SendMouseMoveEvent(static_cast<int>(event.x), |
38 static_cast<int>(event.y)); | 39 static_cast<int>(event.y)); |
39 } | 40 } |
40 | 41 |
41 void PepperInputHandler::HandleMouseButtonEvent( | 42 void PepperInputHandler::HandleMouseButtonEvent( |
42 bool button_down, | 43 bool button_down, |
43 const PP_InputEvent_Mouse& event) { | 44 const PP_InputEvent_Mouse& event) { |
44 MouseEvent::MouseButton button = MouseEvent::BUTTON_UNDEFINED; | 45 MouseEvent::MouseButton button = MouseEvent::BUTTON_UNDEFINED; |
45 if (event.button == PP_INPUTEVENT_MOUSEBUTTON_LEFT) { | 46 if (event.button == PP_INPUTEVENT_MOUSEBUTTON_LEFT) { |
46 button = MouseEvent::BUTTON_LEFT; | 47 button = MouseEvent::BUTTON_LEFT; |
47 } else if (event.button == PP_INPUTEVENT_MOUSEBUTTON_MIDDLE) { | 48 } else if (event.button == PP_INPUTEVENT_MOUSEBUTTON_MIDDLE) { |
48 button = MouseEvent::BUTTON_MIDDLE; | 49 button = MouseEvent::BUTTON_MIDDLE; |
49 } else if (event.button == PP_INPUTEVENT_MOUSEBUTTON_RIGHT) { | 50 } else if (event.button == PP_INPUTEVENT_MOUSEBUTTON_RIGHT) { |
50 button = MouseEvent::BUTTON_RIGHT; | 51 button = MouseEvent::BUTTON_RIGHT; |
51 } | 52 } |
52 | 53 |
53 if (button != MouseEvent::BUTTON_UNDEFINED) { | 54 if (button != MouseEvent::BUTTON_UNDEFINED) { |
54 SendMouseButtonEvent(button_down, button); | 55 SendMouseButtonEvent(button_down, button); |
55 } | 56 } |
56 } | 57 } |
57 | 58 |
58 } // namespace remoting | 59 } // namespace remoting |
OLD | NEW |