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

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: Support interleaved sync and async acks. Created 6 years, 1 month 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 894d5b0f2aded44d4880e4ce2d25b043c4d4477e..4a80e4bac15781ccfa98735a58829717e178b5ff 100644
--- a/ui/events/event.cc
+++ b/ui/events/event.cc
@@ -168,6 +168,10 @@ bool Event::HasNativeEvent() const {
return !!std::memcmp(&native_event_, &null_event, sizeof(null_event));
}
+void Event::DisableSynchronousHandling() {
+ result_ = static_cast<EventResult>(result_ | ER_DISABLE_SYNC_HANDLING);
+}
+
void Event::StopPropagation() {
// TODO(sad): Re-enable these checks once View uses dispatcher to dispatch
// events.
@@ -512,6 +516,7 @@ void MouseWheelEvent::UpdateForRootTransform(
TouchEvent::TouchEvent(const base::NativeEvent& native_event)
: LocatedEvent(native_event),
touch_id_(GetTouchId(native_event)),
+ touch_event_id_(get_next_touch_event_id()),
radius_x_(GetTouchRadiusX(native_event)),
radius_y_(GetTouchRadiusY(native_event)),
rotation_angle_(GetTouchAngle(native_event)),
@@ -535,6 +540,7 @@ TouchEvent::TouchEvent(EventType type,
base::TimeDelta time_stamp)
: LocatedEvent(type, location, location, time_stamp, 0),
touch_id_(touch_id),
+ touch_event_id_(get_next_touch_event_id()),
radius_x_(0.0f),
radius_y_(0.0f),
rotation_angle_(0.0f),
@@ -553,6 +559,7 @@ TouchEvent::TouchEvent(EventType type,
float force)
: LocatedEvent(type, location, location, time_stamp, flags),
touch_id_(touch_id),
+ touch_event_id_(get_next_touch_event_id()),
radius_x_(radius_x),
radius_y_(radius_y),
rotation_angle_(angle),
@@ -580,6 +587,13 @@ void TouchEvent::UpdateForRootTransform(
radius_y_ *= decomp.scale[1];
}
+int TouchEvent::get_next_touch_event_id() {
+ static int id = 0;
+ // We shouldn't have many touch events in existence at a
+ // time. 100000 should give us plenty of headroom.
+ return id++ % 100000;
tdresser 2014/11/24 21:44:40 This could use a SequentialIdGenerator, but that f
+}
+
////////////////////////////////////////////////////////////////////////////////
// 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