| OLD | NEW |
| 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 Loading... |
| 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 |
| OLD | NEW |