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

Unified Diff: content/renderer/pepper/event_conversion.cc

Issue 2289273002: Eraser tool type plumbing from ui/events to web events and PPAPI. (Closed)
Patch Set: Created 4 years, 4 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
Index: content/renderer/pepper/event_conversion.cc
diff --git a/content/renderer/pepper/event_conversion.cc b/content/renderer/pepper/event_conversion.cc
index 20e1ce8e4b47a8f4f11f00accec64a1cab5e7afe..dc1b3e4f6511ede64ae4dde612de4de874b60130 100644
--- a/content/renderer/pepper/event_conversion.cc
+++ b/content/renderer/pepper/event_conversion.cc
@@ -80,6 +80,9 @@ static_assert(static_cast<int>(PP_INPUTEVENT_MODIFIER_ISLEFT) ==
static_assert(static_cast<int>(PP_INPUTEVENT_MODIFIER_ISRIGHT) ==
static_cast<int>(WebInputEvent::IsRight),
"IsRight should match");
+static_assert(static_cast<int>(PP_INPUTEVENT_MODIFIER_ISERASER) ==
+ static_cast<int>(WebInputEvent::IsEraser),
+ "IsEraser should match");
PP_InputEvent_Type ConvertEventTypes(WebInputEvent::Type wetype) {
switch (wetype) {
@@ -187,6 +190,9 @@ void AppendMouseEvent(const WebInputEvent& event,
const WebMouseEvent& mouse_event = static_cast<const WebMouseEvent&>(event);
InputEventData result = GetEventWithCommonFieldsAndType(event);
result.event_modifiers = mouse_event.modifiers;
+ if (mouse_event.pointerType == blink::WebPointerProperties::PointerType::Eraser) {
+ result.event_modifiers |= PP_INPUTEVENT_MODIFIER_ISERASER;
+ }
if (mouse_event.type == WebInputEvent::MouseDown ||
mouse_event.type == WebInputEvent::MouseMove ||
mouse_event.type == WebInputEvent::MouseUp) {

Powered by Google App Engine
This is Rietveld 408576698