Bug 895274 part.77 Rename NS_DRAGDROP_DROP to eDrop r=smaug

This commit is contained in:
Masayuki Nakano 2015-09-02 15:08:01 +09:00
Родитель 9fb6e3527b
Коммит 7b7a44a5ac
17 изменённых файлов: 26 добавлений и 27 удалений

Просмотреть файл

@ -5492,7 +5492,7 @@ nsContentUtils::SetDataTransferInEvent(WidgetDragEvent* aDragEvent)
}
bool isCrossDomainSubFrameDrop = false;
if (aDragEvent->mMessage == NS_DRAGDROP_DROP ||
if (aDragEvent->mMessage == eDrop ||
aDragEvent->mMessage == NS_DRAGDROP_DRAGDROP) {
isCrossDomainSubFrameDrop = CheckForSubFrameDrop(dragSession, aDragEvent);
}
@ -5514,7 +5514,7 @@ nsContentUtils::SetDataTransferInEvent(WidgetDragEvent* aDragEvent)
aDragEvent->dataTransfer->GetEffectAllowedInt(&effectAllowed);
aDragEvent->dataTransfer->SetDropEffectInt(FilterDropEffect(action, effectAllowed));
}
else if (aDragEvent->mMessage == NS_DRAGDROP_DROP ||
else if (aDragEvent->mMessage == eDrop ||
aDragEvent->mMessage == NS_DRAGDROP_DRAGDROP ||
aDragEvent->mMessage == NS_DRAGDROP_END) {
// For the drop and dragend events, set the drop effect based on the

Просмотреть файл

@ -269,7 +269,7 @@ DataTransfer::GetMozUserCancelled(bool* aUserCancelled)
FileList*
DataTransfer::GetFiles(ErrorResult& aRv)
{
if (mEventMessage != NS_DRAGDROP_DROP &&
if (mEventMessage != eDrop &&
mEventMessage != NS_DRAGDROP_DRAGDROP &&
mEventMessage != NS_PASTE) {
return nullptr;
@ -603,7 +603,7 @@ DataTransfer::MozGetDataAt(const nsAString& aFormat, uint32_t aIndex,
// only allow access to the data with the same principal.
nsIPrincipal* principal = nullptr;
if (mIsCrossDomainSubFrameDrop ||
(mEventMessage != NS_DRAGDROP_DROP &&
(mEventMessage != eDrop &&
mEventMessage != NS_DRAGDROP_DRAGDROP &&
mEventMessage != NS_PASTE &&
!nsContentUtils::IsCallerChrome())) {

Просмотреть файл

@ -203,7 +203,7 @@ EVENT(dragstart,
EventNameType_HTMLXUL,
eDragEventClass)
EVENT(drop,
NS_DRAGDROP_DROP,
eDrop,
EventNameType_HTMLXUL,
eDragEventClass)
EVENT(durationchange,

Просмотреть файл

@ -654,8 +654,8 @@ EventStateManager::PreHandleEvent(nsPresContext* aPresContext,
}
break;
case NS_DRAGDROP_OVER:
// NS_DRAGDROP_DROP is fired before NS_DRAGDROP_DRAGDROP so send
// the enter/exit events before NS_DRAGDROP_DROP.
// eDrop is fired before NS_DRAGDROP_DRAGDROP so send
// the enter/exit events before eDrop.
GenerateDragDropEnterExit(aPresContext, aEvent->AsDragEvent());
break;
@ -1195,7 +1195,7 @@ CrossProcessSafeEvent(const WidgetEvent& aEvent)
switch (aEvent.mMessage) {
case NS_DRAGDROP_OVER:
case NS_DRAGDROP_EXIT:
case NS_DRAGDROP_DROP:
case eDrop:
return true;
default:
break;
@ -3286,7 +3286,7 @@ EventStateManager::PostHandleEvent(nsPresContext* aPresContext,
}
break;
case NS_DRAGDROP_DROP:
case eDrop:
{
// now fire the dragdrop event, for compatibility with XUL
if (mCurrentTarget && nsEventStatus_eConsumeNoDefault != *aStatus) {

Просмотреть файл

@ -215,7 +215,7 @@ WheelTransaction::OnEvent(WidgetEvent* aEvent)
case eMouseDoubleClick:
case eMouseClick:
case eContextMenu:
case NS_DRAGDROP_DROP:
case eDrop:
EndTransaction();
return;
default:

Просмотреть файл

@ -5112,9 +5112,9 @@ ContentParent::MaybeInvokeDragSession(TabParent* aParent)
session->GetDataTransfer(getter_AddRefs(domTransfer));
nsCOMPtr<DataTransfer> transfer = do_QueryInterface(domTransfer);
if (!transfer) {
// Pass NS_DRAGDROP_DROP to get DataTransfer with external
// Pass eDrop to get DataTransfer with external
// drag formats cached.
transfer = new DataTransfer(nullptr, NS_DRAGDROP_DROP, true, -1);
transfer = new DataTransfer(nullptr, eDrop, true, -1);
session->SetDataTransfer(transfer);
}
// Note, even though this fills the DataTransfer object with

Просмотреть файл

@ -2183,7 +2183,7 @@ TabChild::RecvRealDragEvent(const WidgetDragEvent& aEvent,
}
}
if (aEvent.mMessage == NS_DRAGDROP_DROP) {
if (aEvent.mMessage == eDrop) {
bool canDrop = true;
if (!dragSession || NS_FAILED(dragSession->GetCanDrop(&canDrop)) ||
!canDrop) {

Просмотреть файл

@ -386,7 +386,7 @@ nsEditorEventListener::HandleEvent(nsIDOMEvent* aEvent)
return DragExit(dragEvent);
}
// drop
case NS_DRAGDROP_DROP: {
case eDrop: {
nsCOMPtr<nsIDOMDragEvent> dragEvent = do_QueryInterface(aEvent);
return Drop(dragEvent);
}

Просмотреть файл

@ -894,7 +894,7 @@ APZCTreeManager::UpdateWheelTransaction(WidgetInputEvent& aEvent)
case eMouseDoubleClick:
case eMouseClick:
case eContextMenu:
case NS_DRAGDROP_DROP:
case eDrop:
txn->EndTransaction();
return;
default:

Просмотреть файл

@ -7864,7 +7864,7 @@ PresShell::HandleEventInternal(WidgetEvent* aEvent, nsEventStatus* aStatus)
isHandlingUserInput = true;
break;
case NS_DRAGDROP_DROP: {
case eDrop: {
nsCOMPtr<nsIDragSession> session = nsContentUtils::GetDragSession();
if (session) {
bool onlyChromeDrop = false;

Просмотреть файл

@ -2707,7 +2707,7 @@ nsTreeBodyFrame::HandleEvent(nsPresContext* aPresContext,
// Indicate that the drop is allowed by preventing the default behaviour.
if (mSlots->mDropAllowed)
*aEventStatus = nsEventStatus_eConsumeNoDefault;
} else if (aEvent->mMessage == NS_DRAGDROP_DROP) {
} else if (aEvent->mMessage == eDrop) {
// this event was meant for another frame, so ignore it
if (!mSlots)
return NS_OK;

Просмотреть файл

@ -110,7 +110,7 @@ NS_EVENT_MESSAGE(NS_DRAGDROP_GESTURE, eDragDropEventFirst + 4)
NS_EVENT_MESSAGE(NS_DRAGDROP_DRAG, eDragDropEventFirst + 5)
NS_EVENT_MESSAGE(NS_DRAGDROP_END, eDragDropEventFirst + 6)
NS_EVENT_MESSAGE(NS_DRAGDROP_START, eDragDropEventFirst + 7)
NS_EVENT_MESSAGE(NS_DRAGDROP_DROP, eDragDropEventFirst + 8)
NS_EVENT_MESSAGE(eDrop, eDragDropEventFirst + 8)
NS_EVENT_MESSAGE(eDragLeave, eDragDropEventFirst + 9)
NS_EVENT_MESSAGE(eDragDropEventLast, eDragLeave)

Просмотреть файл

@ -107,7 +107,7 @@ WidgetEvent::HasDragEventMessage() const
case NS_DRAGDROP_DRAG:
case NS_DRAGDROP_END:
case NS_DRAGDROP_START:
case NS_DRAGDROP_DROP:
case eDrop:
case eDragLeave:
return true;
default:

Просмотреть файл

@ -5746,8 +5746,7 @@ PanGestureTypeForEvent(NSEvent* aEvent)
// cancelled or not as there isn't actually a means to stop the drag
mDragService->FireDragEventAtSource(NS_DRAGDROP_DRAG);
dragSession->SetCanDrop(false);
}
else if (aMessage == NS_DRAGDROP_DROP) {
} 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;
@ -5812,7 +5811,7 @@ PanGestureTypeForEvent(NSEvent* aEvent)
return [self dragOperationFromDragAction:dragAction];
}
case NS_DRAGDROP_EXIT:
case NS_DRAGDROP_DROP: {
case eDrop: {
nsCOMPtr<nsIDOMNode> sourceNode;
dragSession->GetSourceNode(getter_AddRefs(sourceNode));
if (!sourceNode) {
@ -5873,7 +5872,7 @@ PanGestureTypeForEvent(NSEvent* aEvent)
- (BOOL)performDragOperation:(id <NSDraggingInfo>)sender
{
nsAutoRetainCocoaObject kungFuDeathGrip(self);
BOOL handled = [self doDragAction:NS_DRAGDROP_DROP sender:sender] != NSDragOperationNone;
BOOL handled = [self doDragAction:eDrop sender:sender] != NSDragOperationNone;
NS_IF_RELEASE(mDragService);
return handled;
}

Просмотреть файл

@ -2052,7 +2052,7 @@ nsDragService::DispatchDropEvent()
if (mTargetWindow->IsDestroyed())
return FALSE;
EventMessage msg = mCanDrop ? NS_DRAGDROP_DROP : NS_DRAGDROP_EXIT;
EventMessage msg = mCanDrop ? eDrop : NS_DRAGDROP_EXIT;
mTargetWindow->DispatchDragEvent(msg, mTargetWindowPoint, mTargetTime);

Просмотреть файл

@ -2633,7 +2633,7 @@ case _value: eventName.AssignLiteral(_name) ; break
{
_ASSIGN_eventName(eBlur,"eBlur");
_ASSIGN_eventName(NS_DRAGDROP_GESTURE,"NS_DND_GESTURE");
_ASSIGN_eventName(NS_DRAGDROP_DROP,"NS_DND_DROP");
_ASSIGN_eventName(eDrop,"eDrop");
_ASSIGN_eventName(NS_DRAGDROP_ENTER,"NS_DND_ENTER");
_ASSIGN_eventName(NS_DRAGDROP_EXIT,"NS_DND_EXIT");
_ASSIGN_eventName(NS_DRAGDROP_OVER,"NS_DND_OVER");

Просмотреть файл

@ -229,7 +229,7 @@ nsNativeDragTarget::ProcessDrag(EventMessage aEventMessage,
*pdwEffect = DROPEFFECT_NONE;
}
if (aEventMessage != NS_DRAGDROP_DROP) {
if (aEventMessage != eDrop) {
// Get the cached drag effect from the drag service, the data member should
// have been set by whoever handled the WidgetGUIEvent or nsIDOMEvent on
// drags.
@ -439,7 +439,7 @@ nsNativeDragTarget::Drop(LPDATAOBJECT pData,
nsCOMPtr<nsIDragService> serv = mDragService;
// Now process the native drag state and then dispatch the event
ProcessDrag(NS_DRAGDROP_DROP, grfKeyState, aPT, pdwEffect);
ProcessDrag(eDrop, grfKeyState, aPT, pdwEffect);
nsCOMPtr<nsIDragSession> currentDragSession;
serv->GetCurrentSession(getter_AddRefs(currentDragSession));