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 583 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
594 gesture_event.data.scrollUpdate.deltaUnits == | 594 gesture_event.data.scrollUpdate.deltaUnits == |
595 blink::WebGestureEvent::ScrollUnits::Pixels) { | 595 blink::WebGestureEvent::ScrollUnits::Pixels) { |
596 switch (input_handler_->ScrollAnimated(scroll_point, scroll_delta).thread) { | 596 switch (input_handler_->ScrollAnimated(scroll_point, scroll_delta).thread) { |
597 case cc::InputHandler::SCROLL_ON_IMPL_THREAD: | 597 case cc::InputHandler::SCROLL_ON_IMPL_THREAD: |
598 return DID_HANDLE; | 598 return DID_HANDLE; |
599 case cc::InputHandler::SCROLL_IGNORED: | 599 case cc::InputHandler::SCROLL_IGNORED: |
600 return DROP_EVENT; | 600 return DROP_EVENT; |
601 default: | 601 default: |
602 return DID_NOT_HANDLE; | 602 return DID_NOT_HANDLE; |
603 } | 603 } |
604 } else { | |
605 cc::InputHandlerScrollResult scroll_result = | |
606 input_handler_->ScrollBy(&scroll_state); | |
607 HandleOverscroll(scroll_point, scroll_result); | |
608 return scroll_result.did_scroll ? DID_HANDLE : DROP_EVENT; | |
609 } | 604 } |
| 605 cc::InputHandlerScrollResult scroll_result = |
| 606 input_handler_->ScrollBy(&scroll_state); |
| 607 HandleOverscroll(scroll_point, scroll_result); |
| 608 return scroll_result.did_scroll ? DID_HANDLE : DROP_EVENT; |
610 } | 609 } |
611 | 610 |
612 InputHandlerProxy::EventDisposition InputHandlerProxy::HandleGestureScrollEnd( | 611 InputHandlerProxy::EventDisposition InputHandlerProxy::HandleGestureScrollEnd( |
613 const WebGestureEvent& gesture_event) { | 612 const WebGestureEvent& gesture_event) { |
614 #ifndef NDEBUG | 613 #ifndef NDEBUG |
615 DCHECK(expect_scroll_update_end_); | 614 DCHECK(expect_scroll_update_end_); |
616 expect_scroll_update_end_ = false; | 615 expect_scroll_update_end_ = false; |
617 #endif | 616 #endif |
618 cc::ScrollState scroll_state = CreateScrollStateForGesture(gesture_event); | 617 cc::ScrollState scroll_state = CreateScrollStateForGesture(gesture_event); |
619 input_handler_->ScrollEnd(&scroll_state); | 618 input_handler_->ScrollEnd(&scroll_state); |
(...skipping 550 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1170 // trigger a scroll, e.g., with a trivial time delta between fling updates. | 1169 // trigger a scroll, e.g., with a trivial time delta between fling updates. |
1171 // Return true in this case to prevent early fling termination. | 1170 // Return true in this case to prevent early fling termination. |
1172 if (std::abs(clipped_increment.width) < kScrollEpsilon && | 1171 if (std::abs(clipped_increment.width) < kScrollEpsilon && |
1173 std::abs(clipped_increment.height) < kScrollEpsilon) | 1172 std::abs(clipped_increment.height) < kScrollEpsilon) |
1174 return true; | 1173 return true; |
1175 | 1174 |
1176 return did_scroll; | 1175 return did_scroll; |
1177 } | 1176 } |
1178 | 1177 |
1179 } // namespace ui | 1178 } // namespace ui |
OLD | NEW |