OLD | NEW |
---|---|
1 // Copyright 2013 The Chromium Authors. All rights reserved. | 1 // Copyright 2013 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 "content/renderer/input/input_handler_proxy.h" | 5 #include "content/renderer/input/input_handler_proxy.h" |
6 | 6 |
7 #include "base/auto_reset.h" | 7 #include "base/auto_reset.h" |
8 #include "base/command_line.h" | 8 #include "base/command_line.h" |
9 #include "base/debug/trace_event.h" | 9 #include "base/debug/trace_event.h" |
10 #include "base/logging.h" | 10 #include "base/logging.h" |
(...skipping 517 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
528 return false; | 528 return false; |
529 | 529 |
530 if (!fling_curve_) { | 530 if (!fling_curve_) { |
531 DCHECK(!deferred_fling_cancel_time_seconds_); | 531 DCHECK(!deferred_fling_cancel_time_seconds_); |
532 return false; | 532 return false; |
533 } | 533 } |
534 | 534 |
535 const WebGestureEvent& gesture_event = | 535 const WebGestureEvent& gesture_event = |
536 static_cast<const WebGestureEvent&>(event); | 536 static_cast<const WebGestureEvent&>(event); |
537 if (gesture_event.type == WebInputEvent::GestureFlingCancel) { | 537 if (gesture_event.type == WebInputEvent::GestureFlingCancel) { |
538 if (gesture_event.data.flingCancel.preventBoosting) | |
jdduke (slow)
2014/12/10 19:02:52
Awesome, could you add a short test in input_handl
| |
539 return false; | |
540 | |
538 if (current_fling_velocity_.LengthSquared() < kMinBoostFlingSpeedSquare) | 541 if (current_fling_velocity_.LengthSquared() < kMinBoostFlingSpeedSquare) |
539 return false; | 542 return false; |
540 | 543 |
541 TRACE_EVENT_INSTANT0("input", | 544 TRACE_EVENT_INSTANT0("input", |
542 "InputHandlerProxy::FlingBoostStart", | 545 "InputHandlerProxy::FlingBoostStart", |
543 TRACE_EVENT_SCOPE_THREAD); | 546 TRACE_EVENT_SCOPE_THREAD); |
544 deferred_fling_cancel_time_seconds_ = | 547 deferred_fling_cancel_time_seconds_ = |
545 event.timeStampSeconds + kFlingBoostTimeoutDelaySeconds; | 548 event.timeStampSeconds + kFlingBoostTimeoutDelaySeconds; |
546 return true; | 549 return true; |
547 } | 550 } |
(...skipping 338 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
886 // trigger a scroll, e.g., with a trivial time delta between fling updates. | 889 // trigger a scroll, e.g., with a trivial time delta between fling updates. |
887 // Return true in this case to prevent early fling termination. | 890 // Return true in this case to prevent early fling termination. |
888 if (std::abs(clipped_increment.width) < kScrollEpsilon && | 891 if (std::abs(clipped_increment.width) < kScrollEpsilon && |
889 std::abs(clipped_increment.height) < kScrollEpsilon) | 892 std::abs(clipped_increment.height) < kScrollEpsilon) |
890 return true; | 893 return true; |
891 | 894 |
892 return did_scroll; | 895 return did_scroll; |
893 } | 896 } |
894 | 897 |
895 } // namespace content | 898 } // namespace content |
OLD | NEW |