Index: content/browser/renderer_host/render_widget_host_impl.cc |
diff --git a/content/browser/renderer_host/render_widget_host_impl.cc b/content/browser/renderer_host/render_widget_host_impl.cc |
index 7ca455b49d209dae0e4d33bce17954abf489bc9e..057db8493b9f3644b86b64afb10d5643836b2311 100644 |
--- a/content/browser/renderer_host/render_widget_host_impl.cc |
+++ b/content/browser/renderer_host/render_widget_host_impl.cc |
@@ -903,37 +903,16 @@ void RenderWidgetHostImpl::ForwardMouseEvent(const WebMouseEvent& mouse_event) { |
return; |
} |
- // Avoid spamming the renderer with mouse move events. It is important |
- // to note that WM_MOUSEMOVE events are anyways synthetic, but since our |
- // thread is able to rapidly consume WM_MOUSEMOVE events, we may get way |
- // more WM_MOUSEMOVE events than we wish to send to the renderer. |
- if (mouse_event.type == WebInputEvent::MouseMove) { |
- if (mouse_move_pending_) { |
- if (!next_mouse_move_.get()) { |
- next_mouse_move_.reset(new WebMouseEvent(mouse_event)); |
- } else { |
- // Accumulate movement deltas. |
- int x = next_mouse_move_->movementX; |
- int y = next_mouse_move_->movementY; |
- *next_mouse_move_ = mouse_event; |
- next_mouse_move_->movementX += x; |
- next_mouse_move_->movementY += y; |
- } |
- return; |
- } |
- mouse_move_pending_ = true; |
- } else if (mouse_event.type == WebInputEvent::MouseDown) { |
- if (gesture_event_filter_->GetTapSuppressionController()-> |
+ if (mouse_event.type == WebInputEvent::MouseDown && |
+ gesture_event_filter_->GetTapSuppressionController()-> |
ShouldDeferMouseDown(mouse_event)) |
return; |
- OnUserGesture(); |
- } else if (mouse_event.type == WebInputEvent::MouseUp) { |
- if (gesture_event_filter_->GetTapSuppressionController()-> |
+ if (mouse_event.type == WebInputEvent::MouseUp && |
+ gesture_event_filter_->GetTapSuppressionController()-> |
ShouldSuppressMouseUp()) |
return; |
- } |
- ForwardInputEvent(mouse_event, sizeof(WebMouseEvent), false); |
+ ForwardMouseEventImmediately(mouse_event); |
} |
void RenderWidgetHostImpl::OnPointerEventActivate() { |
@@ -989,6 +968,47 @@ void RenderWidgetHostImpl::ForwardGestureEvent( |
ForwardInputEvent(gesture_event, sizeof(WebGestureEvent), false); |
} |
+// Forwards MouseEvent without passing it through TapSuppressionController |
+void RenderWidgetHostImpl::ForwardMouseEventImmediately( |
+ const WebMouseEvent& mouse_event) { |
+ TRACE_EVENT2("renderer_host", |
+ "RenderWidgetHostImpl::ForwardMouseEventImmediately", |
+ "x", mouse_event.x, "y", mouse_event.y); |
+ if (ignore_input_events_ || process_->IgnoreInputEvents()) |
+ return; |
+ |
+ if (CommandLine::ForCurrentProcess()->HasSwitch( |
+ switches::kSimulateTouchScreenWithMouse)) { |
+ SimulateTouchGestureWithMouse(mouse_event); |
+ return; |
+ } |
+ |
+ // Avoid spamming the renderer with mouse move events. It is important |
+ // to note that WM_MOUSEMOVE events are anyways synthetic, but since our |
+ // thread is able to rapidly consume WM_MOUSEMOVE events, we may get way |
+ // more WM_MOUSEMOVE events than we wish to send to the renderer. |
+ if (mouse_event.type == WebInputEvent::MouseMove) { |
+ if (mouse_move_pending_) { |
+ if (!next_mouse_move_.get()) { |
+ next_mouse_move_.reset(new WebMouseEvent(mouse_event)); |
+ } else { |
+ // Accumulate movement deltas. |
+ int x = next_mouse_move_->movementX; |
+ int y = next_mouse_move_->movementY; |
+ *next_mouse_move_ = mouse_event; |
+ next_mouse_move_->movementX += x; |
+ next_mouse_move_->movementY += y; |
+ } |
+ return; |
+ } |
+ mouse_move_pending_ = true; |
+ } else if (mouse_event.type == WebInputEvent::MouseDown) { |
+ OnUserGesture(); |
+ } |
+ |
+ ForwardInputEvent(mouse_event, sizeof(WebMouseEvent), false); |
+} |
+ |
void RenderWidgetHostImpl::ForwardTouchEventImmediately( |
const WebKit::WebTouchEvent& touch_event) { |
TRACE_EVENT0("renderer_host", "RenderWidgetHostImpl::ForwardTouchEvent"); |