Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(173)

Unified Diff: content/browser/renderer_host/render_widget_host_view_aura.cc

Issue 2386103004: Ensure that we don't report huge mouse movement deltas for mouse enter and leave events. (Closed)
Patch Set: Don't update the location for mouse move events originating from the mouse enter and leave events. Created 4 years, 2 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « content/browser/renderer_host/render_widget_host_view_aura.h ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: content/browser/renderer_host/render_widget_host_view_aura.cc
diff --git a/content/browser/renderer_host/render_widget_host_view_aura.cc b/content/browser/renderer_host/render_widget_host_view_aura.cc
index e93fd494ddc7155ee6e7dff1db0adbc5df502567..a9250285184169b0462a5f87cf20421b33980960 100644
--- a/content/browser/renderer_host/render_widget_host_view_aura.cc
+++ b/content/browser/renderer_host/render_widget_host_view_aura.cc
@@ -1875,7 +1875,7 @@ void RenderWidgetHostViewAura::OnMouseEvent(ui::MouseEvent* event) {
}
}
- ModifyEventMovementAndCoords(&mouse_event);
+ ModifyEventMovementAndCoords(&mouse_event, event);
bool should_not_forward = is_move_to_center_event && synthetic_move_sent_;
if (should_not_forward) {
@@ -1954,7 +1954,7 @@ void RenderWidgetHostViewAura::OnMouseEvent(ui::MouseEvent* event) {
blink::WebMouseEvent mouse_event = ui::MakeWebMouseEvent(
*event, base::Bind(&GetScreenLocationFromEvent));
- ModifyEventMovementAndCoords(&mouse_event);
+ ModifyEventMovementAndCoords(&mouse_event, event);
if (ShouldRouteEvent(event)) {
host_->delegate()->GetInputEventRouter()->RouteMouseEvent(
this, &mouse_event, *event->latency());
@@ -2500,12 +2500,14 @@ void RenderWidgetHostViewAura::FinishImeCompositionSession() {
}
void RenderWidgetHostViewAura::ModifyEventMovementAndCoords(
- blink::WebMouseEvent* event) {
+ blink::WebMouseEvent* event,
+ ui::MouseEvent* ui_mouse_event) {
sky 2016/10/06 16:33:36 Make this take a const&, in fact can both args be
ananta 2016/10/06 21:15:18 Changed ui_mouse_event to be a const ref. The othe
// If the mouse has just entered, we must report zero movementX/Y. Hence we
// reset any global_mouse_position set previously.
- if (event->type == blink::WebInputEvent::MouseEnter ||
- event->type == blink::WebInputEvent::MouseLeave)
- global_mouse_position_.SetPoint(event->globalX, event->globalY);
+ if (ui_mouse_event->type() == ui::ET_MOUSE_ENTERED ||
+ ui_mouse_event->type() == ui::ET_MOUSE_EXITED) {
+ global_mouse_position_.SetPoint(event->globalX, event->globalY);
sky 2016/10/04 18:17:55 This is the first I've seen of ModifyEventMovement
ananta 2016/10/04 19:44:52 The global_mouse_position technically can be possi
+ }
// Movement is computed by taking the difference of the new cursor position
// and the previous. Under mouse lock the cursor will be warped back to the
« no previous file with comments | « content/browser/renderer_host/render_widget_host_view_aura.h ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698