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

Unified Diff: ui/events/gesture_detection/scale_gesture_detector.cc

Issue 212663010: Store the id of a contributing motion event in GestureEventData (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Update test. Created 6 years, 9 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: ui/events/gesture_detection/scale_gesture_detector.cc
diff --git a/ui/events/gesture_detection/scale_gesture_detector.cc b/ui/events/gesture_detection/scale_gesture_detector.cc
index ea4644888453de292fcc1cd010bf9815e699f0dd..e6c35b84a17eb868646fdfd6fb570ffa06d919bf 100644
--- a/ui/events/gesture_detection/scale_gesture_detector.cc
+++ b/ui/events/gesture_detection/scale_gesture_detector.cc
@@ -33,17 +33,17 @@ ScaleGestureDetector::Config::Config()
ScaleGestureDetector::Config::~Config() {}
bool ScaleGestureDetector::SimpleScaleGestureListener::OnScale(
- const ScaleGestureDetector&) {
+ const ScaleGestureDetector&, const MotionEvent&) {
return false;
}
bool ScaleGestureDetector::SimpleScaleGestureListener::OnScaleBegin(
- const ScaleGestureDetector&) {
+ const ScaleGestureDetector&, const MotionEvent&) {
return true;
}
void ScaleGestureDetector::SimpleScaleGestureListener::OnScaleEnd(
- const ScaleGestureDetector&) {}
+ const ScaleGestureDetector&, const MotionEvent&) {}
ScaleGestureDetector::ScaleGestureDetector(const Config& config,
ScaleGestureListener* listener)
@@ -99,7 +99,7 @@ bool ScaleGestureDetector::OnTouchEvent(const MotionEvent& event) {
// If it's an ACTION_DOWN we're beginning a new event stream.
// This means the app probably didn't give us all the events. Shame on it.
if (in_progress_) {
- listener_->OnScaleEnd(*this);
+ listener_->OnScaleEnd(*this, event);
in_progress_ = false;
initial_span_ = 0;
double_tap_mode_ = DOUBLE_TAP_MODE_NONE;
@@ -187,7 +187,7 @@ bool ScaleGestureDetector::OnTouchEvent(const MotionEvent& event) {
focus_y_ = focus_y;
if (!InDoubleTapMode() && in_progress_ &&
(span < min_span_ || config_changed)) {
- listener_->OnScaleEnd(*this);
+ listener_->OnScaleEnd(*this, event);
in_progress_ = false;
initial_span_ = span;
double_tap_mode_ = DOUBLE_TAP_MODE_NONE;
@@ -205,7 +205,7 @@ bool ScaleGestureDetector::OnTouchEvent(const MotionEvent& event) {
prev_span_y_ = curr_span_y_ = span_y;
prev_span_ = curr_span_ = span;
prev_time_ = curr_time_;
- in_progress_ = listener_->OnScaleBegin(*this);
+ in_progress_ = listener_->OnScaleBegin(*this, event);
}
// Handle motion; focal point and span/scale factor are changing.
@@ -217,7 +217,7 @@ bool ScaleGestureDetector::OnTouchEvent(const MotionEvent& event) {
bool update_prev = true;
if (in_progress_) {
- update_prev = listener_->OnScale(*this);
+ update_prev = listener_->OnScale(*this, event);
}
if (update_prev) {
« no previous file with comments | « ui/events/gesture_detection/scale_gesture_detector.h ('k') | ui/events/gesture_detection/touch_disposition_gesture_filter.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698