Chromium Code Reviews| 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 648 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 659 } | 659 } |
| 660 | 660 |
| 661 InputHandlerProxy::EventDisposition InputHandlerProxy::HandleMouseWheel( | 661 InputHandlerProxy::EventDisposition InputHandlerProxy::HandleMouseWheel( |
| 662 const WebMouseWheelEvent& wheel_event) { | 662 const WebMouseWheelEvent& wheel_event) { |
| 663 // Only call |CancelCurrentFling()| if a fling was active, as it will | 663 // Only call |CancelCurrentFling()| if a fling was active, as it will |
| 664 // otherwise disrupt an in-progress touch scroll. | 664 // otherwise disrupt an in-progress touch scroll. |
| 665 if (!wheel_event.has_precise_scrolling_deltas && fling_curve_) | 665 if (!wheel_event.has_precise_scrolling_deltas && fling_curve_) |
| 666 CancelCurrentFling(); | 666 CancelCurrentFling(); |
| 667 | 667 |
| 668 InputHandlerProxy::EventDisposition result = DROP_EVENT; | 668 InputHandlerProxy::EventDisposition result = DROP_EVENT; |
| 669 | |
| 670 if (wheel_event.dispatch_type == WebInputEvent::kEventNonBlocking) { | |
| 671 // The first wheel event in the sequence should be cancellable. | |
| 672 DCHECK(wheel_event.phase != WebMouseWheelEvent::kPhaseBegan); | |
| 673 | |
| 674 DCHECK(mouse_wheel_result_ != kEventDispositionUndefined); | |
| 675 result = static_cast<EventDisposition>(mouse_wheel_result_); | |
| 676 | |
| 677 if (wheel_event.phase == WebMouseWheelEvent::kPhaseEnded || | |
| 678 wheel_event.phase == WebMouseWheelEvent::kPhaseCancelled || | |
| 679 wheel_event.momentum_phase == WebMouseWheelEvent::kPhaseEnded || | |
| 680 wheel_event.momentum_phase == WebMouseWheelEvent::kPhaseCancelled) { | |
| 681 mouse_wheel_result_ = kEventDispositionUndefined; | |
| 682 } | |
| 683 | |
| 684 return result; | |
|
dtapuska
2017/06/20 20:53:14
So should we really be sending back undefined? ie;
sahel
2017/06/21 18:09:59
Done. I changed it to follow the blocking path if
| |
| 685 } | |
| 686 | |
| 669 cc::EventListenerProperties properties = | 687 cc::EventListenerProperties properties = |
| 670 input_handler_->GetEventListenerProperties( | 688 input_handler_->GetEventListenerProperties( |
| 671 cc::EventListenerClass::kMouseWheel); | 689 cc::EventListenerClass::kMouseWheel); |
| 672 switch (properties) { | 690 switch (properties) { |
| 673 case cc::EventListenerProperties::kPassive: | 691 case cc::EventListenerProperties::kPassive: |
| 674 result = DID_HANDLE_NON_BLOCKING; | 692 result = DID_HANDLE_NON_BLOCKING; |
| 675 break; | 693 break; |
| 676 case cc::EventListenerProperties::kBlockingAndPassive: | 694 case cc::EventListenerProperties::kBlockingAndPassive: |
| 677 case cc::EventListenerProperties::kBlocking: | 695 case cc::EventListenerProperties::kBlocking: |
| 678 result = DID_NOT_HANDLE; | 696 result = DID_NOT_HANDLE; |
| (...skipping 982 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 1661 scroll_elasticity_controller_->GetWeakPtr(), gesture_event, | 1679 scroll_elasticity_controller_->GetWeakPtr(), gesture_event, |
| 1662 scroll_result)); | 1680 scroll_result)); |
| 1663 } | 1681 } |
| 1664 | 1682 |
| 1665 void InputHandlerProxy::SetTickClockForTesting( | 1683 void InputHandlerProxy::SetTickClockForTesting( |
| 1666 std::unique_ptr<base::TickClock> tick_clock) { | 1684 std::unique_ptr<base::TickClock> tick_clock) { |
| 1667 tick_clock_ = std::move(tick_clock); | 1685 tick_clock_ = std::move(tick_clock); |
| 1668 } | 1686 } |
| 1669 | 1687 |
| 1670 } // namespace ui | 1688 } // namespace ui |
| OLD | NEW |