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

Unified Diff: components/exo/touch.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: components/exo/touch.cc
diff --git a/components/exo/touch.cc b/components/exo/touch.cc
index 81004c69a477d79a5a000f378ef9ea4b6789f820..45c7605efc84b6ba4d3fe653f3f707a152628aec 100644
--- a/components/exo/touch.cc
+++ b/components/exo/touch.cc
@@ -83,8 +83,8 @@ void Touch::OnTouchEvent(ui::TouchEvent* event) {
focus_->AddSurfaceObserver(this);
}
- DCHECK(!VectorContainsItem(touch_points_, event->touch_id()));
- touch_points_.push_back(event->touch_id());
+ DCHECK(!VectorContainsItem(touch_points_, event->pointer_details().id));
+ touch_points_.push_back(event->pointer_details().id);
// Convert location to focus surface coordinate space.
DCHECK(focus_);
@@ -92,18 +92,18 @@ void Touch::OnTouchEvent(ui::TouchEvent* event) {
// Generate a touch down event for the focus surface. Note that this can
// be different from the target surface.
- delegate_->OnTouchDown(focus_, event->time_stamp(), event->touch_id(),
- location);
+ delegate_->OnTouchDown(focus_, event->time_stamp(),
+ event->pointer_details().id, location);
if (stylus_delegate_ &&
event->pointer_details().pointer_type !=
ui::EventPointerType::POINTER_TYPE_TOUCH) {
- stylus_delegate_->OnTouchTool(event->touch_id(),
+ stylus_delegate_->OnTouchTool(event->pointer_details().id,
event->pointer_details().pointer_type);
}
send_details = true;
} break;
case ui::ET_TOUCH_RELEASED: {
- auto it = FindVectorItem(touch_points_, event->touch_id());
+ auto it = FindVectorItem(touch_points_, event->pointer_details().id);
if (it == touch_points_.end())
return;
touch_points_.erase(it);
@@ -115,22 +115,22 @@ void Touch::OnTouchEvent(ui::TouchEvent* event) {
focus_ = nullptr;
}
- delegate_->OnTouchUp(event->time_stamp(), event->touch_id());
+ delegate_->OnTouchUp(event->time_stamp(), event->pointer_details().id);
} break;
case ui::ET_TOUCH_MOVED: {
- auto it = FindVectorItem(touch_points_, event->touch_id());
+ auto it = FindVectorItem(touch_points_, event->pointer_details().id);
if (it == touch_points_.end())
return;
DCHECK(focus_);
// Convert location to focus surface coordinate space.
gfx::PointF location = EventLocationInWindow(event, focus_->window());
- delegate_->OnTouchMotion(event->time_stamp(), event->touch_id(),
+ delegate_->OnTouchMotion(event->time_stamp(), event->pointer_details().id,
location);
send_details = true;
} break;
case ui::ET_TOUCH_CANCELLED: {
- auto it = FindVectorItem(touch_points_, event->touch_id());
+ auto it = FindVectorItem(touch_points_, event->pointer_details().id);
if (it == touch_points_.end())
return;
@@ -147,7 +147,7 @@ void Touch::OnTouchEvent(ui::TouchEvent* event) {
return;
}
if (send_details) {
- delegate_->OnTouchShape(event->touch_id(),
+ delegate_->OnTouchShape(event->pointer_details().id,
event->pointer_details().radius_x,
event->pointer_details().radius_y);
@@ -155,11 +155,12 @@ void Touch::OnTouchEvent(ui::TouchEvent* event) {
event->pointer_details().pointer_type !=
ui::EventPointerType::POINTER_TYPE_TOUCH) {
if (!std::isnan(event->pointer_details().force)) {
- stylus_delegate_->OnTouchForce(event->time_stamp(), event->touch_id(),
+ stylus_delegate_->OnTouchForce(event->time_stamp(),
+ event->pointer_details().id,
event->pointer_details().force);
}
stylus_delegate_->OnTouchTilt(
- event->time_stamp(), event->touch_id(),
+ event->time_stamp(), event->pointer_details().id,
gfx::Vector2dF(event->pointer_details().tilt_x,
event->pointer_details().tilt_y));
}

Powered by Google App Engine
This is Rietveld 408576698