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

Unified Diff: ppapi/shared_impl/ppb_input_event_shared.cc

Issue 10634017: ppapi: Add ResourceCreationAPI::CreateTouchInputEvent for creating touch-events. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Created 8 years, 6 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 | « ppapi/shared_impl/ppb_input_event_shared.h ('k') | ppapi/thunk/ppb_input_event_thunk.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: ppapi/shared_impl/ppb_input_event_shared.cc
diff --git a/ppapi/shared_impl/ppb_input_event_shared.cc b/ppapi/shared_impl/ppb_input_event_shared.cc
index cc280278bc0d8ce08d05249a5c2b89ad08206897..303440fcd7e83058270cffabb0a0f992d758ae3c 100644
--- a/ppapi/shared_impl/ppb_input_event_shared.cc
+++ b/ppapi/shared_impl/ppb_input_event_shared.cc
@@ -324,4 +324,24 @@ PP_Resource PPB_InputEvent_Shared::CreateWheelInputEvent(
return (new PPB_InputEvent_Shared(type, instance, data))->GetReference();
}
+// static
+PP_Resource PPB_InputEvent_Shared::CreateTouchInputEvent(
+ ResourceObjectType type,
+ PP_Instance instance,
+ PP_InputEvent_Type event_type,
+ PP_TimeTicks time_stamp,
+ uint32_t modifiers) {
+ if (event_type != PP_INPUTEVENT_TYPE_TOUCHSTART &&
+ event_type != PP_INPUTEVENT_TYPE_TOUCHMOVE &&
+ event_type != PP_INPUTEVENT_TYPE_TOUCHEND &&
+ event_type != PP_INPUTEVENT_TYPE_TOUCHCANCEL)
+ return 0;
+
+ InputEventData data;
+ data.event_type = event_type;
+ data.event_time_stamp = time_stamp;
+ data.event_modifiers = modifiers;
+ return (new PPB_InputEvent_Shared(type, instance, data))->GetReference();
+}
+
} // namespace ppapi
« no previous file with comments | « ppapi/shared_impl/ppb_input_event_shared.h ('k') | ppapi/thunk/ppb_input_event_thunk.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698