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

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

Issue 7466008: Reland http://codereview.chromium.org/7452002/ again (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: 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/chromoting_instance.h ('k') | remoting/client/plugin/pepper_input_handler.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: remoting/client/plugin/chromoting_instance.cc
diff --git a/remoting/client/plugin/chromoting_instance.cc b/remoting/client/plugin/chromoting_instance.cc
index e25364102ebafc6c50dcf302adac3f59bfcb631a..0bfa05eb3be50bab98a9466725e32f504f37e742 100644
--- a/remoting/client/plugin/chromoting_instance.cc
+++ b/remoting/client/plugin/chromoting_instance.cc
@@ -19,8 +19,8 @@
// crbug.com/74951
#include "content/renderer/p2p/ipc_network_manager.h"
#include "content/renderer/p2p/ipc_socket_factory.h"
-#include "ppapi/c/pp_input_event.h"
#include "ppapi/cpp/completion_callback.h"
+#include "ppapi/cpp/input_event.h"
#include "ppapi/cpp/rect.h"
// TODO(wez): Remove this when crbug.com/86353 is complete.
#include "ppapi/cpp/private/var_private.h"
@@ -55,6 +55,8 @@ ChromotingInstance::ChromotingInstance(PP_Instance pp_instance)
: pp::InstancePrivate(pp_instance),
initialized_(false),
logger_(this) {
+ RequestInputEvents(PP_INPUTEVENT_CLASS_MOUSE);
+ RequestFilteringInputEvents(PP_INPUTEVENT_CLASS_KEYBOARD);
}
ChromotingInstance::~ChromotingInstance() {
@@ -169,44 +171,51 @@ void ChromotingInstance::DidChangeView(const pp::Rect& position,
view_->SetScreenSize(clip.width(), clip.height());
}
-bool ChromotingInstance::HandleInputEvent(const PP_InputEvent& event) {
+bool ChromotingInstance::HandleInputEvent(const pp::InputEvent& event) {
DCHECK(CurrentlyOnPluginThread());
PepperInputHandler* pih
= static_cast<PepperInputHandler*>(input_handler_.get());
- switch (event.type) {
- case PP_INPUTEVENT_TYPE_MOUSEDOWN:
- pih->HandleMouseButtonEvent(true, event.u.mouse);
+ switch (event.GetType()) {
+ case PP_INPUTEVENT_TYPE_MOUSEDOWN: {
+ pih->HandleMouseButtonEvent(true, pp::MouseInputEvent(event));
return true;
+ }
- case PP_INPUTEVENT_TYPE_MOUSEUP:
- pih->HandleMouseButtonEvent(false, event.u.mouse);
+ case PP_INPUTEVENT_TYPE_MOUSEUP: {
+ pih->HandleMouseButtonEvent(false, pp::MouseInputEvent(event));
return true;
+ }
case PP_INPUTEVENT_TYPE_MOUSEMOVE:
case PP_INPUTEVENT_TYPE_MOUSEENTER:
- case PP_INPUTEVENT_TYPE_MOUSELEAVE:
- pih->HandleMouseMoveEvent(event.u.mouse);
+ case PP_INPUTEVENT_TYPE_MOUSELEAVE: {
+ pih->HandleMouseMoveEvent(pp::MouseInputEvent(event));
return true;
+ }
- case PP_INPUTEVENT_TYPE_CONTEXTMENU:
+ case PP_INPUTEVENT_TYPE_CONTEXTMENU: {
// We need to return true here or else we'll get a local (plugin) context
// menu instead of the mouseup event for the right click.
return true;
+ }
case PP_INPUTEVENT_TYPE_KEYDOWN:
- case PP_INPUTEVENT_TYPE_KEYUP:
+ case PP_INPUTEVENT_TYPE_KEYUP: {
+ pp::KeyboardInputEvent key_event(event);
logger_.VLog(3, "PP_INPUTEVENT_TYPE_KEY%s key=%d",
- (event.type==PP_INPUTEVENT_TYPE_KEYDOWN ? "DOWN" : "UP"),
- event.u.key.key_code);
- pih->HandleKeyEvent(event.type == PP_INPUTEVENT_TYPE_KEYDOWN,
- event.u.key);
+ (event.GetType()==PP_INPUTEVENT_TYPE_KEYDOWN ? "DOWN" : "UP"),
+ key_event.GetKeyCode());
+ pih->HandleKeyEvent(event.GetType() == PP_INPUTEVENT_TYPE_KEYDOWN,
+ key_event);
return true;
+ }
- case PP_INPUTEVENT_TYPE_CHAR:
- pih->HandleCharacterEvent(event.u.character);
+ case PP_INPUTEVENT_TYPE_CHAR: {
+ pih->HandleCharacterEvent(pp::KeyboardInputEvent(event));
return true;
+ }
default:
break;
« no previous file with comments | « remoting/client/plugin/chromoting_instance.h ('k') | remoting/client/plugin/pepper_input_handler.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698