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

Unified Diff: third_party/WebKit/Source/web/WebInputEventConversion.cpp

Issue 2245063006: Revert of Refactoring button field and its type (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: fix patch apply 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
« no previous file with comments | « third_party/WebKit/Source/web/WebFrameWidgetImpl.cpp ('k') | third_party/WebKit/Source/web/WebViewImpl.cpp » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: third_party/WebKit/Source/web/WebInputEventConversion.cpp
diff --git a/third_party/WebKit/Source/web/WebInputEventConversion.cpp b/third_party/WebKit/Source/web/WebInputEventConversion.cpp
index ca0bbbeefb8916f28f94d9589e96e64279344ef5..d8879e6df856cf711312a8855c1bd06715f2556e 100644
--- a/third_party/WebKit/Source/web/WebInputEventConversion.cpp
+++ b/third_party/WebKit/Source/web/WebInputEventConversion.cpp
@@ -106,7 +106,7 @@ PlatformEvent::DispatchType toPlatformDispatchType(WebInputEvent::DispatchType t
unsigned toPlatformModifierFrom(WebMouseEvent::Button button)
{
- if (button == WebMouseEvent::Button::NoButton)
+ if (button == WebMouseEvent::ButtonNone)
return 0;
unsigned webMouseButtonToPlatformModifier[] = {
@@ -115,7 +115,7 @@ unsigned toPlatformModifierFrom(WebMouseEvent::Button button)
PlatformEvent::RightButtonDown
};
- return webMouseButtonToPlatformModifier[static_cast<int>(button)];
+ return webMouseButtonToPlatformModifier[button];
}
ScrollGranularity toPlatformScrollGranularity(WebGestureEvent::ScrollUnits units)
@@ -177,6 +177,7 @@ PlatformMouseEventBuilder::PlatformMouseEventBuilder(Widget* widget, const WebMo
m_position = widget->convertFromRootFrame(flooredIntPoint(convertHitPointToRootFrame(widget, IntPoint(e.x, e.y))));
m_globalPosition = IntPoint(e.globalX, e.globalY);
m_movementDelta = IntPoint(scaleDeltaToWindow(widget, e.movementX), scaleDeltaToWindow(widget, e.movementY));
+ m_button = static_cast<MouseButton>(e.button);
m_modifiers = e.modifiers;
m_timestamp = e.timeStampSeconds;
@@ -542,31 +543,30 @@ WebMouseEventBuilder::WebMouseEventBuilder(const Widget* widget, const LayoutIte
updateWebMouseEventFromCoreMouseEvent(event, widget, layoutItem, *this);
switch (event.button()) {
- case short(WebPointerProperties::Button::Left):
- button = WebMouseEvent::Button::Left;
+ case LeftButton:
+ button = WebMouseEvent::ButtonLeft;
break;
- case short(WebPointerProperties::Button::Middle):
- button = WebMouseEvent::Button::Middle;
+ case MiddleButton:
+ button = WebMouseEvent::ButtonMiddle;
break;
- case short(WebPointerProperties::Button::Right):
- button = WebMouseEvent::Button::Right;
+ case RightButton:
+ button = WebMouseEvent::ButtonRight;
break;
}
if (event.buttonDown()) {
switch (event.button()) {
- case short(WebPointerProperties::Button::Left):
+ case LeftButton:
modifiers |= WebInputEvent::LeftButtonDown;
break;
- case short(WebPointerProperties::Button::Middle):
+ case MiddleButton:
modifiers |= WebInputEvent::MiddleButtonDown;
break;
- case short(WebPointerProperties::Button::Right):
+ case RightButton:
modifiers |= WebInputEvent::RightButtonDown;
break;
}
- } else {
- button = WebMouseEvent::Button::NoButton;
- }
+ } else
+ button = WebMouseEvent::ButtonNone;
movementX = event.movementX();
movementY = event.movementY();
clickCount = event.detail();
@@ -613,7 +613,7 @@ WebMouseEventBuilder::WebMouseEventBuilder(const Widget* widget, const LayoutIte
windowX = pointInRootFrame.x();
windowY = pointInRootFrame.y();
- button = WebMouseEvent::Button::Left;
+ button = WebMouseEvent::ButtonLeft;
modifiers |= WebInputEvent::LeftButtonDown;
clickCount = (type == MouseDown || type == MouseUp);
« no previous file with comments | « third_party/WebKit/Source/web/WebFrameWidgetImpl.cpp ('k') | third_party/WebKit/Source/web/WebViewImpl.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698