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 |
| 11 using protocol::KeyEvent; |
| 12 using protocol::MouseEvent; |
| 13 |
11 PepperInputHandler::PepperInputHandler(ClientContext* context, | 14 PepperInputHandler::PepperInputHandler(ClientContext* context, |
12 protocol::ConnectionToHost* connection, | 15 protocol::ConnectionToHost* connection, |
13 ChromotingView* view) | 16 ChromotingView* view) |
14 : InputHandler(context, connection, view) { | 17 : InputHandler(context, connection, view) { |
15 } | 18 } |
16 | 19 |
17 PepperInputHandler::~PepperInputHandler() { | 20 PepperInputHandler::~PepperInputHandler() { |
18 } | 21 } |
19 | 22 |
20 void PepperInputHandler::Initialize() { | 23 void PepperInputHandler::Initialize() { |
(...skipping 10 matching lines...) Expand all Loading... |
31 } | 34 } |
32 | 35 |
33 void PepperInputHandler::HandleMouseMoveEvent(const PP_InputEvent_Mouse& event)
{ | 36 void PepperInputHandler::HandleMouseMoveEvent(const PP_InputEvent_Mouse& event)
{ |
34 SendMouseMoveEvent(static_cast<int>(event.x), | 37 SendMouseMoveEvent(static_cast<int>(event.x), |
35 static_cast<int>(event.y)); | 38 static_cast<int>(event.y)); |
36 } | 39 } |
37 | 40 |
38 void PepperInputHandler::HandleMouseButtonEvent( | 41 void PepperInputHandler::HandleMouseButtonEvent( |
39 bool button_down, | 42 bool button_down, |
40 const PP_InputEvent_Mouse& event) { | 43 const PP_InputEvent_Mouse& event) { |
41 MouseButton button = MouseButtonUndefined; | 44 MouseEvent::MouseButton button = MouseEvent::BUTTON_UNDEFINED; |
42 if (event.button == PP_INPUTEVENT_MOUSEBUTTON_LEFT) { | 45 if (event.button == PP_INPUTEVENT_MOUSEBUTTON_LEFT) { |
43 button = MouseButtonLeft; | 46 button = MouseEvent::BUTTON_LEFT; |
44 } else if (event.button == PP_INPUTEVENT_MOUSEBUTTON_MIDDLE) { | 47 } else if (event.button == PP_INPUTEVENT_MOUSEBUTTON_MIDDLE) { |
45 button = MouseButtonMiddle; | 48 button = MouseEvent::BUTTON_MIDDLE; |
46 } else if (event.button == PP_INPUTEVENT_MOUSEBUTTON_RIGHT) { | 49 } else if (event.button == PP_INPUTEVENT_MOUSEBUTTON_RIGHT) { |
47 button = MouseButtonRight; | 50 button = MouseEvent::BUTTON_RIGHT; |
48 } | 51 } |
49 | 52 |
50 if (button != MouseButtonUndefined) { | 53 if (button != MouseEvent::BUTTON_UNDEFINED) { |
51 SendMouseButtonEvent(button_down, button); | 54 SendMouseButtonEvent(button_down, button); |
52 } | 55 } |
53 } | 56 } |
54 | 57 |
55 } // namespace remoting | 58 } // namespace remoting |
OLD | NEW |