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

Side by Side 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 unified diff | Download patch | Annotate | Revision Log
« 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 »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. 1 // Copyright (c) 2012 The Chromium Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be 2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file. 3 // found in the LICENSE file.
4 4
5 #include "ppapi/shared_impl/ppb_input_event_shared.h" 5 #include "ppapi/shared_impl/ppb_input_event_shared.h"
6 6
7 #include "ppapi/shared_impl/var.h" 7 #include "ppapi/shared_impl/var.h"
8 8
9 using ppapi::thunk::PPB_InputEvent_API; 9 using ppapi::thunk::PPB_InputEvent_API;
10 10
(...skipping 306 matching lines...) Expand 10 before | Expand all | Expand 10 after
317 data.event_type = PP_INPUTEVENT_TYPE_WHEEL; 317 data.event_type = PP_INPUTEVENT_TYPE_WHEEL;
318 data.event_time_stamp = time_stamp; 318 data.event_time_stamp = time_stamp;
319 data.event_modifiers = modifiers; 319 data.event_modifiers = modifiers;
320 data.wheel_delta = *wheel_delta; 320 data.wheel_delta = *wheel_delta;
321 data.wheel_ticks = *wheel_ticks; 321 data.wheel_ticks = *wheel_ticks;
322 data.wheel_scroll_by_page = PP_ToBool(scroll_by_page); 322 data.wheel_scroll_by_page = PP_ToBool(scroll_by_page);
323 323
324 return (new PPB_InputEvent_Shared(type, instance, data))->GetReference(); 324 return (new PPB_InputEvent_Shared(type, instance, data))->GetReference();
325 } 325 }
326 326
327 // static
328 PP_Resource PPB_InputEvent_Shared::CreateTouchInputEvent(
329 ResourceObjectType type,
330 PP_Instance instance,
331 PP_InputEvent_Type event_type,
332 PP_TimeTicks time_stamp,
333 uint32_t modifiers) {
334 if (event_type != PP_INPUTEVENT_TYPE_TOUCHSTART &&
335 event_type != PP_INPUTEVENT_TYPE_TOUCHMOVE &&
336 event_type != PP_INPUTEVENT_TYPE_TOUCHEND &&
337 event_type != PP_INPUTEVENT_TYPE_TOUCHCANCEL)
338 return 0;
339
340 InputEventData data;
341 data.event_type = event_type;
342 data.event_time_stamp = time_stamp;
343 data.event_modifiers = modifiers;
344 return (new PPB_InputEvent_Shared(type, instance, data))->GetReference();
345 }
346
327 } // namespace ppapi 347 } // namespace ppapi
OLDNEW
« 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