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 452668e58231e2ba261bbc11c4e81583a77efc16..9bd5e9f56e057757f1790a50b9f458782e7008bb 100644 |
--- a/remoting/client/plugin/pepper_input_handler.cc |
+++ b/remoting/client/plugin/pepper_input_handler.cc |
@@ -4,9 +4,9 @@ |
#include "remoting/client/plugin/pepper_input_handler.h" |
-#include "ppapi/c/pp_input_event.h" |
-#include "remoting/client/chromoting_view.h" |
-#include "ui/gfx/point.h" |
+#include "ppapi/cpp/input_event.h" |
+#include "ppapi/cpp/point.h" |
+#include "remoting/client/plugin/pepper_view_proxy.h" |
namespace remoting { |
@@ -16,7 +16,7 @@ using protocol::MouseEvent; |
PepperInputHandler::PepperInputHandler(ClientContext* context, |
protocol::ConnectionToHost* connection, |
ChromotingView* view) |
- : InputHandler(context, connection, view) { |
+ : InputHandler(context, connection, view) { |
} |
PepperInputHandler::~PepperInputHandler() { |
@@ -26,33 +26,33 @@ void PepperInputHandler::Initialize() { |
} |
void PepperInputHandler::HandleKeyEvent(bool keydown, |
- const PP_InputEvent_Key& event) { |
- SendKeyEvent(keydown, event.key_code); |
+ const pp::KeyboardInputEvent& event) { |
+ SendKeyEvent(keydown, event.GetKeyCode()); |
} |
void PepperInputHandler::HandleCharacterEvent( |
- const PP_InputEvent_Character& event) { |
+ const pp::KeyboardInputEvent& event) { |
// TODO(garykac): Coordinate key and char events. |
} |
void PepperInputHandler::HandleMouseMoveEvent( |
- const PP_InputEvent_Mouse& event) { |
- gfx::Point p(static_cast<int>(event.x), static_cast<int>(event.y)); |
+ const pp::MouseInputEvent& event) { |
// Pepper gives co-ordinates in the plugin instance's co-ordinate system, |
// which may be different from the host desktop's co-ordinate system. |
- p = view_->ConvertScreenToHost(p); |
+ PepperViewProxy* pepper_view = static_cast<PepperViewProxy*>(view_); |
+ pp::Point p = pepper_view->ConvertScreenToHost(event.GetMousePosition()); |
Wez
2011/07/20 00:58:35
ConvertScreenToHost accepts & returns a gfx::Point
garykac
2011/07/20 18:55:28
err.. not any more.
|
SendMouseMoveEvent(p.x(), p.y()); |
} |
void PepperInputHandler::HandleMouseButtonEvent( |
bool button_down, |
- const PP_InputEvent_Mouse& event) { |
+ const pp::MouseInputEvent& event) { |
MouseEvent::MouseButton button = MouseEvent::BUTTON_UNDEFINED; |
- if (event.button == PP_INPUTEVENT_MOUSEBUTTON_LEFT) { |
+ if (event.GetMouseButton() == PP_INPUTEVENT_MOUSEBUTTON_LEFT) { |
dmac
2011/07/20 00:34:31
Would a switch on event.GetMouseButton() be more r
Wez
2011/07/20 00:58:35
Although we still need to cope with cases we don't
garykac
2011/07/20 18:55:28
Done.
garykac
2011/07/20 18:55:28
word
|
button = MouseEvent::BUTTON_LEFT; |
- } else if (event.button == PP_INPUTEVENT_MOUSEBUTTON_MIDDLE) { |
+ } else if (event.GetMouseButton() == PP_INPUTEVENT_MOUSEBUTTON_MIDDLE) { |
button = MouseEvent::BUTTON_MIDDLE; |
- } else if (event.button == PP_INPUTEVENT_MOUSEBUTTON_RIGHT) { |
+ } else if (event.GetMouseButton() == PP_INPUTEVENT_MOUSEBUTTON_RIGHT) { |
button = MouseEvent::BUTTON_RIGHT; |
} |