Bug 895274 part.83 Rename NS_DRAGDROP_EXIT to eDragExit r=smaug
authorMasayuki Nakano <masayuki@d-toybox.com>
Wed, 02 Sep 2015 15:08:02 +0900
changeset 260515 aaffbbb943e446e995c9f08c363bae24e0712a28
parent 260514 cad395df60d302e74ba82c7f46626180eb885d13
child 260516 3a188aef7f84eac26f6401ee337dd7c4d37b3f90
push id14999
push usercbook@mozilla.com
push dateWed, 02 Sep 2015 12:52:41 +0000
treeherderfx-team@2fa46d1de9bf [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewerssmaug
bugs895274
milestone43.0a1
Bug 895274 part.83 Rename NS_DRAGDROP_EXIT to eDragExit r=smaug
dom/events/EventNameList.h
dom/events/EventStateManager.cpp
dom/ipc/TabChild.cpp
editor/libeditor/nsEditorEventListener.cpp
layout/xul/tree/nsTreeBodyFrame.cpp
widget/EventMessageList.h
widget/MouseEvents.h
widget/WidgetEventImpl.cpp
widget/cocoa/nsChildView.mm
widget/gtk/nsDragService.cpp
widget/nsBaseWidget.cpp
widget/windows/nsNativeDragTarget.cpp
--- a/dom/events/EventNameList.h
+++ b/dom/events/EventNameList.h
@@ -715,17 +715,17 @@ NON_IDL_EVENT(broadcast,
               NS_XUL_BROADCAST,
               EventNameType_XUL,
               eBasicEventClass)
 NON_IDL_EVENT(commandupdate,
               NS_XUL_COMMAND_UPDATE,
               EventNameType_XUL,
               eBasicEventClass)
 NON_IDL_EVENT(dragexit,
-              NS_DRAGDROP_EXIT,
+              eDragExit,
               EventNameType_XUL,
               eDragEventClass)
 NON_IDL_EVENT(dragdrop,
               NS_DRAGDROP_DRAGDROP,
               EventNameType_XUL,
               eDragEventClass)
 NON_IDL_EVENT(draggesture,
               NS_DRAGDROP_GESTURE,
--- a/dom/events/EventStateManager.cpp
+++ b/dom/events/EventStateManager.cpp
@@ -1189,17 +1189,17 @@ CrossProcessSafeEvent(const WidgetEvent&
     case NS_TOUCH_CANCEL:
       return true;
     default:
       return false;
     }
   case eDragEventClass:
     switch (aEvent.mMessage) {
     case eDragOver:
-    case NS_DRAGDROP_EXIT:
+    case eDragExit:
     case eDrop:
       return true;
     default:
       break;
     }
   default:
     return false;
   }
@@ -3314,19 +3314,19 @@ EventStateManager::PostHandleEvent(nsPre
           presShell->HandleEventWithTarget(&event, mCurrentTarget,
                                            targetContent, &status);
         }
       }
       sLastDragOverFrame = nullptr;
       ClearGlobalActiveContent(this);
       break;
     }
-  case NS_DRAGDROP_EXIT:
+  case eDragExit:
      // make sure to fire the enter and exit_synth events after the
-     // NS_DRAGDROP_EXIT event, otherwise we'll clean up too early
+     // eDragExit event, otherwise we'll clean up too early
     GenerateDragDropEnterExit(presContext, aEvent->AsDragEvent());
     break;
 
   case eBeforeKeyUp:
   case eKeyUp:
   case eAfterKeyUp:
     break;
 
@@ -4311,17 +4311,17 @@ EventStateManager::GenerateDragDropEnter
                                            getter_AddRefs(targetContent));
 
         if (sLastDragOverFrame) {
           //The frame has changed but the content may not have. Check before dispatching to content
           sLastDragOverFrame->GetContentForEvent(aDragEvent,
                                                  getter_AddRefs(lastContent));
 
           FireDragEnterOrExit(sLastDragOverFrame->PresContext(),
-                              aDragEvent, NS_DRAGDROP_EXIT,
+                              aDragEvent, eDragExit,
                               targetContent, lastContent, sLastDragOverFrame);
         }
 
         FireDragEnterOrExit(aPresContext, aDragEvent, eDragEnter,
                             lastContent, targetContent, mCurrentTarget);
 
         if (sLastDragOverFrame) {
           FireDragEnterOrExit(sLastDragOverFrame->PresContext(),
@@ -4329,27 +4329,27 @@ EventStateManager::GenerateDragDropEnter
                               targetContent, lastContent, sLastDragOverFrame);
         }
 
         sLastDragOverFrame = mCurrentTarget;
       }
     }
     break;
 
-  case NS_DRAGDROP_EXIT:
+  case eDragExit:
     {
       //This is actually the window mouse exit event.
       if (sLastDragOverFrame) {
         nsCOMPtr<nsIContent> lastContent;
         sLastDragOverFrame->GetContentForEvent(aDragEvent,
                                                getter_AddRefs(lastContent));
 
         nsRefPtr<nsPresContext> lastDragOverFramePresContext = sLastDragOverFrame->PresContext();
         FireDragEnterOrExit(lastDragOverFramePresContext,
-                            aDragEvent, NS_DRAGDROP_EXIT,
+                            aDragEvent, eDragExit,
                             nullptr, lastContent, sLastDragOverFrame);
         FireDragEnterOrExit(lastDragOverFramePresContext,
                             aDragEvent, eDragLeave,
                             nullptr, lastContent, sLastDragOverFrame);
 
         sLastDragOverFrame = nullptr;
       }
     }
@@ -4388,25 +4388,24 @@ EventStateManager::FireDragEnterOrExit(n
   if (aTargetContent != aRelatedTarget) {
     //XXX This event should still go somewhere!!
     if (aTargetContent) {
       EventDispatcher::Dispatch(aTargetContent, aPresContext, &event,
                                 nullptr, &status);
     }
 
     // adjust the drag hover if the dragenter event was cancelled or this is a drag exit
-    if (status == nsEventStatus_eConsumeNoDefault ||
-        aMessage == NS_DRAGDROP_EXIT) {
+    if (status == nsEventStatus_eConsumeNoDefault || aMessage == eDragExit) {
       SetContentState((aMessage == eDragEnter) ? aTargetContent : nullptr,
                       NS_EVENT_STATE_DRAGOVER);
     }
 
     // collect any changes to moz cursor settings stored in the event's
     // data transfer.
-    if (aMessage == eDragLeave || aMessage == NS_DRAGDROP_EXIT ||
+    if (aMessage == eDragLeave || aMessage == eDragExit ||
         aMessage == eDragEnter) {
       UpdateDragDataTransfer(&event);
     }
   }
 
   // Finally dispatch the event to the frame
   if (aTargetFrame)
     aTargetFrame->HandleEvent(aPresContext, &event, &status);
--- a/dom/ipc/TabChild.cpp
+++ b/dom/ipc/TabChild.cpp
@@ -2182,17 +2182,17 @@ TabChild::RecvRealDragEvent(const Widget
       initialDataTransfer->SetDropEffectInt(aDropEffect);
     }
   }
 
   if (aEvent.mMessage == eDrop) {
     bool canDrop = true;
     if (!dragSession || NS_FAILED(dragSession->GetCanDrop(&canDrop)) ||
         !canDrop) {
-      localEvent.mMessage = NS_DRAGDROP_EXIT;
+      localEvent.mMessage = eDragExit;
     }
   } else if (aEvent.mMessage == eDragOver) {
     nsCOMPtr<nsIDragService> dragService =
       do_GetService("@mozilla.org/widget/dragservice;1");
     if (dragService) {
       // This will dispatch 'drag' event at the source if the
       // drag transaction started in this process.
       dragService->FireDragEventAtSource(eDrag);
--- a/editor/libeditor/nsEditorEventListener.cpp
+++ b/editor/libeditor/nsEditorEventListener.cpp
@@ -376,17 +376,17 @@ nsEditorEventListener::HandleEvent(nsIDO
       return DragEnter(dragEvent);
     }
     // dragover
     case eDragOver: {
       nsCOMPtr<nsIDOMDragEvent> dragEvent = do_QueryInterface(aEvent);
       return DragOver(dragEvent);
     }
     // dragexit
-    case NS_DRAGDROP_EXIT: {
+    case eDragExit: {
       nsCOMPtr<nsIDOMDragEvent> dragEvent = do_QueryInterface(aEvent);
       return DragExit(dragEvent);
     }
     // drop
     case eDrop: {
       nsCOMPtr<nsIDOMDragEvent> dragEvent = do_QueryInterface(aEvent);
       return Drop(dragEvent);
     }
--- a/layout/xul/tree/nsTreeBodyFrame.cpp
+++ b/layout/xul/tree/nsTreeBodyFrame.cpp
@@ -2726,17 +2726,17 @@ nsTreeBodyFrame::HandleEvent(nsPresConte
     WidgetDragEvent* dragEvent = aEvent->AsDragEvent();
     nsContentUtils::SetDataTransferInEvent(dragEvent);
 
     mView->Drop(mSlots->mDropRow, mSlots->mDropOrient, dragEvent->dataTransfer);
     mSlots->mDropRow = -1;
     mSlots->mDropOrient = -1;
     mSlots->mIsDragging = false;
     *aEventStatus = nsEventStatus_eConsumeNoDefault; // already handled the drop
-  } else if (aEvent->mMessage == NS_DRAGDROP_EXIT) {
+  } else if (aEvent->mMessage == eDragExit) {
     // this event was meant for another frame, so ignore it
     if (!mSlots)
       return NS_OK;
 
     // Clear out all our tracking vars.
 
     if (mSlots->mDropAllowed) {
       mSlots->mDropAllowed = false;
--- a/widget/EventMessageList.h
+++ b/widget/EventMessageList.h
@@ -99,17 +99,17 @@ NS_EVENT_MESSAGE(eFormInvalid,          
 //Need separate focus/blur notifications for non-native widgets
 NS_EVENT_MESSAGE(eFocusEventFirst,      1300)
 NS_EVENT_MESSAGE(eFocus,                eFocusEventFirst)
 NS_EVENT_MESSAGE(eBlur,                 eFocusEventFirst + 1)
 
 NS_EVENT_MESSAGE(eDragDropEventFirst,   1400)
 NS_EVENT_MESSAGE(eDragEnter,            eDragDropEventFirst)
 NS_EVENT_MESSAGE(eDragOver,             eDragDropEventFirst + 1)
-NS_EVENT_MESSAGE(NS_DRAGDROP_EXIT,      eDragDropEventFirst + 2)
+NS_EVENT_MESSAGE(eDragExit,             eDragDropEventFirst + 2)
 NS_EVENT_MESSAGE(NS_DRAGDROP_DRAGDROP,  eDragDropEventFirst + 3)
 NS_EVENT_MESSAGE(NS_DRAGDROP_GESTURE,   eDragDropEventFirst + 4)
 NS_EVENT_MESSAGE(eDrag,                 eDragDropEventFirst + 5)
 NS_EVENT_MESSAGE(eDragEnd,              eDragDropEventFirst + 6)
 NS_EVENT_MESSAGE(eDragStart,            eDragDropEventFirst + 7)
 NS_EVENT_MESSAGE(eDrop,                 eDragDropEventFirst + 8)
 NS_EVENT_MESSAGE(eDragLeave,            eDragDropEventFirst + 9)
 NS_EVENT_MESSAGE(eDragDropEventLast,    eDragLeave)
--- a/widget/MouseEvents.h
+++ b/widget/MouseEvents.h
@@ -317,19 +317,17 @@ public:
   virtual WidgetDragEvent* AsDragEvent() override { return this; }
 
   WidgetDragEvent(bool aIsTrusted, EventMessage aMessage, nsIWidget* aWidget)
     : WidgetMouseEvent(aIsTrusted, aMessage, aWidget, eDragEventClass, eReal)
     , userCancelled(false)
     , mDefaultPreventedOnContent(false)
   {
     mFlags.mCancelable =
-      (aMessage != NS_DRAGDROP_EXIT &&
-       aMessage != eDragLeave &&
-       aMessage != eDragEnd);
+      (aMessage != eDragExit && aMessage != eDragLeave && aMessage != eDragEnd);
   }
 
   virtual WidgetEvent* Duplicate() const override
   {
     MOZ_ASSERT(mClass == eDragEventClass,
                "Duplicate() must be overridden by sub class");
     // Not copying widget, it is a weak reference.
     WidgetDragEvent* result = new WidgetDragEvent(false, mMessage, nullptr);
--- a/widget/WidgetEventImpl.cpp
+++ b/widget/WidgetEventImpl.cpp
@@ -96,17 +96,17 @@ WidgetEvent::HasMouseEventMessage() cons
 }
 
 bool
 WidgetEvent::HasDragEventMessage() const
 {
   switch (mMessage) {
     case eDragEnter:
     case eDragOver:
-    case NS_DRAGDROP_EXIT:
+    case eDragExit:
     case NS_DRAGDROP_DRAGDROP:
     case NS_DRAGDROP_GESTURE:
     case eDrag:
     case eDragEnd:
     case eDragStart:
     case eDrop:
     case eDragLeave:
       return true;
--- a/widget/cocoa/nsChildView.mm
+++ b/widget/cocoa/nsChildView.mm
@@ -5747,17 +5747,17 @@ PanGestureTypeForEvent(NSEvent* aEvent)
       // cancelled or not as there isn't actually a means to stop the drag
       mDragService->FireDragEventAtSource(eDrag);
       dragSession->SetCanDrop(false);
     } else if (aMessage == eDrop) {
       // We make the assumption that the dragOver handlers have correctly set
       // the |canDrop| property of the Drag Session.
       bool canDrop = false;
       if (!NS_SUCCEEDED(dragSession->GetCanDrop(&canDrop)) || !canDrop) {
-        [self doDragAction:NS_DRAGDROP_EXIT sender:aSender];
+        [self doDragAction:eDragExit sender:aSender];
 
         nsCOMPtr<nsIDOMNode> sourceNode;
         dragSession->GetSourceNode(getter_AddRefs(sourceNode));
         if (!sourceNode) {
           mDragService->EndDragSession(false);
         }
         return NSDragOperationNone;
       }
@@ -5805,17 +5805,17 @@ PanGestureTypeForEvent(NSEvent* aEvent)
         nsDragService* dragService = static_cast<nsDragService *>(mDragService);
         int32_t childDragAction = dragService->TakeChildProcessDragAction();
         if (childDragAction != nsIDragService::DRAGDROP_ACTION_UNINITIALIZED) {
           dragAction = childDragAction;
         }
 
         return [self dragOperationFromDragAction:dragAction];
       }
-      case NS_DRAGDROP_EXIT:
+      case eDragExit:
       case eDrop: {
         nsCOMPtr<nsIDOMNode> sourceNode;
         dragSession->GetSourceNode(getter_AddRefs(sourceNode));
         if (!sourceNode) {
           // We're leaving a window while doing a drag that was
           // initiated in a different app. End the drag session,
           // since we're done with it for now (until the user
           // drags back into mozilla).
@@ -5860,17 +5860,17 @@ PanGestureTypeForEvent(NSEvent* aEvent)
   return [self doDragAction:eDragOver sender:sender];
 }
 
 - (void)draggingExited:(id <NSDraggingInfo>)sender
 {
   MOZ_LOG(sCocoaLog, LogLevel::Info, ("ChildView draggingExited: entered\n"));
 
   nsAutoRetainCocoaObject kungFuDeathGrip(self);
-  [self doDragAction:NS_DRAGDROP_EXIT sender:sender];
+  [self doDragAction:eDragExit sender:sender];
   NS_IF_RELEASE(mDragService);
 }
 
 - (BOOL)performDragOperation:(id <NSDraggingInfo>)sender
 {
   nsAutoRetainCocoaObject kungFuDeathGrip(self);
   BOOL handled = [self doDragAction:eDrop sender:sender] != NSDragOperationNone;
   NS_IF_RELEASE(mDragService);
--- a/widget/gtk/nsDragService.cpp
+++ b/widget/gtk/nsDragService.cpp
@@ -1859,18 +1859,17 @@ nsDragService::TaskDispatchCallback(gpoi
 
 gboolean
 nsDragService::RunScheduledTask()
 {
     if (mTargetWindow && mTargetWindow != mPendingWindow) {
         MOZ_LOG(sDragLm, LogLevel::Debug,
                ("nsDragService: dispatch drag leave (%p)\n",
                 mTargetWindow.get()));
-        mTargetWindow->
-            DispatchDragEvent(NS_DRAGDROP_EXIT, mTargetWindowPoint, 0);
+        mTargetWindow->DispatchDragEvent(eDragExit, mTargetWindowPoint, 0);
 
         if (!mSourceNode) {
             // The drag that was initiated in a different app. End the drag
             // session, since we're done with it for now (until the user drags
             // back into this app).
             EndDragSession(false);
         }
     }
@@ -2047,14 +2046,14 @@ gboolean
 nsDragService::DispatchDropEvent()
 {
     // We need to check IsDestroyed here because the nsRefPtr
     // only protects this from being deleted, it does NOT protect
     // against nsView::~nsView() calling Destroy() on it, bug 378273.
     if (mTargetWindow->IsDestroyed())
         return FALSE;
 
-    EventMessage msg = mCanDrop ? eDrop : NS_DRAGDROP_EXIT;
+    EventMessage msg = mCanDrop ? eDrop : eDragExit;
 
     mTargetWindow->DispatchDragEvent(msg, mTargetWindowPoint, mTargetTime);
 
     return mCanDrop;
 }
--- a/widget/nsBaseWidget.cpp
+++ b/widget/nsBaseWidget.cpp
@@ -2630,17 +2630,17 @@ nsBaseWidget::debug_GuiEventToString(Wid
 case _value: eventName.AssignLiteral(_name) ; break
 
   switch(aGuiEvent->mMessage)
   {
     _ASSIGN_eventName(eBlur,"eBlur");
     _ASSIGN_eventName(NS_DRAGDROP_GESTURE,"NS_DND_GESTURE");
     _ASSIGN_eventName(eDrop,"eDrop");
     _ASSIGN_eventName(eDragEnter,"eDragEnter");
-    _ASSIGN_eventName(NS_DRAGDROP_EXIT,"NS_DND_EXIT");
+    _ASSIGN_eventName(eDragExit,"eDragExit");
     _ASSIGN_eventName(eDragOver,"eDragOver");
     _ASSIGN_eventName(NS_EDITOR_INPUT,"NS_EDITOR_INPUT");
     _ASSIGN_eventName(eFocus,"eFocus");
     _ASSIGN_eventName(eFormSelect,"eFormSelect");
     _ASSIGN_eventName(eFormChange,"eFormChange");
     _ASSIGN_eventName(eFormReset,"eFormReset");
     _ASSIGN_eventName(eFormSubmit,"eFormSubmit");
     _ASSIGN_eventName(eImageAbort,"eImageAbort");
--- a/widget/windows/nsNativeDragTarget.cpp
+++ b/widget/windows/nsNativeDragTarget.cpp
@@ -357,17 +357,17 @@ nsNativeDragTarget::DragLeave()
   }
 
   // Drag and drop image helper
   if (GetDropTargetHelper()) {
     GetDropTargetHelper()->DragLeave();
   }
 
   // dispatch the event into Gecko
-  DispatchDragDropEvent(NS_DRAGDROP_EXIT, gDragLastPoint);
+  DispatchDragDropEvent(eDragExit, gDragLastPoint);
 
   nsCOMPtr<nsIDragSession> currentDragSession;
   mDragService->GetCurrentSession(getter_AddRefs(currentDragSession));
 
   if (currentDragSession) {
     nsCOMPtr<nsIDOMNode> sourceNode;
     currentDragSession->GetSourceNode(getter_AddRefs(sourceNode));