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

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

Issue 1266643002: content: Populate WebPointerProperties with stylus details from ui::MouseEvent (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@experimental-pointer-events
Patch Set: Test MakeWebMouseEvent and MakeWebMouseWheelEvent instead Created 5 years, 3 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 | content/browser/renderer_host/web_input_event_aura_unittest.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: content/browser/renderer_host/web_input_event_aura.cc
diff --git a/content/browser/renderer_host/web_input_event_aura.cc b/content/browser/renderer_host/web_input_event_aura.cc
index bbad8c7729de5201641ca854491549d3ff0f6816..fe4dfb7fdeee43a4c0da75ac4f9182ee9da94904 100644
--- a/content/browser/renderer_host/web_input_event_aura.cc
+++ b/content/browser/renderer_host/web_input_event_aura.cc
@@ -48,6 +48,22 @@ blink::WebInputEvent::Modifiers DomCodeToWebInputEventModifiers(
return static_cast<blink::WebInputEvent::Modifiers>(0);
}
+blink::WebPointerProperties::PointerType EventPointerTypeToWebPointerType(
+ ui::EventPointerType pointer_type) {
+ switch (pointer_type) {
+ case ui::EventPointerType::POINTER_TYPE_UNKNOWN:
+ return blink::WebPointerProperties::PointerType::PointerTypeUnknown;
+ case ui::EventPointerType::POINTER_TYPE_MOUSE:
+ return blink::WebPointerProperties::PointerType::PointerTypeMouse;
+ case ui::EventPointerType::POINTER_TYPE_PEN:
+ return blink::WebPointerProperties::PointerType::PointerTypePen;
+ case ui::EventPointerType::POINTER_TYPE_TOUCH:
+ return blink::WebPointerProperties::PointerType::PointerTypeTouch;
+ }
+ NOTREACHED() << "Unexpected EventPointerType";
+ return blink::WebPointerProperties::PointerType::PointerTypeUnknown;
+}
+
} // namespace
#if defined(OS_WIN)
@@ -379,6 +395,12 @@ blink::WebMouseEvent MakeWebMouseEventFromAuraEvent(
break;
}
+ webkit_event.tiltX = roundf(event.pointer_details().tilt_x());
+ webkit_event.tiltY = roundf(event.pointer_details().tilt_y());
+ webkit_event.force = event.pointer_details().force();
+ webkit_event.pointerType =
+ EventPointerTypeToWebPointerType(event.pointer_details().pointer_type());
+
return webkit_event;
}
@@ -402,6 +424,12 @@ blink::WebMouseWheelEvent MakeWebMouseWheelEventFromAuraEvent(
webkit_event.wheelTicksX = webkit_event.deltaX / kPixelsPerTick;
webkit_event.wheelTicksY = webkit_event.deltaY / kPixelsPerTick;
+ webkit_event.tiltX = roundf(event.pointer_details().tilt_x());
+ webkit_event.tiltY = roundf(event.pointer_details().tilt_y());
+ webkit_event.force = event.pointer_details().force();
+ webkit_event.pointerType =
+ EventPointerTypeToWebPointerType(event.pointer_details().pointer_type());
+
return webkit_event;
}
« no previous file with comments | « no previous file | content/browser/renderer_host/web_input_event_aura_unittest.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698