diff --git a/WebCore/ChangeLog b/WebCore/ChangeLog index b59a7ec48d98fc0b9764497f1d807e4b3d5e9c0e..9ecce8d8b9e0eb21b1367c60a90e8cf60d9a443c 100644 --- a/WebCore/ChangeLog +++ b/WebCore/ChangeLog @@ -1,3 +1,24 @@ +2009-05-21 Eric Seidel + + 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 Reviewed by Anders Carlsson. diff --git a/WebCore/page/DragController.cpp b/WebCore/page/DragController.cpp index fbbc9c6bc59645cefee550691dc0ca2078c0a5fb..da3ace1ba018da5a089ffefc1efd7625f374d76c 100644 --- a/WebCore/page/DragController.cpp +++ b/WebCore/page/DragController.cpp @@ -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); diff --git a/WebCore/page/DragController.h b/WebCore/page/DragController.h index 3beff5a8990b1ae5adf828cdd5f55eefba86cce7..819ea35625fed8c1afdad73335dd7d8049f8ad9a 100644 --- a/WebCore/page/DragController.h +++ b/WebCore/page/DragController.h @@ -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; - }; } diff --git a/WebKit/mac/ChangeLog b/WebKit/mac/ChangeLog index 0bd8ea2d67e96f55357bd2e20c73dac852ef4ae2..1b9f29a0e5a365530e9f7765a3590fa72bcd2270 100644 --- a/WebKit/mac/ChangeLog +++ b/WebKit/mac/ChangeLog @@ -1,3 +1,12 @@ +2009-05-21 Eric Seidel + + Reviewed by Alexey Proskuryakov. + + Rename DragController::dragOperation() to sourceDragOperation() for clarity + + * WebView/WebHTMLView.mm: + (-[WebHTMLView draggingSourceOperationMaskForLocal:]): + 2009-05-21 Dan Bernstein Reviewed by Anders Carlsson. diff --git a/WebKit/mac/WebView/WebHTMLView.mm b/WebKit/mac/WebView/WebHTMLView.mm index 4cf59ba3e121c5e9a2ec0b8406a2f6bda187c8c8..5330242e5bd46190c37feaabd70778ecaef027e5 100644 --- a/WebKit/mac/WebView/WebHTMLView.mm +++ b/WebKit/mac/WebView/WebHTMLView.mm @@ -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