[Win] Cleanups to PluginView::handleMouseEvent().
authorcommit-queue@webkit.org <commit-queue@webkit.org@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Mon, 17 Aug 2015 17:41:44 +0000 (17:41 +0000)
committercommit-queue@webkit.org <commit-queue@webkit.org@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Mon, 17 Aug 2015 17:41:44 +0000 (17:41 +0000)
https://bugs.webkit.org/show_bug.cgi?id=148024

Patch by Sungmann Cho <sungmann.cho@navercorp.com> on 2015-08-17
Reviewed by Alex Christensen.

1. Replace the raw values identifying specific mouse buttons with
   WebCore::MouseButton enum values.
2. Reindent if and switch statements.

* Plugins/PluginViewWin.cpp:
(WebCore::PluginView::handleMouseEvent):

git-svn-id: https://svn.webkit.org/repository/webkit/trunk@188525 268f45cc-cd09-0410-ab3c-d52691b4dbfc

Source/WebKit/win/ChangeLog
Source/WebKit/win/Plugins/PluginViewWin.cpp

index efe6e19..dbca4ac 100644 (file)
@@ -1,3 +1,17 @@
+2015-08-17  Sungmann Cho  <sungmann.cho@navercorp.com>
+
+        [Win] Cleanups to PluginView::handleMouseEvent().
+        https://bugs.webkit.org/show_bug.cgi?id=148024
+
+        Reviewed by Alex Christensen.
+
+        1. Replace the raw values identifying specific mouse buttons with
+           WebCore::MouseButton enum values.
+        2. Reindent if and switch statements.
+
+        * Plugins/PluginViewWin.cpp:
+        (WebCore::PluginView::handleMouseEvent):
+
 2015-08-13  Andy Estes  <aestes@apple.com>
 
         [Cocoa] Downloads do not start if policy decision is made asynchronously
index 10d3e92..010eaed 100644 (file)
@@ -617,47 +617,46 @@ void PluginView::handleMouseEvent(MouseEvent* event)
     if (event->shiftKey())
         npEvent.wParam |= MK_SHIFT;
 
-    if (event->type() == eventNames().mousemoveEvent ||
-        event->type() == eventNames().mouseoutEvent || 
-        event->type() == eventNames().mouseoverEvent) {
+    if (event->type() == eventNames().mousemoveEvent
+        || event->type() == eventNames().mouseoutEvent
+        || event->type() == eventNames().mouseoverEvent) {
         npEvent.event = WM_MOUSEMOVE;
         if (event->buttonDown())
             switch (event->button()) {
-                case LeftButton:
-                    npEvent.wParam |= MK_LBUTTON;
-                    break;
-                case MiddleButton:
-                    npEvent.wParam |= MK_MBUTTON;
-                    break;
-                case RightButton:
-                    npEvent.wParam |= MK_RBUTTON;
+            case LeftButton:
+                npEvent.wParam |= MK_LBUTTON;
+                break;
+            case MiddleButton:
+                npEvent.wParam |= MK_MBUTTON;
+                break;
+            case RightButton:
+                npEvent.wParam |= MK_RBUTTON;
                 break;
             }
-    }
-    else if (event->type() == eventNames().mousedownEvent) {
+    } else if (event->type() == eventNames().mousedownEvent) {
         focusPluginElement();
         switch (event->button()) {
-            case 0:
-                npEvent.event = WM_LBUTTONDOWN;
-                break;
-            case 1:
-                npEvent.event = WM_MBUTTONDOWN;
-                break;
-            case 2:
-                npEvent.event = WM_RBUTTONDOWN;
-                break;
+        case LeftButton:
+            npEvent.event = WM_LBUTTONDOWN;
+            break;
+        case MiddleButton:
+            npEvent.event = WM_MBUTTONDOWN;
+            break;
+        case RightButton:
+            npEvent.event = WM_RBUTTONDOWN;
+            break;
         }
     } else if (event->type() == eventNames().mouseupEvent) {
         switch (event->button()) {
-            case 0:
-                npEvent.event = WM_LBUTTONUP;
-                break;
-            case 1:
-                npEvent.event = WM_MBUTTONUP;
-                break;
-            case 2:
-                npEvent.event = WM_RBUTTONUP;
-                break;
+        case LeftButton:
+            npEvent.event = WM_LBUTTONUP;
+            break;
+        case MiddleButton:
+            npEvent.event = WM_MBUTTONUP;
+            break;
+        case RightButton:
+            npEvent.event = WM_RBUTTONUP;
+            break;
         }
     } else
         return;