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

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

Issue 2227563003: Refactoring button field and its type (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Fix new instances 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 d8879e6df856cf711312a8855c1bd06715f2556e..ca0bbbeefb8916f28f94d9589e96e64279344ef5 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::ButtonNone)
+ if (button == WebMouseEvent::Button::NoButton)
return 0;
unsigned webMouseButtonToPlatformModifier[] = {
@@ -115,7 +115,7 @@ unsigned toPlatformModifierFrom(WebMouseEvent::Button button)
PlatformEvent::RightButtonDown
};
- return webMouseButtonToPlatformModifier[button];
+ return webMouseButtonToPlatformModifier[static_cast<int>(button)];
}
ScrollGranularity toPlatformScrollGranularity(WebGestureEvent::ScrollUnits units)
@@ -177,7 +177,6 @@ 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;
@@ -543,30 +542,31 @@ WebMouseEventBuilder::WebMouseEventBuilder(const Widget* widget, const LayoutIte
updateWebMouseEventFromCoreMouseEvent(event, widget, layoutItem, *this);
switch (event.button()) {
- case LeftButton:
- button = WebMouseEvent::ButtonLeft;
+ case short(WebPointerProperties::Button::Left):
+ button = WebMouseEvent::Button::Left;
break;
- case MiddleButton:
- button = WebMouseEvent::ButtonMiddle;
+ case short(WebPointerProperties::Button::Middle):
+ button = WebMouseEvent::Button::Middle;
break;
- case RightButton:
- button = WebMouseEvent::ButtonRight;
+ case short(WebPointerProperties::Button::Right):
+ button = WebMouseEvent::Button::Right;
break;
}
if (event.buttonDown()) {
switch (event.button()) {
- case LeftButton:
+ case short(WebPointerProperties::Button::Left):
modifiers |= WebInputEvent::LeftButtonDown;
break;
- case MiddleButton:
+ case short(WebPointerProperties::Button::Middle):
modifiers |= WebInputEvent::MiddleButtonDown;
break;
- case RightButton:
+ case short(WebPointerProperties::Button::Right):
modifiers |= WebInputEvent::RightButtonDown;
break;
}
- } else
- button = WebMouseEvent::ButtonNone;
+ } else {
+ button = WebMouseEvent::Button::NoButton;
+ }
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::ButtonLeft;
+ button = WebMouseEvent::Button::Left;
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