| Index: content/renderer/render_widget.cc
|
| diff --git a/content/renderer/render_widget.cc b/content/renderer/render_widget.cc
|
| index 3a39f6040cfd57f53cf3290bbbebabee32a87c69..ccbde89452945af158ae8f965ea7833bec2a7189 100644
|
| --- a/content/renderer/render_widget.cc
|
| +++ b/content/renderer/render_widget.cc
|
| @@ -373,7 +373,8 @@ RenderWidget::RenderWidget(blink::WebPopupType popup_type,
|
| has_focus_(false),
|
| handling_input_event_(false),
|
| handling_ime_event_(false),
|
| - handling_touchstart_event_(false),
|
| + handling_event_type_(WebInputEvent::Undefined),
|
| + ignore_ack_for_current_mouse_move_(false),
|
| closing_(false),
|
| is_swapped_out_(swapped_out),
|
| input_method_is_active_(false),
|
| @@ -916,6 +917,7 @@ void RenderWidget::OnHandleInputEvent(const blink::WebInputEvent* input_event,
|
| handling_input_event_ = false;
|
| return;
|
| }
|
| + handling_event_type_ = input_event->type;
|
|
|
| base::TimeTicks start_time;
|
| if (base::TimeTicks::IsHighResNowFastAndReliable())
|
| @@ -1001,9 +1003,6 @@ void RenderWidget::OnHandleInputEvent(const blink::WebInputEvent* input_event,
|
| prevent_default = prevent_default || WillHandleGestureEvent(gesture_event);
|
| }
|
|
|
| - if (input_event->type == WebInputEvent::TouchStart)
|
| - handling_touchstart_event_ = true;
|
| -
|
| bool processed = prevent_default;
|
| if (input_event->type != WebInputEvent::Char || !suppress_next_char_events_) {
|
| suppress_next_char_events_ = false;
|
| @@ -1011,8 +1010,6 @@ void RenderWidget::OnHandleInputEvent(const blink::WebInputEvent* input_event,
|
| processed = webwidget_->handleInputEvent(*input_event);
|
| }
|
|
|
| - handling_touchstart_event_ = false;
|
| -
|
| // If this RawKeyDown event corresponds to a browser keyboard shortcut and
|
| // it's not processed by webkit, then we need to suppress the upcoming Char
|
| // events.
|
| @@ -1061,7 +1058,11 @@ void RenderWidget::OnHandleInputEvent(const blink::WebInputEvent* input_event,
|
|
|
| TRACE_EVENT_SYNTHETIC_DELAY_END("blink.HandleInputEvent");
|
|
|
| - if (!WebInputEventTraits::IgnoresAckDisposition(*input_event)) {
|
| + // Note that we can't use handling_event_type_ here since it will be overriden
|
| + // by reentrant calls for events after the paused one.
|
| + bool no_ack = ignore_ack_for_current_mouse_move_ &&
|
| + input_event->type == WebInputEvent::MouseMove;
|
| + if (!WebInputEventTraits::IgnoresAckDisposition(*input_event) && !no_ack) {
|
| scoped_ptr<IPC::Message> response(
|
| new InputHostMsg_HandleInputEvent_ACK(routing_id_,
|
| input_event->type,
|
| @@ -1087,6 +1088,7 @@ void RenderWidget::OnHandleInputEvent(const blink::WebInputEvent* input_event,
|
| Send(response.release());
|
| }
|
| }
|
| + ignore_ack_for_current_mouse_move_ = false;
|
|
|
| #if defined(OS_ANDROID)
|
| // Allow the IME to be shown when the focus changes as a consequence
|
| @@ -1101,6 +1103,7 @@ void RenderWidget::OnHandleInputEvent(const blink::WebInputEvent* input_event,
|
| UpdateTextInputState(SHOW_IME_IF_NEEDED, FROM_IME);
|
| #endif
|
|
|
| + handling_event_type_ = WebInputEvent::Undefined;
|
| handling_input_event_ = false;
|
|
|
| if (!prevent_default) {
|
| @@ -1541,6 +1544,21 @@ bool RenderWidget::ShouldHandleImeEvent() {
|
| #endif
|
| }
|
|
|
| +bool RenderWidget::SendAckForCurrentMouseMove() {
|
| + if (handling_event_type_ == WebInputEvent::MouseMove) {
|
| + Send(new InputHostMsg_HandleInputEvent_ACK(routing_id_,
|
| + handling_event_type_,
|
| + INPUT_EVENT_ACK_STATE_CONSUMED,
|
| + ui::LatencyInfo()));
|
| + return true;
|
| + }
|
| + return false;
|
| +}
|
| +
|
| +void RenderWidget::IgnoreAckForCurrentMouseMove() {
|
| + ignore_ack_for_current_mouse_move_ = true;
|
| +}
|
| +
|
| void RenderWidget::SetDeviceScaleFactor(float device_scale_factor) {
|
| if (device_scale_factor_ == device_scale_factor)
|
| return;
|
| @@ -1992,7 +2010,7 @@ void RenderWidget::setTouchAction(
|
|
|
| // Ignore setTouchAction calls that result from synthetic touch events (eg.
|
| // when blink is emulating touch with mouse).
|
| - if (!handling_touchstart_event_)
|
| + if (!handling_event_type_ == WebInputEvent::TouchStart)
|
| return;
|
|
|
| // Verify the same values are used by the types so we can cast between them.
|
|
|