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

Unified Diff: content/browser/frame_host/render_widget_host_view_guest.cc

Issue 2164673002: Queued wheel events should not use ScopedInputScaleDisabler. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Rescale all necessary attributes. Created 4 years, 5 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 | « no previous file | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: content/browser/frame_host/render_widget_host_view_guest.cc
diff --git a/content/browser/frame_host/render_widget_host_view_guest.cc b/content/browser/frame_host/render_widget_host_view_guest.cc
index d433e64c164122f7deae254bb6a39da4f45014db..7a120f174318e966af87ae02518243d0cf47c144 100644
--- a/content/browser/frame_host/render_widget_host_view_guest.cc
+++ b/content/browser/frame_host/render_widget_host_view_guest.cc
@@ -555,6 +555,23 @@ void RenderWidgetHostViewGuest::OnHandleInputEvent(
RenderWidgetHostImpl* embedder,
int browser_plugin_instance_id,
const blink::WebInputEvent* event) {
+ // WebMouseWheelEvents go into a queue, and may not be forwarded to the
+ // renderer until after this method goes out of scope. Therefore we need to
+ // explicitly remove the additional device scale factor from the coordinates
+ // before allowing the event to be queued.
+ if (event->type == blink::WebInputEvent::MouseWheel) {
oshima 2016/07/19 21:40:48 you also need to check "IsZoomForDSFEnabled()". A
+ blink::WebMouseWheelEvent rescaled_event =
+ *static_cast<const blink::WebMouseWheelEvent*>(event);
+ rescaled_event.x /= current_device_scale_factor();
+ rescaled_event.y /= current_device_scale_factor();
+ rescaled_event.deltaX /= current_device_scale_factor();
+ rescaled_event.deltaY /= current_device_scale_factor();
+ rescaled_event.wheelTicksX /= current_device_scale_factor();
+ rescaled_event.wheelTicksY /= current_device_scale_factor();
+ host_->ForwardWheelEvent(rescaled_event);
+ return;
+ }
+
ScopedInputScaleDisabler disable(host_, current_device_scale_factor());
if (blink::WebInputEvent::isMouseEventType(event->type)) {
// The mouse events for BrowserPlugin are modified by all
@@ -578,12 +595,6 @@ void RenderWidgetHostViewGuest::OnHandleInputEvent(
return;
}
- if (event->type == blink::WebInputEvent::MouseWheel) {
- host_->ForwardWheelEvent(
- *static_cast<const blink::WebMouseWheelEvent*>(event));
- return;
- }
-
if (blink::WebInputEvent::isKeyboardEventType(event->type)) {
if (!embedder->GetLastKeyboardEvent())
return;
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698