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 { | 604 } else { |
tdresser
2016/01/25 13:10:23
Just remove the "else {" here, instead.
william.xie
2016/01/26 00:57:09
Done.
| |
605 cc::InputHandlerScrollResult scroll_result = | 605 cc::InputHandlerScrollResult scroll_result = |
606 input_handler_->ScrollBy(&scroll_state); | 606 input_handler_->ScrollBy(&scroll_state); |
607 HandleOverscroll(scroll_point, scroll_result); | 607 HandleOverscroll(scroll_point, scroll_result); |
608 return scroll_result.did_scroll ? DID_HANDLE : DROP_EVENT; | 608 return scroll_result.did_scroll ? DID_HANDLE : DROP_EVENT; |
609 } | 609 } |
610 return DID_NOT_HANDLE; | |
610 } | 611 } |
611 | 612 |
612 InputHandlerProxy::EventDisposition InputHandlerProxy::HandleGestureScrollEnd( | 613 InputHandlerProxy::EventDisposition InputHandlerProxy::HandleGestureScrollEnd( |
613 const WebGestureEvent& gesture_event) { | 614 const WebGestureEvent& gesture_event) { |
614 #ifndef NDEBUG | 615 #ifndef NDEBUG |
615 DCHECK(expect_scroll_update_end_); | 616 DCHECK(expect_scroll_update_end_); |
616 expect_scroll_update_end_ = false; | 617 expect_scroll_update_end_ = false; |
617 #endif | 618 #endif |
618 cc::ScrollState scroll_state = CreateScrollStateForGesture(gesture_event); | 619 cc::ScrollState scroll_state = CreateScrollStateForGesture(gesture_event); |
619 input_handler_->ScrollEnd(&scroll_state); | 620 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. | 1171 // trigger a scroll, e.g., with a trivial time delta between fling updates. |
1171 // Return true in this case to prevent early fling termination. | 1172 // Return true in this case to prevent early fling termination. |
1172 if (std::abs(clipped_increment.width) < kScrollEpsilon && | 1173 if (std::abs(clipped_increment.width) < kScrollEpsilon && |
1173 std::abs(clipped_increment.height) < kScrollEpsilon) | 1174 std::abs(clipped_increment.height) < kScrollEpsilon) |
1174 return true; | 1175 return true; |
1175 | 1176 |
1176 return did_scroll; | 1177 return did_scroll; |
1177 } | 1178 } |
1178 | 1179 |
1179 } // namespace ui | 1180 } // namespace ui |
OLD | NEW |