Commit 5797165d authored by eric@webkit.org's avatar eric@webkit.org

2009-05-21 Eric Seidel <eric@webkit.org>

        Reviewed by Alexey Proskuryakov.

        Rename DragController::dragOperation() to sourceDragOperation() for clarity
        Remove unused setDragOperation()

        There are two times DragOperation is used.  The source specifies
        what drag operations it supports (in a mask) and the destination
        picks a subset of those as DragOperations it supports if a drop were
        to occur.  I was confused when I first saw this accessor as to which
        it meant.  It turns out that this is only used when WebKit starts a
        drag, and we keep it around so that we can provide this information
        to other Mac OS X applications when they ask.  I've renamed the method
        for clarity so the next person in this code will be less confused.

        No functional changes, thus no tests.

        * page/DragController.h:
        (WebCore::DragController::sourceDragOperation):

git-svn-id: http://svn.webkit.org/repository/webkit/trunk@43967 268f45cc-cd09-0410-ab3c-d52691b4dbfc
parent fe82566a
2009-05-21 Eric Seidel <eric@webkit.org>
Reviewed by Alexey Proskuryakov.
Rename DragController::dragOperation() to sourceDragOperation() for clarity
Remove unused setDragOperation()
There are two times DragOperation is used. The source specifies
what drag operations it supports (in a mask) and the destination
picks a subset of those as DragOperations it supports if a drop were
to occur. I was confused when I first saw this accessor as to which
it meant. It turns out that this is only used when WebKit starts a
drag, and we keep it around so that we can provide this information
to other Mac OS X applications when they ask. I've renamed the method
for clarity so the next person in this code will be less confused.
No functional changes, thus no tests.
* page/DragController.h:
(WebCore::DragController::sourceDragOperation):
2009-05-21 Dan Bernstein <mitz@apple.com>
Reviewed by Anders Carlsson.
......@@ -82,7 +82,7 @@ DragController::DragController(Page* page, DragClient* client)
, m_dragSourceAction(DragSourceActionNone)
, m_didInitiateDrag(false)
, m_isHandlingDrag(false)
, m_dragOperation(DragOperationNone)
, m_sourceDragOperation(DragOperationNone)
{
}
......@@ -605,7 +605,7 @@ bool DragController::startDrag(Frame* src, Clipboard* clipboard, DragOperation s
IntPoint mouseDraggedPoint = src->view()->windowToContents(dragEvent.pos());
m_draggingImageURL = KURL();
m_dragOperation = srcOp;
m_sourceDragOperation = srcOp;
DragImageRef dragImage = 0;
IntPoint dragLoc(0, 0);
......
......@@ -64,8 +64,7 @@ namespace WebCore {
bool didInitiateDrag() const { return m_didInitiateDrag; }
void setIsHandlingDrag(bool handling) { m_isHandlingDrag = handling; }
bool isHandlingDrag() const { return m_isHandlingDrag; }
void setDragOperation(DragOperation dragOp) { m_dragOperation = dragOp; }
DragOperation dragOperation() const { return m_dragOperation; }
DragOperation sourceDragOperation() const { return m_sourceDragOperation; }
void setDraggingImageURL(const KURL& url) { m_draggingImageURL = url; }
const KURL& draggingImageURL() const { return m_draggingImageURL; }
void setDragInitiator(Document* initiator) { m_dragInitiator = initiator; m_didInitiateDrag = true; }
......@@ -120,10 +119,9 @@ namespace WebCore {
DragSourceAction m_dragSourceAction;
bool m_didInitiateDrag;
bool m_isHandlingDrag;
DragOperation m_dragOperation;
DragOperation m_sourceDragOperation; // Set in startDrag when a drag starts from a mouse down within WebKit
IntPoint m_dragOffset;
KURL m_draggingImageURL;
};
}
......
2009-05-21 Eric Seidel <eric@webkit.org>
Reviewed by Alexey Proskuryakov.
Rename DragController::dragOperation() to sourceDragOperation() for clarity
* WebView/WebHTMLView.mm:
(-[WebHTMLView draggingSourceOperationMaskForLocal:]):
2009-05-21 Dan Bernstein <mitz@apple.com>
Reviewed by Anders Carlsson.
......
......@@ -3471,15 +3471,15 @@ done:
{
ASSERT(![self _webView] || [self _isTopHTMLView]);
Page *page = core([self _webView]);
Page* page = core([self _webView]);
if (!page)
return NSDragOperationNone;
if (page->dragController()->dragOperation() == DragOperationNone)
// FIXME: Why do we override the source provided operation here? Why not in DragController::startDrag
if (page->dragController()->sourceDragOperation() == DragOperationNone)
return NSDragOperationGeneric | NSDragOperationCopy;
return (NSDragOperation)page->dragController()->dragOperation();
return (NSDragOperation)page->dragController()->sourceDragOperation();
}
- (void)draggedImage:(NSImage *)image movedTo:(NSPoint)screenLoc
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment