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()); |
554 | 555 |
555 if (!CanHandle(event)) | 556 if (!CanHandle(event)) |
556 return false; | 557 return false; |
557 | 558 |
558 const bool in_scale_gesture = | 559 const bool in_scale_gesture = |
559 scale_gesture_listener_->IsScaleGestureDetectionInProgress(); | 560 scale_gesture_listener_->IsScaleGestureDetectionInProgress(); |
560 | 561 |
561 OnTouchEventHandlingBegin(event); | 562 OnTouchEventHandlingBegin(event); |
562 gesture_listener_->OnTouchEvent(event, in_scale_gesture); | 563 gesture_listener_->OnTouchEvent(event, in_scale_gesture); |
563 scale_gesture_listener_->OnTouchEvent(event); | 564 scale_gesture_listener_->OnTouchEvent(event); |
(...skipping 211 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
775 if (current_down_event_) | 776 if (current_down_event_) |
776 return; | 777 return; |
777 | 778 |
778 const bool double_tap_enabled = double_tap_support_for_page_ && | 779 const bool double_tap_enabled = double_tap_support_for_page_ && |
779 double_tap_support_for_platform_; | 780 double_tap_support_for_platform_; |
780 gesture_listener_->SetDoubleTapEnabled(double_tap_enabled); | 781 gesture_listener_->SetDoubleTapEnabled(double_tap_enabled); |
781 scale_gesture_listener_->SetDoubleTapEnabled(double_tap_enabled); | 782 scale_gesture_listener_->SetDoubleTapEnabled(double_tap_enabled); |
782 } | 783 } |
783 | 784 |
784 } // namespace ui | 785 } // namespace ui |
OLD | NEW |