Chromium Code Reviews| Index: content/renderer/render_widget.cc |
| diff --git a/content/renderer/render_widget.cc b/content/renderer/render_widget.cc |
| index 0c1037f3cbe4860e9f5b0363e1c0db3842bd2ffa..5eb6d1efdc727ea5915d4a14b6f0c72e5022842c 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_mouse_move_from_debugger_(false), |
| closing_(false), |
| is_swapped_out_(swapped_out), |
| input_method_is_active_(false), |
| @@ -908,6 +909,7 @@ void RenderWidget::OnHandleInputEvent(const blink::WebInputEvent* input_event, |
| handling_input_event_ = false; |
| return; |
| } |
| + handling_event_type_ = input_event->type; |
|
jdduke (slow)
2014/05/19 15:10:37
Any reason we can't use base::AutoReset here (also
dgozman
2014/05/20 08:54:13
Done.
|
| base::TimeTicks start_time; |
| if (base::TimeTicks::IsHighResNowFastAndReliable()) |
| @@ -993,9 +995,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; |
| @@ -1003,8 +1002,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. |
| @@ -1053,7 +1050,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_mouse_move_from_debugger_ && |
| + 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, |
| @@ -1079,6 +1080,7 @@ void RenderWidget::OnHandleInputEvent(const blink::WebInputEvent* input_event, |
| Send(response.release()); |
| } |
| } |
| + ignore_ack_for_mouse_move_from_debugger_ = false; |
| #if defined(OS_ANDROID) |
| // Allow the IME to be shown when the focus changes as a consequence |
| @@ -1093,6 +1095,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) { |
| @@ -1516,6 +1519,21 @@ bool RenderWidget::ShouldHandleImeEvent() { |
| #endif |
| } |
| +bool RenderWidget::SendAckForMouseMoveFromDebugger() { |
| + 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::IgnoreAckForMouseMoveFromDebugger() { |
| + ignore_ack_for_mouse_move_from_debugger_ = true; |
| +} |
| + |
| void RenderWidget::SetDeviceScaleFactor(float device_scale_factor) { |
| if (device_scale_factor_ == device_scale_factor) |
| return; |
| @@ -1962,7 +1980,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) |
|
jdduke (slow)
2014/05/19 15:10:37
|handling_event_type_ != WebInputEvent::TouchStart
dgozman
2014/05/20 08:54:13
Nice catch! Done.
|
| return; |
| // Verify the same values are used by the types so we can cast between them. |