Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(2467)

Unified Diff: remoting/client/plugin/pepper_input_handler.cc

Issue 7453003: Change Chromoting client to use Pepper's new Resource-base InputEvents. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: tweaks Created 9 years, 5 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « remoting/client/plugin/pepper_input_handler.h ('k') | remoting/client/plugin/pepper_view.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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 01fd2501c06d29a1d2d263326a561d12e73ac726..887338c87c95cc8f5f8a113b3dfe5355fde198af 100644
--- a/remoting/client/plugin/pepper_input_handler.cc
+++ b/remoting/client/plugin/pepper_input_handler.cc
@@ -4,11 +4,9 @@
#include "remoting/client/plugin/pepper_input_handler.h"
-#include "ppapi/c/pp_input_event.h"
#include "ppapi/cpp/input_event.h"
#include "ppapi/cpp/point.h"
-#include "remoting/client/chromoting_view.h"
-#include "ui/gfx/point.h"
+#include "remoting/client/plugin/pepper_view_proxy.h"
namespace remoting {
@@ -19,8 +17,9 @@ using protocol::MouseEvent;
PepperInputHandler::PepperInputHandler(ClientContext* context,
protocol::ConnectionToHost* connection,
- ChromotingView* view)
- : InputHandler(context, connection, view) {
+ PepperViewProxy* view)
+ : InputHandler(context, connection, view),
+ pepper_view_(view) {
}
PepperInputHandler::~PepperInputHandler() {
@@ -30,32 +29,40 @@ void PepperInputHandler::Initialize() {
}
void PepperInputHandler::HandleKeyEvent(bool keydown,
- const KeyboardInputEvent& event) {
+ const pp::KeyboardInputEvent& event) {
SendKeyEvent(keydown, event.GetKeyCode());
}
-void PepperInputHandler::HandleCharacterEvent(const KeyboardInputEvent& event) {
+void PepperInputHandler::HandleCharacterEvent(
+ const pp::KeyboardInputEvent& event) {
// TODO(garykac): Coordinate key and char events.
}
-void PepperInputHandler::HandleMouseMoveEvent(const MouseInputEvent& event) {
- gfx::Point p(static_cast<int>(event.GetPosition().x()),
- static_cast<int>(event.GetPosition().y()));
+void PepperInputHandler::HandleMouseMoveEvent(
+ 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);
+ pp::Point p = pepper_view_->ConvertScreenToHost(event.GetPosition());
SendMouseMoveEvent(p.x(), p.y());
}
-void PepperInputHandler::HandleMouseButtonEvent(bool button_down,
- const MouseInputEvent& event) {
+void PepperInputHandler::HandleMouseButtonEvent(
+ bool button_down,
+ const pp::MouseInputEvent& event) {
MouseEvent::MouseButton button = MouseEvent::BUTTON_UNDEFINED;
- if (event.GetButton() == PP_INPUTEVENT_MOUSEBUTTON_LEFT) {
- button = MouseEvent::BUTTON_LEFT;
- } else if (event.GetButton() == PP_INPUTEVENT_MOUSEBUTTON_MIDDLE) {
- button = MouseEvent::BUTTON_MIDDLE;
- } else if (event.GetButton() == PP_INPUTEVENT_MOUSEBUTTON_RIGHT) {
- button = MouseEvent::BUTTON_RIGHT;
+ switch (event.GetButton()) {
+ case PP_INPUTEVENT_MOUSEBUTTON_LEFT:
+ button = MouseEvent::BUTTON_LEFT;
+ break;
+ case PP_INPUTEVENT_MOUSEBUTTON_MIDDLE:
+ button = MouseEvent::BUTTON_MIDDLE;
+ break;
+ case PP_INPUTEVENT_MOUSEBUTTON_RIGHT:
+ button = MouseEvent::BUTTON_RIGHT;
+ break;
+ case PP_INPUTEVENT_MOUSEBUTTON_NONE:
+ // Leave button undefined.
+ break;
}
if (button != MouseEvent::BUTTON_UNDEFINED) {
« no previous file with comments | « remoting/client/plugin/pepper_input_handler.h ('k') | remoting/client/plugin/pepper_view.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698