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

Unified Diff: ppapi/cpp/input_event.cc

Issue 7715021: Add movement information to PPB_MouseInputEvent. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Created 9 years, 4 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
Index: ppapi/cpp/input_event.cc
diff --git a/ppapi/cpp/input_event.cc b/ppapi/cpp/input_event.cc
index fbf8ac712548d9c6cfc96ab3ad559cb3f1f67e19..632b1eccd93652f9f15e227e28bb9fdbf342756c 100644
--- a/ppapi/cpp/input_event.cc
+++ b/ppapi/cpp/input_event.cc
@@ -90,13 +90,14 @@ MouseInputEvent::MouseInputEvent(Instance* instance,
uint32_t modifiers,
PP_InputEvent_MouseButton mouse_button,
const Point& mouse_position,
- int32_t click_count) {
+ int32_t click_count,
+ const Point& mouse_movement) {
// Type check the input event before setting it.
if (!has_interface<PPB_MouseInputEvent>())
return;
PassRefFromConstructor(get_interface<PPB_MouseInputEvent>()->Create(
instance->pp_instance(), type, time_stamp, modifiers, mouse_button,
- &mouse_position.pp_point(), click_count));
+ &mouse_position.pp_point(), click_count, &mouse_movement.pp_point()));
}
PP_InputEvent_MouseButton MouseInputEvent::GetButton() const {
@@ -117,6 +118,12 @@ int32_t MouseInputEvent::GetClickCount() const {
return get_interface<PPB_MouseInputEvent>()->GetClickCount(pp_resource());
}
+Point MouseInputEvent::GetMovement() const {
+ if (!has_interface<PPB_MouseInputEvent>())
+ return Point();
+ return get_interface<PPB_MouseInputEvent>()->GetMovement(pp_resource());
+}
+
// WheelInputEvent -------------------------------------------------------------
WheelInputEvent::WheelInputEvent() : InputEvent() {

Powered by Google App Engine
This is Rietveld 408576698