From a07c726a8f8f08615bf5806ecfdefe3739a8cfb6 Mon Sep 17 00:00:00 2001 From: Masayuki Nakano Date: Wed, 2 Sep 2015 15:08:02 +0900 Subject: [PATCH] Bug 895274 part.82 Rename NS_DRAGDROP_ENTER to eDragEnter r=smaug --- dom/base/nsContentUtils.cpp | 3 +-- dom/events/EventNameList.h | 2 +- dom/events/EventStateManager.cpp | 9 ++++----- dom/plugins/base/nsPluginInstanceOwner.cpp | 3 +-- editor/libeditor/nsEditorEventListener.cpp | 2 +- layout/xul/tree/nsTreeBodyFrame.cpp | 2 +- widget/EventMessageList.h | 2 +- widget/WidgetEventImpl.cpp | 2 +- widget/cocoa/nsChildView.mm | 7 ++++--- widget/nsBaseWidget.cpp | 2 +- widget/windows/nsNativeDragTarget.cpp | 2 +- 11 files changed, 17 insertions(+), 19 deletions(-) diff --git a/dom/base/nsContentUtils.cpp b/dom/base/nsContentUtils.cpp index ee09ab996ddf..b50ef0ab718e 100644 --- a/dom/base/nsContentUtils.cpp +++ b/dom/base/nsContentUtils.cpp @@ -5507,8 +5507,7 @@ nsContentUtils::SetDataTransferInEvent(WidgetDragEvent* aDragEvent) // for the dragenter and dragover events, initialize the drop effect // from the drop action, which platform specific widget code sets before // the event is fired based on the keyboard state. - if (aDragEvent->mMessage == NS_DRAGDROP_ENTER || - aDragEvent->mMessage == eDragOver) { + if (aDragEvent->mMessage == eDragEnter || aDragEvent->mMessage == eDragOver) { uint32_t action, effectAllowed; dragSession->GetDragAction(&action); aDragEvent->dataTransfer->GetEffectAllowedInt(&effectAllowed); diff --git a/dom/events/EventNameList.h b/dom/events/EventNameList.h index ab66e6a24ae2..7ef9e3ffc655 100644 --- a/dom/events/EventNameList.h +++ b/dom/events/EventNameList.h @@ -187,7 +187,7 @@ EVENT(dragend, EventNameType_HTMLXUL, eDragEventClass) EVENT(dragenter, - NS_DRAGDROP_ENTER, + eDragEnter, EventNameType_HTMLXUL, eDragEventClass) EVENT(dragleave, diff --git a/dom/events/EventStateManager.cpp b/dom/events/EventStateManager.cpp index d7336addb532..6643dad37abf 100644 --- a/dom/events/EventStateManager.cpp +++ b/dom/events/EventStateManager.cpp @@ -3171,7 +3171,7 @@ EventStateManager::PostHandleEvent(nsPresContext* aPresContext, } break; - case NS_DRAGDROP_ENTER: + case eDragEnter: case eDragOver: { NS_ASSERTION(aEvent->mClass == eDragEventClass, "Expected a drag event"); @@ -4320,7 +4320,7 @@ EventStateManager::GenerateDragDropEnterExit(nsPresContext* aPresContext, targetContent, lastContent, sLastDragOverFrame); } - FireDragEnterOrExit(aPresContext, aDragEvent, NS_DRAGDROP_ENTER, + FireDragEnterOrExit(aPresContext, aDragEvent, eDragEnter, lastContent, targetContent, mCurrentTarget); if (sLastDragOverFrame) { @@ -4395,15 +4395,14 @@ EventStateManager::FireDragEnterOrExit(nsPresContext* aPresContext, // adjust the drag hover if the dragenter event was cancelled or this is a drag exit if (status == nsEventStatus_eConsumeNoDefault || aMessage == NS_DRAGDROP_EXIT) { - SetContentState((aMessage == NS_DRAGDROP_ENTER) ? - aTargetContent : nullptr, + 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 || - aMessage == NS_DRAGDROP_ENTER) { + aMessage == eDragEnter) { UpdateDragDataTransfer(&event); } } diff --git a/dom/plugins/base/nsPluginInstanceOwner.cpp b/dom/plugins/base/nsPluginInstanceOwner.cpp index 46a014512c2e..bbe133e167b3 100644 --- a/dom/plugins/base/nsPluginInstanceOwner.cpp +++ b/dom/plugins/base/nsPluginInstanceOwner.cpp @@ -1749,8 +1749,7 @@ nsPluginInstanceOwner::HandleEvent(nsIDOMEvent* aEvent) if (dragEvent && mInstance) { WidgetEvent* ievent = aEvent->GetInternalNSEvent(); if (ievent && ievent->mFlags.mIsTrusted && - ievent->mMessage != NS_DRAGDROP_ENTER && - ievent->mMessage != eDragOver) { + ievent->mMessage != eDragEnter && ievent->mMessage != eDragOver) { aEvent->PreventDefault(); } diff --git a/editor/libeditor/nsEditorEventListener.cpp b/editor/libeditor/nsEditorEventListener.cpp index b8425c2434f8..6d7640ad738c 100644 --- a/editor/libeditor/nsEditorEventListener.cpp +++ b/editor/libeditor/nsEditorEventListener.cpp @@ -371,7 +371,7 @@ nsEditorEventListener::HandleEvent(nsIDOMEvent* aEvent) // you don't need to check if the QI succeeded before each call. switch (internalEvent->mMessage) { // dragenter - case NS_DRAGDROP_ENTER: { + case eDragEnter: { nsCOMPtr dragEvent = do_QueryInterface(aEvent); return DragEnter(dragEvent); } diff --git a/layout/xul/tree/nsTreeBodyFrame.cpp b/layout/xul/tree/nsTreeBodyFrame.cpp index af9e6fe93e55..214745b164fb 100644 --- a/layout/xul/tree/nsTreeBodyFrame.cpp +++ b/layout/xul/tree/nsTreeBodyFrame.cpp @@ -2581,7 +2581,7 @@ nsTreeBodyFrame::HandleEvent(nsPresContext* aPresContext, InvalidateRow(mMouseOverRow); mMouseOverRow = -1; } - } else if (aEvent->mMessage == NS_DRAGDROP_ENTER) { + } else if (aEvent->mMessage == eDragEnter) { if (!mSlots) mSlots = new Slots(); diff --git a/widget/EventMessageList.h b/widget/EventMessageList.h index 4041dc7fc141..5b685938dc27 100644 --- a/widget/EventMessageList.h +++ b/widget/EventMessageList.h @@ -102,7 +102,7 @@ NS_EVENT_MESSAGE(eFocus, eFocusEventFirst) NS_EVENT_MESSAGE(eBlur, eFocusEventFirst + 1) NS_EVENT_MESSAGE(eDragDropEventFirst, 1400) -NS_EVENT_MESSAGE(NS_DRAGDROP_ENTER, eDragDropEventFirst) +NS_EVENT_MESSAGE(eDragEnter, eDragDropEventFirst) NS_EVENT_MESSAGE(eDragOver, eDragDropEventFirst + 1) NS_EVENT_MESSAGE(NS_DRAGDROP_EXIT, eDragDropEventFirst + 2) NS_EVENT_MESSAGE(NS_DRAGDROP_DRAGDROP, eDragDropEventFirst + 3) diff --git a/widget/WidgetEventImpl.cpp b/widget/WidgetEventImpl.cpp index 90dad98fd583..352aa660195e 100644 --- a/widget/WidgetEventImpl.cpp +++ b/widget/WidgetEventImpl.cpp @@ -99,7 +99,7 @@ bool WidgetEvent::HasDragEventMessage() const { switch (mMessage) { - case NS_DRAGDROP_ENTER: + case eDragEnter: case eDragOver: case NS_DRAGDROP_EXIT: case NS_DRAGDROP_DRAGDROP: diff --git a/widget/cocoa/nsChildView.mm b/widget/cocoa/nsChildView.mm index 87613be666ec..fd0c6d34d38e 100644 --- a/widget/cocoa/nsChildView.mm +++ b/widget/cocoa/nsChildView.mm @@ -5735,8 +5735,9 @@ PanGestureTypeForEvent(NSEvent* aEvent) return NSDragOperationNone; } - if (aMessage == NS_DRAGDROP_ENTER) + if (aMessage == eDragEnter) { mDragService->StartDragSession(); + } nsCOMPtr dragSession; mDragService->GetCurrentSession(getter_AddRefs(dragSession)); @@ -5792,7 +5793,7 @@ PanGestureTypeForEvent(NSEvent* aEvent) if (dragSession) { switch (aMessage) { - case NS_DRAGDROP_ENTER: + case eDragEnter: case eDragOver: { uint32_t dragAction; dragSession->GetDragAction(&dragAction); @@ -5847,7 +5848,7 @@ PanGestureTypeForEvent(NSEvent* aEvent) globalDragPboard = [[NSPasteboardWrapper alloc] initWithPasteboard:[sender draggingPasteboard]]; - return [self doDragAction:NS_DRAGDROP_ENTER sender:sender]; + return [self doDragAction:eDragEnter sender:sender]; NS_OBJC_END_TRY_ABORT_BLOCK_RETURN(NSDragOperationNone); } diff --git a/widget/nsBaseWidget.cpp b/widget/nsBaseWidget.cpp index a0195f8649ae..83c9fd18714f 100644 --- a/widget/nsBaseWidget.cpp +++ b/widget/nsBaseWidget.cpp @@ -2634,7 +2634,7 @@ case _value: eventName.AssignLiteral(_name) ; break _ASSIGN_eventName(eBlur,"eBlur"); _ASSIGN_eventName(NS_DRAGDROP_GESTURE,"NS_DND_GESTURE"); _ASSIGN_eventName(eDrop,"eDrop"); - _ASSIGN_eventName(NS_DRAGDROP_ENTER,"NS_DND_ENTER"); + _ASSIGN_eventName(eDragEnter,"eDragEnter"); _ASSIGN_eventName(NS_DRAGDROP_EXIT,"NS_DND_EXIT"); _ASSIGN_eventName(eDragOver,"eDragOver"); _ASSIGN_eventName(NS_EDITOR_INPUT,"NS_EDITOR_INPUT"); diff --git a/widget/windows/nsNativeDragTarget.cpp b/widget/windows/nsNativeDragTarget.cpp index 7140e10c00d4..f703e386a74b 100644 --- a/widget/windows/nsNativeDragTarget.cpp +++ b/widget/windows/nsNativeDragTarget.cpp @@ -295,7 +295,7 @@ nsNativeDragTarget::DragEnter(LPDATAOBJECT pIDataSource, winDragService->SetIDataObject(pIDataSource); // Now process the native drag state and then dispatch the event - ProcessDrag(NS_DRAGDROP_ENTER, grfKeyState, ptl, pdwEffect); + ProcessDrag(eDragEnter, grfKeyState, ptl, pdwEffect); return S_OK; }