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 533 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
544 InitGestureDetectors(config); | 544 InitGestureDetectors(config); |
545 } | 545 } |
546 | 546 |
547 GestureProvider::~GestureProvider() {} | 547 GestureProvider::~GestureProvider() {} |
548 | 548 |
549 bool GestureProvider::OnTouchEvent(const MotionEvent& event) { | 549 bool GestureProvider::OnTouchEvent(const MotionEvent& event) { |
550 TRACE_EVENT1("input", "GestureProvider::OnTouchEvent", | 550 TRACE_EVENT1("input", "GestureProvider::OnTouchEvent", |
551 "action", GetMotionEventActionName(event.GetAction())); | 551 "action", GetMotionEventActionName(event.GetAction())); |
552 | 552 |
553 DCHECK_NE(0u, event.GetPointerCount()); | 553 DCHECK_NE(0u, event.GetPointerCount()); |
554 DCHECK(!event.GetEventTime().is_null()); | |
555 | 554 |
556 if (!CanHandle(event)) | 555 if (!CanHandle(event)) |
557 return false; | 556 return false; |
558 | 557 |
559 const bool in_scale_gesture = | 558 const bool in_scale_gesture = |
560 scale_gesture_listener_->IsScaleGestureDetectionInProgress(); | 559 scale_gesture_listener_->IsScaleGestureDetectionInProgress(); |
561 | 560 |
562 OnTouchEventHandlingBegin(event); | 561 OnTouchEventHandlingBegin(event); |
563 gesture_listener_->OnTouchEvent(event, in_scale_gesture); | 562 gesture_listener_->OnTouchEvent(event, in_scale_gesture); |
564 scale_gesture_listener_->OnTouchEvent(event); | 563 scale_gesture_listener_->OnTouchEvent(event); |
(...skipping 211 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
776 if (current_down_event_) | 775 if (current_down_event_) |
777 return; | 776 return; |
778 | 777 |
779 const bool double_tap_enabled = double_tap_support_for_page_ && | 778 const bool double_tap_enabled = double_tap_support_for_page_ && |
780 double_tap_support_for_platform_; | 779 double_tap_support_for_platform_; |
781 gesture_listener_->SetDoubleTapEnabled(double_tap_enabled); | 780 gesture_listener_->SetDoubleTapEnabled(double_tap_enabled); |
782 scale_gesture_listener_->SetDoubleTapEnabled(double_tap_enabled); | 781 scale_gesture_listener_->SetDoubleTapEnabled(double_tap_enabled); |
783 } | 782 } |
784 | 783 |
785 } // namespace ui | 784 } // namespace ui |
OLD | NEW |