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: ui/events/event.cc

Issue 1586653002: ui: Fix TouchEvent PointerDetails creation from NativeEvent (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Rebase following X event refactor Created 4 years, 11 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
« no previous file with comments | « ui/events/cocoa/events_mac.mm ('k') | ui/events/event_utils.h » ('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 "ui/events/event.h" 5 #include "ui/events/event.h"
6 6
7 #include <utility> 7 #include <utility>
8 8
9 #if defined(USE_X11) 9 #if defined(USE_X11)
10 #include <X11/extensions/XInput2.h> 10 #include <X11/extensions/XInput2.h>
(...skipping 506 matching lines...) Expand 10 before | Expand all | Expand 10 after
517 //////////////////////////////////////////////////////////////////////////////// 517 ////////////////////////////////////////////////////////////////////////////////
518 // TouchEvent 518 // TouchEvent
519 519
520 TouchEvent::TouchEvent(const base::NativeEvent& native_event) 520 TouchEvent::TouchEvent(const base::NativeEvent& native_event)
521 : LocatedEvent(native_event), 521 : LocatedEvent(native_event),
522 touch_id_(GetTouchId(native_event)), 522 touch_id_(GetTouchId(native_event)),
523 unique_event_id_(ui::GetNextTouchEventId()), 523 unique_event_id_(ui::GetNextTouchEventId()),
524 rotation_angle_(GetTouchAngle(native_event)), 524 rotation_angle_(GetTouchAngle(native_event)),
525 may_cause_scrolling_(false), 525 may_cause_scrolling_(false),
526 should_remove_native_touch_id_mapping_(false), 526 should_remove_native_touch_id_mapping_(false),
527 pointer_details_(PointerDetails(EventPointerType::POINTER_TYPE_TOUCH, 527 pointer_details_(GetTouchPointerDetailsFromNative(native_event)) {
528 GetTouchRadiusX(native_event),
529 GetTouchRadiusY(native_event),
530 GetTouchForce(native_event),
531 /* tilt_x */ 0.0f,
532 /* tilt_y */ 0.0f)) {
533 latency()->AddLatencyNumberWithTimestamp( 528 latency()->AddLatencyNumberWithTimestamp(
534 INPUT_EVENT_LATENCY_ORIGINAL_COMPONENT, 0, 0, 529 INPUT_EVENT_LATENCY_ORIGINAL_COMPONENT, 0, 0,
535 base::TimeTicks::FromInternalValue(time_stamp().ToInternalValue()), 1); 530 base::TimeTicks::FromInternalValue(time_stamp().ToInternalValue()), 1);
536 latency()->AddLatencyNumber(INPUT_EVENT_LATENCY_UI_COMPONENT, 0, 0); 531 latency()->AddLatencyNumber(INPUT_EVENT_LATENCY_UI_COMPONENT, 0, 0);
537 532
538 FixRotationAngle(); 533 FixRotationAngle();
539 if (type() == ET_TOUCH_RELEASED || type() == ET_TOUCH_CANCELLED) 534 if (type() == ET_TOUCH_RELEASED || type() == ET_TOUCH_CANCELLED)
540 should_remove_native_touch_id_mapping_ = true; 535 should_remove_native_touch_id_mapping_ = true;
541 } 536 }
542 537
(...skipping 439 matching lines...) Expand 10 before | Expand all | Expand 10 after
982 gfx::PointF(x, y), 977 gfx::PointF(x, y),
983 time_stamp, 978 time_stamp,
984 flags | EF_FROM_TOUCH), 979 flags | EF_FROM_TOUCH),
985 details_(details) { 980 details_(details) {
986 } 981 }
987 982
988 GestureEvent::~GestureEvent() { 983 GestureEvent::~GestureEvent() {
989 } 984 }
990 985
991 } // namespace ui 986 } // namespace ui
OLDNEW
« no previous file with comments | « ui/events/cocoa/events_mac.mm ('k') | ui/events/event_utils.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698