| OLD | NEW |
| 1 // Copyright 2014 The Chromium Authors. All rights reserved. | 1 // Copyright 2014 The Chromium Authors. All rights reserved. |
| 2 // Use of this source code is governed by a BSD-style license that can be | 2 // Use of this source code is governed by a BSD-style license that can be |
| 3 // found in the LICENSE file. | 3 // found in the LICENSE file. |
| 4 | 4 |
| 5 #include "ui/events/gesture_detection/gesture_provider.h" | 5 #include "ui/events/gesture_detection/gesture_provider.h" |
| 6 | 6 |
| 7 #include <cmath> | 7 #include <cmath> |
| 8 | 8 |
| 9 #include "base/auto_reset.h" | 9 #include "base/auto_reset.h" |
| 10 #include "base/debug/trace_event.h" | 10 #include "base/debug/trace_event.h" |
| (...skipping 357 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 368 } | 368 } |
| 369 | 369 |
| 370 provider_->Fling(e2, velocity_x, velocity_y); | 370 provider_->Fling(e2, velocity_x, velocity_y); |
| 371 return true; | 371 return true; |
| 372 } | 372 } |
| 373 | 373 |
| 374 virtual bool OnSwipe(const MotionEvent& e1, | 374 virtual bool OnSwipe(const MotionEvent& e1, |
| 375 const MotionEvent& e2, | 375 const MotionEvent& e2, |
| 376 float velocity_x, | 376 float velocity_x, |
| 377 float velocity_y) OVERRIDE { | 377 float velocity_y) OVERRIDE { |
| 378 GestureEventDetails swipe_details( | 378 GestureEventDetails swipe_details(ET_GESTURE_SWIPE, velocity_x, velocity_y); |
| 379 ET_GESTURE_MULTIFINGER_SWIPE, velocity_x, velocity_y); | 379 provider_->Send(CreateGesture(ET_GESTURE_SWIPE, e2, swipe_details)); |
| 380 provider_->Send( | |
| 381 CreateGesture(ET_GESTURE_MULTIFINGER_SWIPE, e2, swipe_details)); | |
| 382 return true; | 380 return true; |
| 383 } | 381 } |
| 384 | 382 |
| 385 virtual bool OnTwoFingerTap(const MotionEvent& e1, | 383 virtual bool OnTwoFingerTap(const MotionEvent& e1, |
| 386 const MotionEvent& e2) OVERRIDE { | 384 const MotionEvent& e2) OVERRIDE { |
| 387 // The location of the two finger tap event should be the location of the | 385 // The location of the two finger tap event should be the location of the |
| 388 // primary pointer. | 386 // primary pointer. |
| 389 GestureEventDetails two_finger_tap_details(ET_GESTURE_TWO_FINGER_TAP, | 387 GestureEventDetails two_finger_tap_details(ET_GESTURE_TWO_FINGER_TAP, |
| 390 e1.GetTouchMajor(), | 388 e1.GetTouchMajor(), |
| 391 e1.GetTouchMajor()); | 389 e1.GetTouchMajor()); |
| (...skipping 383 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 775 if (current_down_event_) | 773 if (current_down_event_) |
| 776 return; | 774 return; |
| 777 | 775 |
| 778 const bool double_tap_enabled = double_tap_support_for_page_ && | 776 const bool double_tap_enabled = double_tap_support_for_page_ && |
| 779 double_tap_support_for_platform_; | 777 double_tap_support_for_platform_; |
| 780 gesture_listener_->SetDoubleTapEnabled(double_tap_enabled); | 778 gesture_listener_->SetDoubleTapEnabled(double_tap_enabled); |
| 781 scale_gesture_listener_->SetDoubleTapEnabled(double_tap_enabled); | 779 scale_gesture_listener_->SetDoubleTapEnabled(double_tap_enabled); |
| 782 } | 780 } |
| 783 | 781 |
| 784 } // namespace ui | 782 } // namespace ui |
| OLD | NEW |