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 "content/renderer/pepper/event_conversion.h" | 5 #include "content/renderer/pepper/event_conversion.h" |
6 | 6 |
7 #include <stddef.h> | 7 #include <stddef.h> |
8 #include <stdint.h> | 8 #include <stdint.h> |
9 #include <string.h> | 9 #include <string.h> |
10 | 10 |
(...skipping 252 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
263 touch_event.touchesLength, | 263 touch_event.touchesLength, |
264 ALL, | 264 ALL, |
265 &result.target_touches); | 265 &result.target_touches); |
266 | 266 |
267 result_events->push_back(result); | 267 result_events->push_back(result); |
268 } | 268 } |
269 | 269 |
270 WebTouchPoint CreateWebTouchPoint(const PP_TouchPoint& pp_pt, | 270 WebTouchPoint CreateWebTouchPoint(const PP_TouchPoint& pp_pt, |
271 WebTouchPoint::State state) { | 271 WebTouchPoint::State state) { |
272 WebTouchPoint pt; | 272 WebTouchPoint pt; |
| 273 pt.pointerType = blink::WebPointerProperties::PointerType::Touch; |
273 pt.id = pp_pt.id; | 274 pt.id = pp_pt.id; |
274 pt.position.x = pp_pt.position.x; | 275 pt.position.x = pp_pt.position.x; |
275 pt.position.y = pp_pt.position.y; | 276 pt.position.y = pp_pt.position.y; |
276 // TODO bug:http://code.google.com/p/chromium/issues/detail?id=93902 | 277 // TODO(crbug.com/93902): Add screen coordinate calculation. |
277 pt.screenPosition.x = 0; | 278 pt.screenPosition.x = 0; |
278 pt.screenPosition.y = 0; | 279 pt.screenPosition.y = 0; |
279 pt.force = pp_pt.pressure; | 280 pt.force = pp_pt.pressure; |
280 pt.radiusX = pp_pt.radius.x; | 281 pt.radiusX = pp_pt.radius.x; |
281 pt.radiusY = pp_pt.radius.y; | 282 pt.radiusY = pp_pt.radius.y; |
282 pt.rotationAngle = pp_pt.rotation_angle; | 283 pt.rotationAngle = pp_pt.rotation_angle; |
283 pt.state = state; | 284 pt.state = state; |
284 return pt; | 285 return pt; |
285 } | 286 } |
286 | 287 |
(...skipping 108 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
395 | 396 |
396 memset(key_event->text, 0, text_length_cap); | 397 memset(key_event->text, 0, text_length_cap); |
397 memset(key_event->unmodifiedText, 0, text_length_cap); | 398 memset(key_event->unmodifiedText, 0, text_length_cap); |
398 for (size_t i = 0; i < std::min(text_length_cap, text16.size()); ++i) | 399 for (size_t i = 0; i < std::min(text_length_cap, text16.size()); ++i) |
399 key_event->text[i] = text16[i]; | 400 key_event->text[i] = text16[i]; |
400 return key_event; | 401 return key_event; |
401 } | 402 } |
402 | 403 |
403 WebMouseEvent* BuildMouseEvent(const InputEventData& event) { | 404 WebMouseEvent* BuildMouseEvent(const InputEventData& event) { |
404 WebMouseEvent* mouse_event = new WebMouseEvent(); | 405 WebMouseEvent* mouse_event = new WebMouseEvent(); |
| 406 mouse_event->pointerType = blink::WebPointerProperties::PointerType::Mouse; |
| 407 |
405 switch (event.event_type) { | 408 switch (event.event_type) { |
406 case PP_INPUTEVENT_TYPE_MOUSEDOWN: | 409 case PP_INPUTEVENT_TYPE_MOUSEDOWN: |
407 mouse_event->type = WebInputEvent::MouseDown; | 410 mouse_event->type = WebInputEvent::MouseDown; |
408 break; | 411 break; |
409 case PP_INPUTEVENT_TYPE_MOUSEUP: | 412 case PP_INPUTEVENT_TYPE_MOUSEUP: |
410 mouse_event->type = WebInputEvent::MouseUp; | 413 mouse_event->type = WebInputEvent::MouseUp; |
411 break; | 414 break; |
412 case PP_INPUTEVENT_TYPE_MOUSEMOVE: | 415 case PP_INPUTEVENT_TYPE_MOUSEMOVE: |
413 mouse_event->type = WebInputEvent::MouseMove; | 416 mouse_event->type = WebInputEvent::MouseMove; |
414 break; | 417 break; |
(...skipping 325 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
740 case WebInputEvent::TouchStart: | 743 case WebInputEvent::TouchStart: |
741 return PP_INPUTEVENT_CLASS_TOUCH; | 744 return PP_INPUTEVENT_CLASS_TOUCH; |
742 case WebInputEvent::Undefined: | 745 case WebInputEvent::Undefined: |
743 default: | 746 default: |
744 CHECK(WebInputEvent::isGestureEventType(type)); | 747 CHECK(WebInputEvent::isGestureEventType(type)); |
745 return PP_InputEvent_Class(0); | 748 return PP_InputEvent_Class(0); |
746 } | 749 } |
747 } | 750 } |
748 | 751 |
749 } // namespace content | 752 } // namespace content |
OLD | NEW |