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 "ui/events/blink/input_handler_proxy.h" | 5 #include "ui/events/blink/input_handler_proxy.h" |
6 | 6 |
7 #include <stddef.h> | 7 #include <stddef.h> |
8 | 8 |
9 #include <algorithm> | 9 #include <algorithm> |
10 | 10 |
(...skipping 980 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
991 | 991 |
992 bool InputHandlerProxy::CancelCurrentFling() { | 992 bool InputHandlerProxy::CancelCurrentFling() { |
993 if (CancelCurrentFlingWithoutNotifyingClient()) { | 993 if (CancelCurrentFlingWithoutNotifyingClient()) { |
994 client_->DidStopFlinging(); | 994 client_->DidStopFlinging(); |
995 return true; | 995 return true; |
996 } | 996 } |
997 return false; | 997 return false; |
998 } | 998 } |
999 | 999 |
1000 bool InputHandlerProxy::CancelCurrentFlingWithoutNotifyingClient() { | 1000 bool InputHandlerProxy::CancelCurrentFlingWithoutNotifyingClient() { |
1001 bool had_fling_animation = fling_curve_; | 1001 bool had_fling_animation = !!fling_curve_; |
1002 if (had_fling_animation && | 1002 if (had_fling_animation && |
1003 fling_parameters_.sourceDevice == blink::WebGestureDeviceTouchscreen) { | 1003 fling_parameters_.sourceDevice == blink::WebGestureDeviceTouchscreen) { |
1004 cc::ScrollState scroll_state(0, 0, fling_parameters_.point.x, | 1004 cc::ScrollState scroll_state(0, 0, fling_parameters_.point.x, |
1005 fling_parameters_.point.y, 0, 0, false, true, | 1005 fling_parameters_.point.y, 0, 0, false, true, |
1006 true); | 1006 true); |
1007 input_handler_->ScrollEnd(&scroll_state); | 1007 input_handler_->ScrollEnd(&scroll_state); |
1008 TRACE_EVENT_ASYNC_END0( | 1008 TRACE_EVENT_ASYNC_END0( |
1009 "input", | 1009 "input", |
1010 "InputHandlerProxy::HandleGestureFling::started", | 1010 "InputHandlerProxy::HandleGestureFling::started", |
1011 this); | 1011 this); |
(...skipping 133 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1145 // trigger a scroll, e.g., with a trivial time delta between fling updates. | 1145 // trigger a scroll, e.g., with a trivial time delta between fling updates. |
1146 // Return true in this case to prevent early fling termination. | 1146 // Return true in this case to prevent early fling termination. |
1147 if (std::abs(clipped_increment.width) < kScrollEpsilon && | 1147 if (std::abs(clipped_increment.width) < kScrollEpsilon && |
1148 std::abs(clipped_increment.height) < kScrollEpsilon) | 1148 std::abs(clipped_increment.height) < kScrollEpsilon) |
1149 return true; | 1149 return true; |
1150 | 1150 |
1151 return did_scroll; | 1151 return did_scroll; |
1152 } | 1152 } |
1153 | 1153 |
1154 } // namespace ui | 1154 } // namespace ui |
OLD | NEW |