Changeset 167074 in webkit


Ignore:
Timestamp:
Apr 10, 2014 10:33:29 AM (10 years ago)
Author:
ap@apple.com
Message:

Eliminate DragSession structure
https://bugs.webkit.org/show_bug.cgi?id=131465

Reviewed by Benjamin Poulain.

Source/WebCore:

DragSession is really just a transient response to NSDragDestination delegate methods.
The "session" name was quite misleading, and thankfully, we don't need a class for this
bag of data at all.

  • WebCore.xcodeproj/project.pbxproj:
  • page/DragController.cpp:

(WebCore::DragController::DragController):
(WebCore::DragController::dragEntered):
(WebCore::DragController::dragUpdated):
(WebCore::DragController::dragEnteredOrUpdated):
(WebCore::DragController::tryDocumentDrag):

  • page/DragController.h:

(WebCore::DragController::mouseIsOverFileInput):
(WebCore::DragController::numberOfItemsToBeAccepted):

  • page/DragSession.h: Removed.

Source/WebKit/mac:

  • WebView/WebView.mm:

(-[WebView draggingEntered:]):
(-[WebView draggingUpdated:]):

Source/WebKit/win:

  • WebView.cpp:

(WebView::DragEnter):
(WebView::DragOver):

Source/WebKit2:

  • Scripts/webkit2/messages.py:

(struct_or_class):

  • Shared/WebCoreArgumentCoders.cpp:

(IPC::ArgumentCoder<DragSession>::encode): Deleted.
(IPC::ArgumentCoder<DragSession>::decode): Deleted.

  • Shared/WebCoreArgumentCoders.h:
  • UIProcess/API/mac/WKView.mm:

(-[WKView draggingEntered:]):
(-[WKView draggingUpdated:]):

  • UIProcess/WebPageProxy.cpp:

(WebKit::WebPageProxy::WebPageProxy):
(WebKit::WebPageProxy::didPerformDragControllerAction):

  • UIProcess/WebPageProxy.h:

(WebKit::WebPageProxy::currentDragOperation):
(WebKit::WebPageProxy::currentDragIsOverFileInput):
(WebKit::WebPageProxy::currentDragNumberOfFilesToBeAccepted):
(WebKit::WebPageProxy::resetCurrentDragInformation):
(WebKit::WebPageProxy::dragSession): Deleted.
(WebKit::WebPageProxy::resetDragSession): Deleted.

  • UIProcess/WebPageProxy.messages.in:
  • WebProcess/WebPage/WebPage.cpp:

(WebKit::WebPage::performDragControllerAction):

Location:
trunk/Source
Files:
1 deleted
17 edited

Legend:

Unmodified
Added
Removed
  • trunk/Source/WebCore/ChangeLog

    r167073 r167074  
     12014-04-09  Alexey Proskuryakov  <ap@apple.com>
     2
     3        Eliminate DragSession structure
     4        https://bugs.webkit.org/show_bug.cgi?id=131465
     5
     6        Reviewed by Benjamin Poulain.
     7
     8        DragSession is really just a transient response to NSDragDestination delegate methods.
     9        The "session" name was quite misleading, and thankfully, we don't need a class for this
     10        bag of data at all.
     11
     12        * WebCore.xcodeproj/project.pbxproj:
     13        * page/DragController.cpp:
     14        (WebCore::DragController::DragController):
     15        (WebCore::DragController::dragEntered):
     16        (WebCore::DragController::dragUpdated):
     17        (WebCore::DragController::dragEnteredOrUpdated):
     18        (WebCore::DragController::tryDocumentDrag):
     19        * page/DragController.h:
     20        (WebCore::DragController::mouseIsOverFileInput):
     21        (WebCore::DragController::numberOfItemsToBeAccepted):
     22        * page/DragSession.h: Removed.
     23
    1242014-04-10  Youenn Fablet  <youenn.fablet@crf.canon.fr>
    225
  • trunk/Source/WebCore/WebCore.xcodeproj/project.pbxproj

    r167025 r167074  
    11811181                31611E620E1C4E1400F6A579 /* DOMWebKitCSSTransformValue.mm in Sources */ = {isa = PBXBuildFile; fileRef = 31611E5F0E1C4E1400F6A579 /* DOMWebKitCSSTransformValue.mm */; };
    11821182                31611E630E1C4E1400F6A579 /* DOMWebKitCSSTransformValueInternal.h in Headers */ = {isa = PBXBuildFile; fileRef = 31611E600E1C4E1400F6A579 /* DOMWebKitCSSTransformValueInternal.h */; };
    1183                 3169379C14609C6C00C01362 /* DragSession.h in Headers */ = {isa = PBXBuildFile; fileRef = 3169379A14609C5B00C01362 /* DragSession.h */; settings = {ATTRIBUTES = (Private, ); }; };
    11841183                316FE0710E6CCBEE00BF6088 /* JSWebKitCSSKeyframeRule.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 316FE06D0E6CCBEE00BF6088 /* JSWebKitCSSKeyframeRule.cpp */; };
    11851184                316FE0720E6CCBEE00BF6088 /* JSWebKitCSSKeyframeRule.h in Headers */ = {isa = PBXBuildFile; fileRef = 316FE06E0E6CCBEE00BF6088 /* JSWebKitCSSKeyframeRule.h */; };
     
    80818080                31611E5F0E1C4E1400F6A579 /* DOMWebKitCSSTransformValue.mm */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.objcpp; path = DOMWebKitCSSTransformValue.mm; sourceTree = "<group>"; };
    80828081                31611E600E1C4E1400F6A579 /* DOMWebKitCSSTransformValueInternal.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = DOMWebKitCSSTransformValueInternal.h; sourceTree = "<group>"; };
    8083                 3169379A14609C5B00C01362 /* DragSession.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = DragSession.h; sourceTree = "<group>"; };
    80848082                316FE06D0E6CCBEE00BF6088 /* JSWebKitCSSKeyframeRule.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = JSWebKitCSSKeyframeRule.cpp; sourceTree = "<group>"; };
    80858083                316FE06E0E6CCBEE00BF6088 /* JSWebKitCSSKeyframeRule.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = JSWebKitCSSKeyframeRule.h; sourceTree = "<group>"; };
     
    1627416272                                A7CA595C0B27BD9E00FA021D /* DragController.cpp */,
    1627516273                                A7CA595B0B27BD9E00FA021D /* DragController.h */,
    16276                                 3169379A14609C5B00C01362 /* DragSession.h */,
    1627716274                                81F65FF513788FAA00FF6F2D /* DragState.h */,
    1627816275                                1AF326770D78B9440068F0C4 /* EditorClient.h */,
     
    2375423751                                A7B6E69F0B291A9600D0529F /* DragData.h in Headers */,
    2375523752                                A7CFB3D20B7ED10A0070C32D /* DragImage.h in Headers */,
    23756                                 3169379C14609C6C00C01362 /* DragSession.h in Headers */,
    2375723753                                81F65FF613788FAA00FF6F2D /* DragState.h in Headers */,
    2375823754                                498770DC1242C535002226BA /* DrawingBuffer.h in Headers */,
  • trunk/Source/WebCore/page/DragController.cpp

    r167040 r167074  
    3838#include "DragData.h"
    3939#include "DragImage.h"
    40 #include "DragSession.h"
    4140#include "DragState.h"
    4241#include "Editor.h"
     
    102101    : m_page(page)
    103102    , m_client(client)
    104     , m_documentUnderMouse(0)
    105     , m_dragInitiator(0)
    106     , m_fileInputElementUnderMouse(0)
     103    , m_numberOfItemsToBeAccepted(0)
    107104    , m_documentIsHandlingDrag(false)
    108105    , m_dragDestinationAction(DragDestinationActionNone)
     
    177174}
    178175
    179 DragSession DragController::dragEntered(DragData& dragData)
     176DragOperation DragController::dragEntered(DragData& dragData)
    180177{
    181178    return dragEnteredOrUpdated(dragData);
     
    197194}
    198195
    199 DragSession DragController::dragUpdated(DragData& dragData)
     196DragOperation DragController::dragUpdated(DragData& dragData)
    200197{
    201198    return dragEnteredOrUpdated(dragData);
     
    248245}
    249246
    250 DragSession DragController::dragEnteredOrUpdated(DragData& dragData)
     247DragOperation DragController::dragEnteredOrUpdated(DragData& dragData)
    251248{
    252249    mouseMovedIntoDocument(m_page.mainFrame().documentAtPoint(dragData.clientPosition()));
     
    255252    if (m_dragDestinationAction == DragDestinationActionNone) {
    256253        cancelDrag(); // FIXME: Why not call mouseMovedIntoDocument(0)?
    257         return DragSession();
    258     }
    259 
    260     DragSession dragSession;
    261     m_documentIsHandlingDrag = tryDocumentDrag(dragData, m_dragDestinationAction, dragSession);
     254        return DragOperationNone;
     255    }
     256
     257    DragOperation dragOperation = DragOperationNone;
     258    m_documentIsHandlingDrag = tryDocumentDrag(dragData, m_dragDestinationAction, dragOperation);
    262259    if (!m_documentIsHandlingDrag && (m_dragDestinationAction & DragDestinationActionLoad))
    263         dragSession.operation = operationForLoad(dragData);
    264     return dragSession;
     260        dragOperation = operationForLoad(dragData);
     261    return dragOperation;
    265262}
    266263
     
    298295}
    299296
    300 bool DragController::tryDocumentDrag(DragData& dragData, DragDestinationAction actionMask, DragSession& dragSession)
     297bool DragController::tryDocumentDrag(DragData& dragData, DragDestinationAction actionMask, DragOperation& dragOperation)
    301298{
    302299    if (!m_documentUnderMouse)
     
    308305    bool isHandlingDrag = false;
    309306    if (actionMask & DragDestinationActionDHTML) {
    310         isHandlingDrag = tryDHTMLDrag(dragData, dragSession.operation);
     307        isHandlingDrag = tryDHTMLDrag(dragData, dragOperation);
    311308        // Do not continue if m_documentUnderMouse has been reset by tryDHTMLDrag.
    312309        // tryDHTMLDrag fires dragenter event. The event listener that listens
     
    331328    if ((actionMask & DragDestinationActionEdit) && canProcessDrag(dragData)) {
    332329        if (dragData.containsColor()) {
    333             dragSession.operation = DragOperationGeneric;
     330            dragOperation = DragOperationGeneric;
    334331            return true;
    335332        }
     
    351348
    352349        Frame* innerFrame = element->document().frame();
    353         dragSession.operation = dragIsMove(innerFrame->selection(), dragData) ? DragOperationMove : DragOperationCopy;
    354         dragSession.mouseIsOverFileInput = m_fileInputElementUnderMouse;
    355         dragSession.numberOfItemsToBeAccepted = 0;
     350        dragOperation = dragIsMove(innerFrame->selection(), dragData) ? DragOperationMove : DragOperationCopy;
     351        m_numberOfItemsToBeAccepted = 0;
    356352
    357353        unsigned numberOfFiles = dragData.numberOfFiles();
    358354        if (m_fileInputElementUnderMouse) {
    359355            if (m_fileInputElementUnderMouse->isDisabledFormControl())
    360                 dragSession.numberOfItemsToBeAccepted = 0;
     356                m_numberOfItemsToBeAccepted = 0;
    361357            else if (m_fileInputElementUnderMouse->multiple())
    362                 dragSession.numberOfItemsToBeAccepted = numberOfFiles;
     358                m_numberOfItemsToBeAccepted = numberOfFiles;
    363359            else if (numberOfFiles > 1)
    364                 dragSession.numberOfItemsToBeAccepted = 0;
     360                m_numberOfItemsToBeAccepted = 0;
    365361            else
    366                 dragSession.numberOfItemsToBeAccepted = 1;
     362                m_numberOfItemsToBeAccepted = 1;
    367363           
    368             if (!dragSession.numberOfItemsToBeAccepted)
    369                 dragSession.operation = DragOperationNone;
    370             m_fileInputElementUnderMouse->setCanReceiveDroppedFiles(dragSession.numberOfItemsToBeAccepted);
     364            if (!m_numberOfItemsToBeAccepted)
     365                dragOperation = DragOperationNone;
     366            m_fileInputElementUnderMouse->setCanReceiveDroppedFiles(m_numberOfItemsToBeAccepted);
    371367        } else {
    372368            // We are not over a file input element. The dragged item(s) will only
    373369            // be loaded into the view the number of dragged items is 1.
    374             dragSession.numberOfItemsToBeAccepted = numberOfFiles != 1 ? 0 : 1;
     370            m_numberOfItemsToBeAccepted = numberOfFiles != 1 ? 0 : 1;
    375371        }
    376372       
  • trunk/Source/WebCore/page/DragController.h

    r167040 r167074  
    4646    class PlatformMouseEvent;
    4747
    48     struct DragSession;
    4948    struct DragState;
    5049
     
    5958        DragClient& client() const { return m_client; }
    6059
    61         DragSession dragEntered(DragData&);
     60        DragOperation dragEntered(DragData&);
    6261        void dragExited(DragData&);
    63         DragSession dragUpdated(DragData&);
     62        DragOperation dragUpdated(DragData&);
    6463        bool performDragOperation(DragData&);
    65        
     64
     65        bool mouseIsOverFileInput() const { return m_fileInputElementUnderMouse; }
     66        unsigned numberOfItemsToBeAccepted() const { return m_numberOfItemsToBeAccepted; }
     67
    6668        // FIXME: It should be possible to remove a number of these accessors once all
    6769        // drag logic is in WebCore.
     
    9698        bool canProcessDrag(DragData&);
    9799        bool concludeEditDrag(DragData&);
    98         DragSession dragEnteredOrUpdated(DragData&);
     100        DragOperation dragEnteredOrUpdated(DragData&);
    99101        DragOperation operationForLoad(DragData&);
    100         bool tryDocumentDrag(DragData&, DragDestinationAction, DragSession&);
     102        bool tryDocumentDrag(DragData&, DragDestinationAction, DragOperation&);
    101103        bool tryDHTMLDrag(DragData&, DragOperation&);
    102104        DragOperation dragOperation(DragData&);
     
    118120        RefPtr<Document> m_dragInitiator; // The Document (if any) that initiated the drag.
    119121        RefPtr<HTMLInputElement> m_fileInputElementUnderMouse;
     122        unsigned m_numberOfItemsToBeAccepted;
    120123        bool m_documentIsHandlingDrag;
    121124
  • trunk/Source/WebKit/mac/ChangeLog

    r167040 r167074  
     12014-04-09  Alexey Proskuryakov  <ap@apple.com>
     2
     3        Eliminate DragSession structure
     4        https://bugs.webkit.org/show_bug.cgi?id=131465
     5
     6        Reviewed by Benjamin Poulain.
     7
     8        * WebView/WebView.mm:
     9        (-[WebView draggingEntered:]):
     10        (-[WebView draggingUpdated:]):
     11
    1122014-04-09  Alexey Proskuryakov  <ap@apple.com>
    213
  • trunk/Source/WebKit/mac/WebView/WebView.mm

    r167040 r167074  
    124124#import <WebCore/DragController.h>
    125125#import <WebCore/DragData.h>
    126 #import <WebCore/DragSession.h>
    127126#import <WebCore/Editor.h>
    128127#import <WebCore/EventHandler.h>
     
    59815980    IntPoint global(globalPoint([draggingInfo draggingLocation], [self window]));
    59825981    DragData dragData(draggingInfo, client, global, static_cast<DragOperation>([draggingInfo draggingSourceOperationMask]), [self applicationFlags:draggingInfo]);
    5983     return core(self)->dragController().dragEntered(dragData).operation;
     5982    return core(self)->dragController().dragEntered(dragData);
    59845983}
    59855984
     
    59935992    IntPoint global(globalPoint([draggingInfo draggingLocation], [self window]));
    59945993    DragData dragData(draggingInfo, client, global, static_cast<DragOperation>([draggingInfo draggingSourceOperationMask]), [self applicationFlags:draggingInfo]);
    5995     return page->dragController().dragUpdated(dragData).operation;
     5994    return page->dragController().dragUpdated(dragData);
    59965995}
    59975996
  • trunk/Source/WebKit/win/ChangeLog

    r167040 r167074  
     12014-04-09  Alexey Proskuryakov  <ap@apple.com>
     2
     3        Eliminate DragSession structure
     4        https://bugs.webkit.org/show_bug.cgi?id=131465
     5
     6        Reviewed by Benjamin Poulain.
     7
     8        * WebView.cpp:
     9        (WebView::DragEnter):
     10        (WebView::DragOver):
     11
    1122014-04-09  Alexey Proskuryakov  <ap@apple.com>
    213
  • trunk/Source/WebKit/win/WebView.cpp

    r167040 r167074  
    8686#include <WebCore/DragController.h>
    8787#include <WebCore/DragData.h>
    88 #include <WebCore/DragSession.h>
    8988#include <WebCore/Editor.h>
    9089#include <WebCore/EventHandler.h>
     
    52475246    DragData data(pDataObject, IntPoint(localpt.x, localpt.y),
    52485247        IntPoint(pt.x, pt.y), keyStateToDragOperation(grfKeyState));
    5249     *pdwEffect = dragOperationToDragCursor(m_page->dragController().dragEntered(data).operation);
     5248    *pdwEffect = dragOperationToDragCursor(m_page->dragController().dragEntered(data));
    52505249
    52515250    m_lastDropEffect = *pdwEffect;
     
    52665265        DragData data(m_dragData.get(), IntPoint(localpt.x, localpt.y),
    52675266            IntPoint(pt.x, pt.y), keyStateToDragOperation(grfKeyState));
    5268         *pdwEffect = dragOperationToDragCursor(m_page->dragController().dragUpdated(data).operation);
     5267        *pdwEffect = dragOperationToDragCursor(m_page->dragController().dragUpdated(data));
    52695268    } else
    52705269        *pdwEffect = DROPEFFECT_NONE;
  • trunk/Source/WebKit2/ChangeLog

    r167072 r167074  
     12014-04-09  Alexey Proskuryakov  <ap@apple.com>
     2
     3        Eliminate DragSession structure
     4        https://bugs.webkit.org/show_bug.cgi?id=131465
     5
     6        Reviewed by Benjamin Poulain.
     7
     8        * Scripts/webkit2/messages.py:
     9        (struct_or_class):
     10        * Shared/WebCoreArgumentCoders.cpp:
     11        (IPC::ArgumentCoder<DragSession>::encode): Deleted.
     12        (IPC::ArgumentCoder<DragSession>::decode): Deleted.
     13        * Shared/WebCoreArgumentCoders.h:
     14        * UIProcess/API/mac/WKView.mm:
     15        (-[WKView draggingEntered:]):
     16        (-[WKView draggingUpdated:]):
     17        * UIProcess/WebPageProxy.cpp:
     18        (WebKit::WebPageProxy::WebPageProxy):
     19        (WebKit::WebPageProxy::didPerformDragControllerAction):
     20        * UIProcess/WebPageProxy.h:
     21        (WebKit::WebPageProxy::currentDragOperation):
     22        (WebKit::WebPageProxy::currentDragIsOverFileInput):
     23        (WebKit::WebPageProxy::currentDragNumberOfFilesToBeAccepted):
     24        (WebKit::WebPageProxy::resetCurrentDragInformation):
     25        (WebKit::WebPageProxy::dragSession): Deleted.
     26        (WebKit::WebPageProxy::resetDragSession): Deleted.
     27        * UIProcess/WebPageProxy.messages.in:
     28        * WebProcess/WebPage/WebPage.cpp:
     29        (WebKit::WebPage::performDragControllerAction):
     30
    1312014-04-10  Martin Robinson  <mrobinson@igalia.com>
    232
  • trunk/Source/WebKit2/Scripts/webkit2/messages.py

    r165823 r167074  
    173173        'WebCore::CompositionUnderline',
    174174        'WebCore::Cookie',
    175         'WebCore::DragSession',
    176175        'WebCore::FloatPoint3D',
    177176        'WebCore::FileChooserSettings',
  • trunk/Source/WebKit2/Shared/WebCoreArgumentCoders.cpp

    r166741 r167074  
    3636#include <WebCore/DatabaseDetails.h>
    3737#include <WebCore/DictationAlternative.h>
    38 #include <WebCore/DragSession.h>
    3938#include <WebCore/Editor.h>
    4039#include <WebCore/FileChooser.h>
     
    13111310}
    13121311
    1313 void ArgumentCoder<DragSession>::encode(ArgumentEncoder& encoder, const DragSession& result)
    1314 {
    1315     encoder.encodeEnum(result.operation);
    1316     encoder << result.mouseIsOverFileInput;
    1317     encoder << result.numberOfItemsToBeAccepted;
    1318 }
    1319 
    1320 bool ArgumentCoder<DragSession>::decode(ArgumentDecoder& decoder, DragSession& result)
    1321 {
    1322     if (!decoder.decodeEnum(result.operation))
    1323         return false;
    1324     if (!decoder.decode(result.mouseIsOverFileInput))
    1325         return false;
    1326     if (!decoder.decode(result.numberOfItemsToBeAccepted))
    1327         return false;
    1328     return true;
    1329 }
    1330 
    13311312void ArgumentCoder<URL>::encode(ArgumentEncoder& encoder, const URL& result)
    13321313{
  • trunk/Source/WebKit2/Shared/WebCoreArgumentCoders.h

    r166542 r167074  
    6868struct Cookie;
    6969struct DictationAlternative;
    70 struct DragSession;
    7170struct FileChooserSettings;
    7271struct IDBDatabaseMetadata;
     
    340339};
    341340   
    342 template<> struct ArgumentCoder<WebCore::DragSession> {
    343     static void encode(ArgumentEncoder&, const WebCore::DragSession&);
    344     static bool decode(ArgumentDecoder&, WebCore::DragSession&);
    345 };
    346 
    347341template<> struct ArgumentCoder<WebCore::URL> {
    348342    static void encode(ArgumentEncoder&, const WebCore::URL&);
  • trunk/Source/WebKit2/UIProcess/API/mac/WKView.mm

    r167040 r167074  
    7979#import <WebCore/DragController.h>
    8080#import <WebCore/DragData.h>
    81 #import <WebCore/DragSession.h>
    8281#import <WebCore/FloatRect.h>
    8382#import <WebCore/Image.h>
     
    22382237    DragData dragData(draggingInfo, client, global, static_cast<DragOperation>([draggingInfo draggingSourceOperationMask]), [self applicationFlags:draggingInfo]);
    22392238
    2240     _data->_page->resetDragSession();
     2239    _data->_page->resetCurrentDragInformation();
    22412240    _data->_page->dragEntered(dragData, [[draggingInfo draggingPasteboard] name]);
    22422241    return NSDragOperationCopy;
     
    22502249    _data->_page->dragUpdated(dragData, [[draggingInfo draggingPasteboard] name]);
    22512250   
    2252     WebCore::DragSession dragSession = _data->_page->dragSession();
    2253     NSInteger numberOfValidItemsForDrop = dragSession.numberOfItemsToBeAccepted;
     2251    NSInteger numberOfValidItemsForDrop = _data->_page->currentDragNumberOfFilesToBeAccepted();
    22542252    NSDraggingFormation draggingFormation = NSDraggingFormationNone;
    2255     if (dragSession.mouseIsOverFileInput && numberOfValidItemsForDrop > 0)
     2253    if (_data->_page->currentDragIsOverFileInput() && numberOfValidItemsForDrop > 0)
    22562254        draggingFormation = NSDraggingFormationList;
    22572255
     
    22612259        [draggingInfo setDraggingFormation:draggingFormation];
    22622260
    2263     return dragSession.operation;
     2261    return _data->_page->currentDragOperation();
    22642262}
    22652263
     
    22702268    DragData dragData(draggingInfo, client, global, static_cast<DragOperation>([draggingInfo draggingSourceOperationMask]), [self applicationFlags:draggingInfo]);
    22712269    _data->_page->dragExited(dragData, [[draggingInfo draggingPasteboard] name]);
    2272     _data->_page->resetDragSession();
     2270    _data->_page->resetCurrentDragInformation();
    22732271}
    22742272
  • trunk/Source/WebKit2/UIProcess/WebPageProxy.cpp

    r167040 r167074  
    9090#include <WebCore/DragController.h>
    9191#include <WebCore/DragData.h>
    92 #include <WebCore/DragSession.h>
    9392#include <WebCore/FloatRect.h>
    9493#include <WebCore/FocusDirection.h>
     
    321320    , m_pendingLearnOrIgnoreWordMessageCount(0)
    322321    , m_mainFrameHasCustomContentProvider(false)
     322    , m_currentDragOperation(DragOperationNone)
     323    , m_currentDragIsOverFileInput(false)
     324    , m_currentDragNumberOfFilesToBeAccepted(0)
    323325    , m_delegatesScrolling(false)
    324326    , m_mainFrameHasHorizontalScrollbar(false)
     
    12061208}
    12071209
    1208 void WebPageProxy::didPerformDragControllerAction(WebCore::DragSession dragSession)
    1209 {
    1210     m_currentDragSession = dragSession;
     1210void WebPageProxy::didPerformDragControllerAction(uint64_t dragOperation, bool mouseIsOverFileInput, unsigned numberOfItemsToBeAccepted)
     1211{
     1212    MESSAGE_CHECK(dragOperation <= DragOperationDelete);
     1213
     1214    m_currentDragOperation = static_cast<DragOperation>(dragOperation);
     1215    m_currentDragIsOverFileInput = mouseIsOverFileInput;
     1216    m_currentDragNumberOfFilesToBeAccepted = numberOfItemsToBeAccepted;
    12111217}
    12121218
  • trunk/Source/WebKit2/UIProcess/WebPageProxy.h

    r167060 r167074  
    6363#include <WebCore/Color.h>
    6464#include <WebCore/DragActions.h>
    65 #include <WebCore/DragSession.h>
    6665#include <WebCore/HitTestResult.h>
    6766#include <WebCore/Page.h>
     
    8382#if ENABLE(DRAG_SUPPORT)
    8483#include <WebCore/DragActions.h>
    85 #include <WebCore/DragSession.h>
    8684#endif
    8785
     
    854852    void performDragOperation(WebCore::DragData&, const String& dragStorageName, const SandboxExtension::Handle&, const SandboxExtension::HandleArray&);
    855853
    856     void didPerformDragControllerAction(WebCore::DragSession);
     854    void didPerformDragControllerAction(uint64_t dragOperation, bool mouseIsOverFileInput, unsigned numberOfItemsToBeAccepted);
    857855    void dragEnded(const WebCore::IntPoint& clientPosition, const WebCore::IntPoint& globalPosition, uint64_t operation);
    858856#if PLATFORM(COCOA)
     
    904902
    905903#if ENABLE(DRAG_SUPPORT)
    906     WebCore::DragSession dragSession() const { return m_currentDragSession; }
    907     void resetDragSession() { m_currentDragSession = WebCore::DragSession(); }
     904    WebCore::DragOperation currentDragOperation() const { return m_currentDragOperation; }
     905    bool currentDragIsOverFileInput() const { return m_currentDragIsOverFileInput; }
     906    unsigned currentDragNumberOfFilesToBeAccepted() const { return m_currentDragNumberOfFilesToBeAccepted; }
     907    void resetCurrentDragInformation()
     908    {
     909        m_currentDragOperation = WebCore::DragOperationNone;
     910        m_currentDragIsOverFileInput = false;
     911        m_currentDragNumberOfFilesToBeAccepted = 0;
     912    }
    908913#endif
    909914
     
    15771582
    15781583#if ENABLE(DRAG_SUPPORT)
    1579     WebCore::DragSession m_currentDragSession;
     1584    // Current drag destination details are delivered as an asynchronous response,
     1585    // so we preserve them to be used when the next dragging delegate call is made.
     1586    WebCore::DragOperation m_currentDragOperation;
     1587    bool m_currentDragIsOverFileInput;
     1588    unsigned m_currentDragNumberOfFilesToBeAccepted;
    15801589#endif
    15811590
  • trunk/Source/WebKit2/UIProcess/WebPageProxy.messages.in

    r167060 r167074  
    256256    # Drag and drop messages
    257257#if ENABLE(DRAG_SUPPORT)
    258     DidPerformDragControllerAction(WebCore::DragSession dragSession)
     258    DidPerformDragControllerAction(uint64_t dragOperation, bool mouseIsOverFileInput, unsigned numberOfItemsToBeAccepted)
    259259#endif
    260260#if PLATFORM(COCOA) && ENABLE(DRAG_SUPPORT)
  • trunk/Source/WebKit2/WebProcess/WebPage/WebPage.cpp

    r167040 r167074  
    101101#include <WebCore/DragController.h>
    102102#include <WebCore/DragData.h>
    103 #include <WebCore/DragSession.h>
    104103#include <WebCore/ElementIterator.h>
    105104#include <WebCore/EventHandler.h>
     
    27412740{
    27422741    if (!m_page) {
    2743         send(Messages::WebPageProxy::DidPerformDragControllerAction(WebCore::DragSession()));
     2742        send(Messages::WebPageProxy::DidPerformDragControllerAction(DragOperationNone, false, 0));
    27442743        DataObjectGtk* data = const_cast<DataObjectGtk*>(dragData.platformData());
    27452744        data->deref();
     
    27772776{
    27782777    if (!m_page) {
    2779         send(Messages::WebPageProxy::DidPerformDragControllerAction(WebCore::DragSession()));
     2778        send(Messages::WebPageProxy::DidPerformDragControllerAction(DragOperationNone, false, 0));
    27802779        return;
    27812780    }
     
    27832782    DragData dragData(dragStorageName, clientPosition, globalPosition, static_cast<DragOperation>(draggingSourceOperationMask), static_cast<DragApplicationFlags>(flags));
    27842783    switch (action) {
    2785     case DragControllerActionEntered:
    2786         send(Messages::WebPageProxy::DidPerformDragControllerAction(m_page->dragController().dragEntered(dragData)));
     2784    case DragControllerActionEntered: {
     2785        DragOperation resolvedDragOperation = m_page->dragController().dragEntered(dragData);
     2786        send(Messages::WebPageProxy::DidPerformDragControllerAction(resolvedDragOperation, m_page->dragController().mouseIsOverFileInput(), m_page->dragController().numberOfItemsToBeAccepted()));
    27872787        break;
    27882788
    2789     case DragControllerActionUpdated:
    2790         send(Messages::WebPageProxy::DidPerformDragControllerAction(m_page->dragController().dragUpdated(dragData)));
     2789    }
     2790    case DragControllerActionUpdated: {
     2791        DragOperation resolvedDragOperation = m_page->dragController().dragUpdated(dragData);
     2792        send(Messages::WebPageProxy::DidPerformDragControllerAction(resolvedDragOperation, m_page->dragController().mouseIsOverFileInput(), m_page->dragController().numberOfItemsToBeAccepted()));
    27912793        break;
    2792        
     2794    }
    27932795    case DragControllerActionExited:
    27942796        m_page->dragController().dragExited(dragData);
Note: See TracChangeset for help on using the changeset viewer.