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

Unified Diff: ash/touch/touch_hud_debug.cc

Issue 2655303004: Add id properties to PointerEvent (Closed)
Patch Set: pointer id Created 3 years, 10 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
Index: ash/touch/touch_hud_debug.cc
diff --git a/ash/touch/touch_hud_debug.cc b/ash/touch/touch_hud_debug.cc
index 220ee5f67e75579ba1908a09d9f348f6711840f7..c009aad2d19ad4d99ad0e19881e54277d2da3a44 100644
--- a/ash/touch/touch_hud_debug.cc
+++ b/ash/touch/touch_hud_debug.cc
@@ -93,7 +93,7 @@ int GetTrackingId(const ui::TouchEvent& event) {
struct TouchPointLog {
public:
explicit TouchPointLog(const ui::TouchEvent& touch)
- : id(touch.touch_id()),
+ : id(touch.pointer_details().id),
type(touch.type()),
location(touch.root_location()),
timestamp((touch.time_stamp() - base::TimeTicks()).InMillisecondsF()),
@@ -213,14 +213,14 @@ class TouchLog {
break;
next_trace_index_ = (next_trace_index_ + 1) % kMaxPaths;
} while (next_trace_index_ != old_trace_index);
- int touch_id = touch.touch_id();
+ int touch_id = touch.pointer_details().id;
traces_[next_trace_index_].Reset();
touch_id_to_trace_index_[touch_id] = next_trace_index_;
next_trace_index_ = (next_trace_index_ + 1) % kMaxPaths;
}
void AddToTrace(const ui::TouchEvent& touch) {
- int touch_id = touch.touch_id();
+ int touch_id = touch.pointer_details().id;
int trace_index = touch_id_to_trace_index_[touch_id];
traces_[trace_index].AddTouchPoint(touch);
}
@@ -439,12 +439,12 @@ void TouchHudDebug::UpdateTouchPointLabel(int index) {
}
void TouchHudDebug::OnTouchEvent(ui::TouchEvent* event) {
- if (event->touch_id() >= kMaxTouchPoints)
+ if (event->pointer_details().id >= kMaxTouchPoints)
return;
touch_log_->AddTouchPoint(*event);
- canvas_->TouchPointAdded(event->touch_id());
- UpdateTouchPointLabel(event->touch_id());
+ canvas_->TouchPointAdded(event->pointer_details().id);
+ UpdateTouchPointLabel(event->pointer_details().id);
label_container_->SetSize(label_container_->GetPreferredSize());
}

Powered by Google App Engine
This is Rietveld 408576698