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

Unified Diff: ui/events/event.cc

Issue 680413006: Re-enable Eager Gesture Recognition on Aura (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Address sadrul's comments. Created 6 years 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 side-by-side diff with in-line comments
Download patch
« no previous file with comments | « ui/events/event.h ('k') | ui/events/event_constants.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: ui/events/event.cc
diff --git a/ui/events/event.cc b/ui/events/event.cc
index e93a0aedf618c3810be06c34b6b253f258c29be3..5cad8b0001db6fabb13b8f931416f9f52920b1e1 100644
--- a/ui/events/event.cc
+++ b/ui/events/event.cc
@@ -108,6 +108,11 @@ bool X11EventHasNonStandardState(const base::NativeEvent& event) {
#endif
}
+unsigned long long get_next_touch_event_id() {
+ static unsigned long long id = 0;
+ return id++;
+}
+
} // namespace
namespace ui {
@@ -514,6 +519,7 @@ void MouseWheelEvent::UpdateForRootTransform(
TouchEvent::TouchEvent(const base::NativeEvent& native_event)
: LocatedEvent(native_event),
touch_id_(GetTouchId(native_event)),
+ unique_event_id_(get_next_touch_event_id()),
radius_x_(GetTouchRadiusX(native_event)),
radius_y_(GetTouchRadiusY(native_event)),
rotation_angle_(GetTouchAngle(native_event)),
@@ -537,6 +543,7 @@ TouchEvent::TouchEvent(EventType type,
base::TimeDelta time_stamp)
: LocatedEvent(type, location, location, time_stamp, 0),
touch_id_(touch_id),
+ unique_event_id_(get_next_touch_event_id()),
radius_x_(0.0f),
radius_y_(0.0f),
rotation_angle_(0.0f),
@@ -555,6 +562,7 @@ TouchEvent::TouchEvent(EventType type,
float force)
: LocatedEvent(type, location, location, time_stamp, flags),
touch_id_(touch_id),
+ unique_event_id_(get_next_touch_event_id()),
radius_x_(radius_x),
radius_y_(radius_y),
rotation_angle_(angle),
@@ -582,6 +590,12 @@ void TouchEvent::UpdateForRootTransform(
radius_y_ *= decomp.scale[1];
}
+void TouchEvent::DisableSynchronousHandling() {
+ DispatcherApi dispatcher_api(this);
+ dispatcher_api.set_result(
+ static_cast<EventResult>(result() | ER_DISABLE_SYNC_HANDLING));
+}
+
////////////////////////////////////////////////////////////////////////////////
// KeyEvent
« no previous file with comments | « ui/events/event.h ('k') | ui/events/event_constants.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698