| Index: content/browser/renderer_host/input/mouse_wheel_event_queue.cc
|
| diff --git a/content/browser/renderer_host/input/mouse_wheel_event_queue.cc b/content/browser/renderer_host/input/mouse_wheel_event_queue.cc
|
| index 1728da15397f81f3146534e1220b523969983213..ef0862aa845f6784ef91f40ac4dae0d976dcba3f 100644
|
| --- a/content/browser/renderer_host/input/mouse_wheel_event_queue.cc
|
| +++ b/content/browser/renderer_host/input/mouse_wheel_event_queue.cc
|
| @@ -37,8 +37,6 @@ class QueuedWebMouseWheelEvent : public MouseWheelEventWithLatencyInfo {
|
| MouseWheelEventQueue::MouseWheelEventQueue(MouseWheelEventQueueClient* client,
|
| bool enable_scroll_latching)
|
| : client_(client),
|
| - needs_scroll_begin_(true),
|
| - needs_scroll_end_(false),
|
| enable_scroll_latching_(enable_scroll_latching),
|
| scrolling_device_(blink::kWebGestureDeviceUninitialized) {
|
| DCHECK(client);
|
| @@ -180,8 +178,9 @@ void MouseWheelEventQueue::ProcessMouseWheelAck(
|
| // because the events generated will be a GSB (non-synthetic) and GSE
|
| // (non-synthetic). This situation arises when OSX generates double
|
| // phase end information.
|
| - bool empty_sequence =
|
| - !needs_update && needs_scroll_begin_ && current_phase_ended;
|
| + bool empty_sequence = !needs_update &&
|
| + !client_->IsInGestureScrollForTouchpad() &&
|
| + current_phase_ended;
|
|
|
| if (enable_scroll_latching_) {
|
| if (event_sent_for_gesture_ack_->event.momentum_phase ==
|
| @@ -192,7 +191,7 @@ void MouseWheelEventQueue::ProcessMouseWheelAck(
|
| }
|
|
|
| if (needs_update || !empty_sequence) {
|
| - if (needs_scroll_begin_) {
|
| + if (!client_->IsInGestureScrollForTouchpad()) {
|
| SendScrollBegin(scroll_update, false);
|
| }
|
|
|
| @@ -221,7 +220,7 @@ void MouseWheelEventQueue::ProcessMouseWheelAck(
|
|
|
| } else { // !enable_scroll_latching_
|
| if (needs_update || !empty_sequence) {
|
| - if (needs_scroll_begin_) {
|
| + if (!client_->IsInGestureScrollForTouchpad()) {
|
| // If no GSB has been sent, it will be a non-synthetic GSB.
|
| SendScrollBegin(scroll_update, false);
|
| } else if (has_phase_info) {
|
| @@ -284,8 +283,6 @@ void MouseWheelEventQueue::OnGestureScrollEvent(
|
| // Don't send the pending ScrollEnd if a fling is happening.
|
| // The next wheel event will still need a ScrollBegin.
|
| scroll_end_timer_.Stop();
|
| - needs_scroll_begin_ = true;
|
| - needs_scroll_end_ = false;
|
| } else {
|
| scroll_end_timer_.Reset();
|
| }
|
| @@ -307,7 +304,8 @@ void MouseWheelEventQueue::TryForwardNextEventToRenderer() {
|
|
|
| void MouseWheelEventQueue::SendScrollEnd(WebGestureEvent update_event,
|
| bool synthetic) {
|
| - DCHECK((synthetic && !needs_scroll_end_) || needs_scroll_end_);
|
| + DCHECK((synthetic && !client_->IsInGestureScrollForTouchpad()) ||
|
| + client_->IsInGestureScrollForTouchpad());
|
|
|
| WebGestureEvent scroll_end(update_event);
|
| scroll_end.SetTimeStampSeconds(
|
| @@ -320,13 +318,9 @@ void MouseWheelEventQueue::SendScrollEnd(WebGestureEvent update_event,
|
| scroll_end.data.scroll_end.delta_units =
|
| update_event.data.scroll_update.delta_units;
|
|
|
| - if (!synthetic) {
|
| - needs_scroll_begin_ = true;
|
| - needs_scroll_end_ = false;
|
| + if (!synthetic && scroll_end_timer_.IsRunning())
|
| + scroll_end_timer_.Reset();
|
|
|
| - if (scroll_end_timer_.IsRunning())
|
| - scroll_end_timer_.Reset();
|
| - }
|
| client_->ForwardGestureEventWithLatencyInfo(
|
| scroll_end, ui::LatencyInfo(ui::SourceEventType::WHEEL));
|
| }
|
| @@ -334,7 +328,8 @@ void MouseWheelEventQueue::SendScrollEnd(WebGestureEvent update_event,
|
| void MouseWheelEventQueue::SendScrollBegin(
|
| const WebGestureEvent& gesture_update,
|
| bool synthetic) {
|
| - DCHECK((synthetic && !needs_scroll_begin_) || needs_scroll_begin_);
|
| + DCHECK((synthetic && client_->IsInGestureScrollForTouchpad()) ||
|
| + !client_->IsInGestureScrollForTouchpad());
|
|
|
| WebGestureEvent scroll_begin(gesture_update);
|
| scroll_begin.SetType(WebInputEvent::kGestureScrollBegin);
|
| @@ -349,8 +344,6 @@ void MouseWheelEventQueue::SendScrollBegin(
|
| scroll_begin.data.scroll_begin.delta_hint_units =
|
| gesture_update.data.scroll_update.delta_units;
|
|
|
| - needs_scroll_begin_ = false;
|
| - needs_scroll_end_ = true;
|
| client_->ForwardGestureEventWithLatencyInfo(
|
| scroll_begin, ui::LatencyInfo(ui::SourceEventType::WHEEL));
|
| }
|
|
|