Changeset 83354 in webkit


Ignore:
Timestamp:
Apr 8, 2011 4:00:32 PM (13 years ago)
Author:
andersca@apple.com
Message:

2011-04-08 Anders Carlsson <andersca@apple.com>

Reviewed by Adam Roben.

Make the drag operations be different functions
https://bugs.webkit.org/show_bug.cgi?id=58169

Since we want performDrag to take a sandbox extension, separate the four
drag operations out into different functions. No functionality change.

  • UIProcess/API/mac/WKView.mm: (-[WKView draggingEntered:]): (-[WKView draggingUpdated:]): (-[WKView draggingExited:]): (-[WKView performDragOperation:]):
  • UIProcess/WebPageProxy.cpp: (WebKit::WebPageProxy::dragEntered): (WebKit::WebPageProxy::dragUpdated): (WebKit::WebPageProxy::dragExited): (WebKit::WebPageProxy::performDrag):
  • UIProcess/WebPageProxy.h:
  • UIProcess/win/WebView.cpp: (WebKit::WebView::DragEnter): (WebKit::WebView::DragOver): (WebKit::WebView::DragLeave): (WebKit::WebView::Drop):
Location:
trunk/Source/WebKit2
Files:
5 edited

Legend:

Unmodified
Added
Removed
  • trunk/Source/WebKit2/ChangeLog

    r83350 r83354  
     12011-04-08  Anders Carlsson  <andersca@apple.com>
     2
     3        Reviewed by Adam Roben.
     4
     5        Make the drag operations be different functions
     6        https://bugs.webkit.org/show_bug.cgi?id=58169
     7
     8        Since we want performDrag to take a sandbox extension, separate the four
     9        drag operations out into different functions. No functionality change.
     10
     11        * UIProcess/API/mac/WKView.mm:
     12        (-[WKView draggingEntered:]):
     13        (-[WKView draggingUpdated:]):
     14        (-[WKView draggingExited:]):
     15        (-[WKView performDragOperation:]):
     16        * UIProcess/WebPageProxy.cpp:
     17        (WebKit::WebPageProxy::dragEntered):
     18        (WebKit::WebPageProxy::dragUpdated):
     19        (WebKit::WebPageProxy::dragExited):
     20        (WebKit::WebPageProxy::performDrag):
     21        * UIProcess/WebPageProxy.h:
     22        * UIProcess/win/WebView.cpp:
     23        (WebKit::WebView::DragEnter):
     24        (WebKit::WebView::DragOver):
     25        (WebKit::WebView::DragLeave):
     26        (WebKit::WebView::Drop):
     27
    1282011-04-08  Anders Carlsson  <andersca@apple.com>
    229
  • trunk/Source/WebKit2/UIProcess/API/mac/WKView.mm

    r83326 r83354  
    14371437
    14381438    _data->_page->resetDragOperation();
    1439     _data->_page->performDragControllerAction(DragControllerActionEntered, &dragData, [[draggingInfo draggingPasteboard] name]);
     1439    _data->_page->dragEntered(&dragData, [[draggingInfo draggingPasteboard] name]);
    14401440    return NSDragOperationCopy;
    14411441}
     
    14461446    IntPoint global(globalPoint([draggingInfo draggingLocation], [self window]));
    14471447    DragData dragData(draggingInfo, client, global, static_cast<DragOperation>([draggingInfo draggingSourceOperationMask]), [self applicationFlags:draggingInfo]);
    1448     _data->_page->performDragControllerAction(DragControllerActionUpdated, &dragData, [[draggingInfo draggingPasteboard] name]);
     1448    _data->_page->dragUpdated(&dragData, [[draggingInfo draggingPasteboard] name]);
    14491449    return _data->_page->dragOperation();
    14501450}
     
    14551455    IntPoint global(globalPoint([draggingInfo draggingLocation], [self window]));
    14561456    DragData dragData(draggingInfo, client, global, static_cast<DragOperation>([draggingInfo draggingSourceOperationMask]), [self applicationFlags:draggingInfo]);
    1457     _data->_page->performDragControllerAction(DragControllerActionExited, &dragData, [[draggingInfo draggingPasteboard] name]);
     1457    _data->_page->dragExited(&dragData, [[draggingInfo draggingPasteboard] name]);
    14581458    _data->_page->resetDragOperation();
    14591459}
     
    14691469    IntPoint global(globalPoint([draggingInfo draggingLocation], [self window]));
    14701470    DragData dragData(draggingInfo, client, global, static_cast<DragOperation>([draggingInfo draggingSourceOperationMask]), [self applicationFlags:draggingInfo]);
    1471     _data->_page->performDragControllerAction(DragControllerActionPerformDrag, &dragData, [[draggingInfo draggingPasteboard] name]);
     1471    _data->_page->performDrag(&dragData, [[draggingInfo draggingPasteboard] name]);
    14721472    return YES;
    14731473}
  • trunk/Source/WebKit2/UIProcess/WebPageProxy.cpp

    r83232 r83354  
    699699#endif
    700700
     701void WebPageProxy::dragEntered(WebCore::DragData* dragData, const String& dragStorageName)
     702{
     703    performDragControllerAction(DragControllerActionEntered, dragData, dragStorageName);
     704}
     705
     706void WebPageProxy::dragUpdated(WebCore::DragData* dragData, const String& dragStorageName)
     707{
     708    performDragControllerAction(DragControllerActionUpdated, dragData, dragStorageName);
     709}
     710
     711void WebPageProxy::dragExited(WebCore::DragData* dragData, const String& dragStorageName)
     712{
     713    performDragControllerAction(DragControllerActionExited, dragData, dragStorageName);
     714}
     715
     716void WebPageProxy::performDrag(WebCore::DragData* dragData, const String& dragStorageName)
     717{
     718    performDragControllerAction(DragControllerActionPerformDrag, dragData, dragStorageName);
     719}
     720
    701721void WebPageProxy::performDragControllerAction(DragControllerAction action, WebCore::DragData* dragData, const String& dragStorageName)
    702722{
  • trunk/Source/WebKit2/UIProcess/WebPageProxy.h

    r83232 r83354  
    382382
    383383    // Drag and drop support.
    384     void performDragControllerAction(DragControllerAction, WebCore::DragData*, const String& = String());
     384    void dragEntered(WebCore::DragData*, const String& dragStorageName = String());
     385    void dragUpdated(WebCore::DragData*, const String& dragStorageName = String());
     386    void dragExited(WebCore::DragData*, const String& dragStorageName = String());
     387    void performDrag(WebCore::DragData*, const String& dragStorageName = String());
     388
    385389    void didPerformDragControllerAction(uint64_t resultOperation);
    386390    void dragEnded(const WebCore::IntPoint& clientPosition, const WebCore::IntPoint& globalPosition, uint64_t operation);
     
    693697    void clearLoadDependentCallbacks();
    694698
     699    void performDragControllerAction(DragControllerAction, WebCore::DragData*, const String& dragStorageName);
     700
    695701    PageClient* m_pageClient;
    696702    WebLoaderClient m_loaderClient;
  • trunk/Source/WebKit2/UIProcess/win/WebView.cpp

    r83229 r83354  
    15581558    ::ScreenToClient(m_window, (LPPOINT)&localpt);
    15591559    DragData data(pDataObject, IntPoint(localpt.x, localpt.y), IntPoint(pt.x, pt.y), keyStateToDragOperation(grfKeyState));
    1560     m_page->performDragControllerAction(DragControllerActionEntered, &data);
     1560    m_page->dragEntered(&data);
    15611561    *pdwEffect = dragOperationToDragCursor(m_page->dragOperation());
    15621562
     
    15761576        ::ScreenToClient(m_window, (LPPOINT)&localpt);
    15771577        DragData data(m_dragData.get(), IntPoint(localpt.x, localpt.y), IntPoint(pt.x, pt.y), keyStateToDragOperation(grfKeyState));
    1578         m_page->performDragControllerAction(DragControllerActionUpdated, &data);
     1578        m_page->dragUpdated(&data);
    15791579        *pdwEffect = dragOperationToDragCursor(m_page->dragOperation());
    15801580    } else
     
    15921592    if (m_dragData) {
    15931593        DragData data(m_dragData.get(), IntPoint(), IntPoint(), DragOperationNone);
    1594         m_page->performDragControllerAction(DragControllerActionExited, &data);
     1594        m_page->dragExited(&data);
    15951595        m_dragData = 0;
    15961596        m_page->resetDragOperation();
     
    16091609    ::ScreenToClient(m_window, (LPPOINT)&localpt);
    16101610    DragData data(pDataObject, IntPoint(localpt.x, localpt.y), IntPoint(pt.x, pt.y), keyStateToDragOperation(grfKeyState));
    1611     m_page->performDragControllerAction(DragControllerActionPerformDrag, &data);
     1611    m_page->performDrag(&data);
    16121612    return S_OK;
    16131613}
Note: See TracChangeset for help on using the changeset viewer.