| OLD | NEW |
| 1 // Copyright (c) 2011 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2011 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 "webkit/plugins/ppapi/resource_creation_impl.h" | 5 #include "webkit/plugins/ppapi/resource_creation_impl.h" |
| 6 | 6 |
| 7 #include "ppapi/c/pp_size.h" | 7 #include "ppapi/c/pp_size.h" |
| 8 #include "ppapi/shared_impl/input_event_impl.h" | 8 #include "ppapi/shared_impl/input_event_impl.h" |
| 9 #include "ppapi/shared_impl/var.h" | 9 #include "ppapi/shared_impl/var.h" |
| 10 #include "webkit/plugins/ppapi/common.h" | 10 #include "webkit/plugins/ppapi/common.h" |
| (...skipping 195 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 206 return PPB_InputEvent_Impl::Create(instance_, data); | 206 return PPB_InputEvent_Impl::Create(instance_, data); |
| 207 } | 207 } |
| 208 | 208 |
| 209 PP_Resource ResourceCreationImpl::CreateMouseInputEvent( | 209 PP_Resource ResourceCreationImpl::CreateMouseInputEvent( |
| 210 PP_Instance instance, | 210 PP_Instance instance, |
| 211 PP_InputEvent_Type type, | 211 PP_InputEvent_Type type, |
| 212 PP_TimeTicks time_stamp, | 212 PP_TimeTicks time_stamp, |
| 213 uint32_t modifiers, | 213 uint32_t modifiers, |
| 214 PP_InputEvent_MouseButton mouse_button, | 214 PP_InputEvent_MouseButton mouse_button, |
| 215 const PP_Point* mouse_position, | 215 const PP_Point* mouse_position, |
| 216 int32_t click_count) { | 216 int32_t click_count, |
| 217 const PP_Point* mouse_movement) { |
| 217 if (type != PP_INPUTEVENT_TYPE_MOUSEDOWN && | 218 if (type != PP_INPUTEVENT_TYPE_MOUSEDOWN && |
| 218 type != PP_INPUTEVENT_TYPE_MOUSEUP && | 219 type != PP_INPUTEVENT_TYPE_MOUSEUP && |
| 219 type != PP_INPUTEVENT_TYPE_MOUSEMOVE && | 220 type != PP_INPUTEVENT_TYPE_MOUSEMOVE && |
| 220 type != PP_INPUTEVENT_TYPE_MOUSEENTER && | 221 type != PP_INPUTEVENT_TYPE_MOUSEENTER && |
| 221 type != PP_INPUTEVENT_TYPE_MOUSELEAVE) | 222 type != PP_INPUTEVENT_TYPE_MOUSELEAVE) |
| 222 return 0; | 223 return 0; |
| 223 | 224 |
| 224 InputEventData data; | 225 InputEventData data; |
| 225 data.event_type = type; | 226 data.event_type = type; |
| 226 data.event_time_stamp = time_stamp; | 227 data.event_time_stamp = time_stamp; |
| 227 data.event_modifiers = modifiers; | 228 data.event_modifiers = modifiers; |
| 228 data.mouse_button = mouse_button; | 229 data.mouse_button = mouse_button; |
| 229 data.mouse_position = *mouse_position; | 230 data.mouse_position = *mouse_position; |
| 230 data.mouse_click_count = click_count; | 231 data.mouse_click_count = click_count; |
| 232 data.mouse_movement = *mouse_movement; |
| 231 | 233 |
| 232 return PPB_InputEvent_Impl::Create(instance_, data); | 234 return PPB_InputEvent_Impl::Create(instance_, data); |
| 233 } | 235 } |
| 234 | 236 |
| 235 PP_Resource ResourceCreationImpl::CreateScrollbar(PP_Instance instance, | 237 PP_Resource ResourceCreationImpl::CreateScrollbar(PP_Instance instance, |
| 236 PP_Bool vertical) { | 238 PP_Bool vertical) { |
| 237 return PPB_Scrollbar_Impl::Create(instance_, PP_ToBool(vertical)); | 239 return PPB_Scrollbar_Impl::Create(instance_, PP_ToBool(vertical)); |
| 238 } | 240 } |
| 239 | 241 |
| 240 PP_Resource ResourceCreationImpl::CreateSurface3D( | 242 PP_Resource ResourceCreationImpl::CreateSurface3D( |
| (...skipping 50 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 291 data.event_modifiers = modifiers; | 293 data.event_modifiers = modifiers; |
| 292 data.wheel_delta = *wheel_delta; | 294 data.wheel_delta = *wheel_delta; |
| 293 data.wheel_ticks = *wheel_ticks; | 295 data.wheel_ticks = *wheel_ticks; |
| 294 data.wheel_scroll_by_page = PP_ToBool(scroll_by_page); | 296 data.wheel_scroll_by_page = PP_ToBool(scroll_by_page); |
| 295 | 297 |
| 296 return PPB_InputEvent_Impl::Create(instance_, data); | 298 return PPB_InputEvent_Impl::Create(instance_, data); |
| 297 } | 299 } |
| 298 | 300 |
| 299 } // namespace ppapi | 301 } // namespace ppapi |
| 300 } // namespace webkit | 302 } // namespace webkit |
| OLD | NEW |