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

Side by Side Diff: content/renderer/pepper/event_conversion.cc

Issue 1760183002: Fixed missing pointerTypes for touch events. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 4 years, 9 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
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 "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
11 #include "base/i18n/char_iterator.h" 11 #include "base/i18n/char_iterator.h"
12 #include "base/logging.h" 12 #include "base/logging.h"
13 #include "base/memory/scoped_ptr.h" 13 #include "base/memory/scoped_ptr.h"
14 #include "base/strings/string16.h" 14 #include "base/strings/string16.h"
15 #include "base/strings/string_util.h" 15 #include "base/strings/string_util.h"
16 #include "base/strings/stringprintf.h" 16 #include "base/strings/stringprintf.h"
17 #include "base/strings/utf_string_conversion_utils.h" 17 #include "base/strings/utf_string_conversion_utils.h"
18 #include "base/strings/utf_string_conversions.h" 18 #include "base/strings/utf_string_conversions.h"
19 #include "build/build_config.h" 19 #include "build/build_config.h"
20 #include "content/common/input/web_touch_event_traits.h" 20 #include "content/common/input/web_touch_event_traits.h"
21 #include "ppapi/c/pp_input_event.h" 21 #include "ppapi/c/pp_input_event.h"
22 #include "ppapi/shared_impl/ppb_input_event_shared.h" 22 #include "ppapi/shared_impl/ppb_input_event_shared.h"
23 #include "third_party/WebKit/public/platform/WebGamepads.h" 23 #include "third_party/WebKit/public/platform/WebGamepads.h"
24 #include "third_party/WebKit/public/platform/WebPointerProperties.h"
24 #include "third_party/WebKit/public/web/WebInputEvent.h" 25 #include "third_party/WebKit/public/web/WebInputEvent.h"
25 #include "ui/events/keycodes/dom/keycode_converter.h" 26 #include "ui/events/keycodes/dom/keycode_converter.h"
26 27
27 using ppapi::InputEventData; 28 using ppapi::InputEventData;
28 using blink::WebInputEvent; 29 using blink::WebInputEvent;
29 using blink::WebKeyboardEvent; 30 using blink::WebKeyboardEvent;
30 using blink::WebMouseEvent; 31 using blink::WebMouseEvent;
31 using blink::WebMouseWheelEvent; 32 using blink::WebMouseWheelEvent;
32 using blink::WebTouchEvent; 33 using blink::WebTouchEvent;
33 using blink::WebTouchPoint; 34 using blink::WebTouchPoint;
(...skipping 229 matching lines...) Expand 10 before | Expand all | Expand 10 after
263 touch_event.touchesLength, 264 touch_event.touchesLength,
264 ALL, 265 ALL,
265 &result.target_touches); 266 &result.target_touches);
266 267
267 result_events->push_back(result); 268 result_events->push_back(result);
268 } 269 }
269 270
270 WebTouchPoint CreateWebTouchPoint(const PP_TouchPoint& pp_pt, 271 WebTouchPoint CreateWebTouchPoint(const PP_TouchPoint& pp_pt,
271 WebTouchPoint::State state) { 272 WebTouchPoint::State state) {
272 WebTouchPoint pt; 273 WebTouchPoint pt;
274 pt.pointerType = blink::WebPointerProperties::PointerType::Touch;
273 pt.id = pp_pt.id; 275 pt.id = pp_pt.id;
274 pt.position.x = pp_pt.position.x; 276 pt.position.x = pp_pt.position.x;
275 pt.position.y = pp_pt.position.y; 277 pt.position.y = pp_pt.position.y;
276 // TODO bug:http://code.google.com/p/chromium/issues/detail?id=93902 278 // TODO bug:http://code.google.com/p/chromium/issues/detail?id=93902
277 pt.screenPosition.x = 0; 279 pt.screenPosition.x = 0;
278 pt.screenPosition.y = 0; 280 pt.screenPosition.y = 0;
279 pt.force = pp_pt.pressure; 281 pt.force = pp_pt.pressure;
280 pt.radiusX = pp_pt.radius.x; 282 pt.radiusX = pp_pt.radius.x;
281 pt.radiusY = pp_pt.radius.y; 283 pt.radiusY = pp_pt.radius.y;
282 pt.rotationAngle = pp_pt.rotation_angle; 284 pt.rotationAngle = pp_pt.rotation_angle;
(...skipping 457 matching lines...) Expand 10 before | Expand all | Expand 10 after
740 case WebInputEvent::TouchStart: 742 case WebInputEvent::TouchStart:
741 return PP_INPUTEVENT_CLASS_TOUCH; 743 return PP_INPUTEVENT_CLASS_TOUCH;
742 case WebInputEvent::Undefined: 744 case WebInputEvent::Undefined:
743 default: 745 default:
744 CHECK(WebInputEvent::isGestureEventType(type)); 746 CHECK(WebInputEvent::isGestureEventType(type));
745 return PP_InputEvent_Class(0); 747 return PP_InputEvent_Class(0);
746 } 748 }
747 } 749 }
748 750
749 } // namespace content 751 } // namespace content
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698