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

Unified Diff: ui/events/gestures/gesture_provider_aura.cc

Issue 309823002: Pass ui::LatencyInfo correct with unified gesture detector on Aura. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Fix int to unsigned int comparison. Created 6 years, 7 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 side-by-side diff with in-line comments
Download patch
« no previous file with comments | « ui/events/gestures/gesture_provider_aura.h ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: ui/events/gestures/gesture_provider_aura.cc
diff --git a/ui/events/gestures/gesture_provider_aura.cc b/ui/events/gestures/gesture_provider_aura.cc
index edff9e38979939fe567cc06862a1b6b34cde1901..39642e07f324048500d06c75b75b660817d2da37 100644
--- a/ui/events/gestures/gesture_provider_aura.cc
+++ b/ui/events/gestures/gesture_provider_aura.cc
@@ -23,7 +23,6 @@ GestureProviderAura::GestureProviderAura(GestureProviderAuraClient* client)
GestureProviderAura::~GestureProviderAura() {}
bool GestureProviderAura::OnTouchEvent(const TouchEvent& event) {
- last_touch_event_flags_ = event.flags();
bool pointer_id_is_active = false;
for (size_t i = 0; i < pointer_state_.GetPointerCount(); ++i) {
if (event.touch_id() != pointer_state_.GetPointerId(i))
@@ -42,6 +41,8 @@ bool GestureProviderAura::OnTouchEvent(const TouchEvent& event) {
return false;
}
+ last_touch_event_flags_ = event.flags();
+ last_touch_event_latency_info_ = *event.latency();
pointer_state_.OnTouch(event);
bool result = filtered_gesture_provider_.OnTouchEvent(pointer_state_);
@@ -54,6 +55,7 @@ void GestureProviderAura::OnTouchEventAck(bool event_consumed) {
DCHECK(!handling_event_);
base::AutoReset<bool> handling_event(&handling_event_, true);
filtered_gesture_provider_.OnTouchEventAck(event_consumed);
+ last_touch_event_latency_info_.Clear();
}
void GestureProviderAura::OnGestureEvent(
@@ -87,6 +89,19 @@ void GestureProviderAura::OnGestureEvent(
// be cleaned up. See crbug.com/366707.
1 << gesture.motion_event_id));
+
+ ui::LatencyInfo* gesture_latency = event->latency();
+
+ gesture_latency->CopyLatencyFrom(
+ last_touch_event_latency_info_,
+ ui::INPUT_EVENT_LATENCY_ORIGINAL_COMPONENT);
+ gesture_latency->CopyLatencyFrom(
+ last_touch_event_latency_info_,
+ ui::INPUT_EVENT_LATENCY_UI_COMPONENT);
+ gesture_latency->CopyLatencyFrom(
+ last_touch_event_latency_info_,
+ ui::INPUT_EVENT_LATENCY_ACKED_TOUCH_COMPONENT);
+
if (!handling_event_) {
// Dispatching event caused by timer.
client_->OnGestureEvent(event.get());
« no previous file with comments | « ui/events/gestures/gesture_provider_aura.h ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698