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

Unified Diff: ui/events/blink/web_input_event_builders_win.cc

Issue 2252423002: Refactoring button field and its type (2nd try) (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Rebasing 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 | « ui/events/blink/web_input_event.cc ('k') | ui/events/blink/web_input_event_traits.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: ui/events/blink/web_input_event_builders_win.cc
diff --git a/ui/events/blink/web_input_event_builders_win.cc b/ui/events/blink/web_input_event_builders_win.cc
index 090eae7c78a8115677231f5290832109edf24f38..a00e625fb65a4be7f8c72ecdf346cebab28dced9 100644
--- a/ui/events/blink/web_input_event_builders_win.cc
+++ b/ui/events/blink/web_input_event_builders_win.cc
@@ -101,20 +101,20 @@ WebMouseEvent WebMouseEventBuilder::Build(
case WM_MOUSEMOVE:
result.type = WebInputEvent::MouseMove;
if (wparam & MK_LBUTTON)
- result.button = WebMouseEvent::ButtonLeft;
+ result.button = WebMouseEvent::Button::Left;
else if (wparam & MK_MBUTTON)
- result.button = WebMouseEvent::ButtonMiddle;
+ result.button = WebMouseEvent::Button::Middle;
else if (wparam & MK_RBUTTON)
- result.button = WebMouseEvent::ButtonRight;
+ result.button = WebMouseEvent::Button::Right;
else
- result.button = WebMouseEvent::ButtonNone;
+ result.button = WebMouseEvent::Button::NoButton;
break;
case WM_MOUSELEAVE:
case WM_NCMOUSELEAVE:
// TODO(rbyers): This should be MouseLeave but is disabled temporarily.
// See http://crbug.com/450631
result.type = WebInputEvent::MouseMove;
- result.button = WebMouseEvent::ButtonNone;
+ result.button = WebMouseEvent::Button::NoButton;
// set the current mouse position (relative to the client area of the
// current window) since none is specified for this event
lparam = GetRelativeCursorPos(hwnd);
@@ -122,29 +122,29 @@ WebMouseEvent WebMouseEventBuilder::Build(
case WM_LBUTTONDOWN:
case WM_LBUTTONDBLCLK:
result.type = WebInputEvent::MouseDown;
- result.button = WebMouseEvent::ButtonLeft;
+ result.button = WebMouseEvent::Button::Left;
break;
case WM_MBUTTONDOWN:
case WM_MBUTTONDBLCLK:
result.type = WebInputEvent::MouseDown;
- result.button = WebMouseEvent::ButtonMiddle;
+ result.button = WebMouseEvent::Button::Middle;
break;
case WM_RBUTTONDOWN:
case WM_RBUTTONDBLCLK:
result.type = WebInputEvent::MouseDown;
- result.button = WebMouseEvent::ButtonRight;
+ result.button = WebMouseEvent::Button::Right;
break;
case WM_LBUTTONUP:
result.type = WebInputEvent::MouseUp;
- result.button = WebMouseEvent::ButtonLeft;
+ result.button = WebMouseEvent::Button::Left;
break;
case WM_MBUTTONUP:
result.type = WebInputEvent::MouseUp;
- result.button = WebMouseEvent::ButtonMiddle;
+ result.button = WebMouseEvent::Button::Middle;
break;
case WM_RBUTTONUP:
result.type = WebInputEvent::MouseUp;
- result.button = WebMouseEvent::ButtonRight;
+ result.button = WebMouseEvent::Button::Right;
break;
default:
NOTREACHED();
@@ -176,7 +176,7 @@ WebMouseEvent WebMouseEventBuilder::Build(
// where their original code looks buggy.
static int last_click_position_x;
static int last_click_position_y;
- static WebMouseEvent::Button last_click_button = WebMouseEvent::ButtonLeft;
+ static WebMouseEvent::Button last_click_button = WebMouseEvent::Button::Left;
double current_time = result.timeStampSeconds;
bool cancel_previous_click =
@@ -239,7 +239,7 @@ WebMouseWheelEvent WebMouseWheelEventBuilder::Build(
result.timeStampSeconds = time_stamp;
- result.button = WebMouseEvent::ButtonNone;
+ result.button = WebMouseEvent::Button::NoButton;
result.pointerType = pointer_type;
« no previous file with comments | « ui/events/blink/web_input_event.cc ('k') | ui/events/blink/web_input_event_traits.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698