Changeset 259008 in webkit


Ignore:
Timestamp:
Mar 25, 2020 2:13:55 PM (4 years ago)
Author:
Wenson Hsieh
Message:

Rename "data interaction pasteboard" to "drag and drop pasteboard"
https://bugs.webkit.org/show_bug.cgi?id=209556

Reviewed by Tim Horton.

Source/WebCore:

"Data interaction" is an obsolete term for drag and drop on iOS, and was meant only to be used early on in
development. Replace this with the more descriptive name "drag and drop pasteboard", and additionally hide the
name behind a Cocoa-only Pasteboard helper method so that each call site won't need to repeat the string.

  • platform/Pasteboard.h:
  • platform/cocoa/DragDataCocoa.mm:

(WebCore::DragData::DragData):

  • platform/ios/PasteboardIOS.mm:

(WebCore::Pasteboard::nameOfDragPasteboard):
(WebCore::Pasteboard::createForDragAndDrop):
(WebCore::Pasteboard::respectsUTIFidelities const):

  • platform/ios/PlatformPasteboardIOS.mm:

(WebCore::PlatformPasteboard::PlatformPasteboard):

  • platform/mac/PasteboardMac.mm:

(WebCore::Pasteboard::nameOfDragPasteboard):

Source/WebKit:

Adopt Pasteboard::nameOfDragPasteboard instead of the literal string "data interaction pasteboard".

  • UIProcess/ios/WKContentViewInteraction.mm:

(-[WKContentView dropInteraction:sessionDidEnter:]):
(-[WKContentView dropInteraction:sessionDidUpdate:]):
(-[WKContentView dropInteraction:sessionDidExit:]):
(-[WKContentView dropInteraction:performDrop:]):

Location:
trunk/Source
Files:
8 edited

Legend:

Unmodified
Added
Removed
  • trunk/Source/WebCore/ChangeLog

    r259006 r259008  
     12020-03-25  Wenson Hsieh  <wenson_hsieh@apple.com>
     2
     3        Rename "data interaction pasteboard" to "drag and drop pasteboard"
     4        https://bugs.webkit.org/show_bug.cgi?id=209556
     5
     6        Reviewed by Tim Horton.
     7
     8        "Data interaction" is an obsolete term for drag and drop on iOS, and was meant only to be used early on in
     9        development. Replace this with the more descriptive name "drag and drop pasteboard", and additionally hide the
     10        name behind a Cocoa-only Pasteboard helper method so that each call site won't need to repeat the string.
     11
     12        * platform/Pasteboard.h:
     13        * platform/cocoa/DragDataCocoa.mm:
     14        (WebCore::DragData::DragData):
     15        * platform/ios/PasteboardIOS.mm:
     16        (WebCore::Pasteboard::nameOfDragPasteboard):
     17        (WebCore::Pasteboard::createForDragAndDrop):
     18        (WebCore::Pasteboard::respectsUTIFidelities const):
     19        * platform/ios/PlatformPasteboardIOS.mm:
     20        (WebCore::PlatformPasteboard::PlatformPasteboard):
     21        * platform/mac/PasteboardMac.mm:
     22        (WebCore::Pasteboard::nameOfDragPasteboard):
     23
    1242020-03-25  Frank Yang  <guowei_yang@apple.com>
    225
  • trunk/Source/WebCore/platform/Pasteboard.h

    r251421 r259008  
    251251
    252252#if PLATFORM(COCOA)
     253#if ENABLE(DRAG_SUPPORT)
     254    WEBCORE_EXPORT static String nameOfDragPasteboard();
     255#endif
    253256    static bool shouldTreatCocoaTypeAsFile(const String&);
    254257    WEBCORE_EXPORT static NSArray *supportedFileUploadPasteboardTypes();
  • trunk/Source/WebCore/platform/cocoa/DragDataCocoa.mm

    r258980 r259008  
    127127    , m_pasteboardName([[m_platformDragData draggingPasteboard] name])
    128128#else
    129     , m_pasteboardName("data interaction pasteboard")
     129    , m_pasteboardName(Pasteboard::nameOfDragPasteboard())
    130130#endif
    131131{
  • trunk/Source/WebCore/platform/ios/PasteboardIOS.mm

    r251421 r259008  
    6565}
    6666
     67String Pasteboard::nameOfDragPasteboard()
     68{
     69    return "drag and drop pasteboard";
     70}
     71
    6772std::unique_ptr<Pasteboard> Pasteboard::createForDragAndDrop()
    6873{
    69     return makeUnique<Pasteboard>("data interaction pasteboard");
     74    return makeUnique<Pasteboard>(Pasteboard::nameOfDragPasteboard());
    7075}
    7176
     
    349354    // In the future, we may need to consult the client layer to determine whether or not the pasteboard supports
    350355    // item types ranked by fidelity.
    351     return m_pasteboardName == "data interaction pasteboard";
     356    return m_pasteboardName == Pasteboard::nameOfDragPasteboard();
    352357}
    353358
  • trunk/Source/WebCore/platform/ios/PlatformPasteboardIOS.mm

    r258896 r259008  
    6161PlatformPasteboard::PlatformPasteboard(const String& name)
    6262{
    63     if (name == "data interaction pasteboard")
     63    if (name == Pasteboard::nameOfDragPasteboard())
    6464        m_pasteboard = [WebItemProviderPasteboard sharedInstance];
    6565    else
  • trunk/Source/WebCore/platform/mac/PasteboardMac.mm

    r251421 r259008  
    106106
    107107#if ENABLE(DRAG_SUPPORT)
     108String Pasteboard::nameOfDragPasteboard()
     109{
     110    return NSPasteboardNameDrag;
     111}
     112
    108113std::unique_ptr<Pasteboard> Pasteboard::createForDragAndDrop()
    109114{
  • trunk/Source/WebKit/ChangeLog

    r259005 r259008  
     12020-03-25  Wenson Hsieh  <wenson_hsieh@apple.com>
     2
     3        Rename "data interaction pasteboard" to "drag and drop pasteboard"
     4        https://bugs.webkit.org/show_bug.cgi?id=209556
     5
     6        Reviewed by Tim Horton.
     7
     8        Adopt Pasteboard::nameOfDragPasteboard instead of the literal string "data interaction pasteboard".
     9
     10        * UIProcess/ios/WKContentViewInteraction.mm:
     11        (-[WKContentView dropInteraction:sessionDidEnter:]):
     12        (-[WKContentView dropInteraction:sessionDidUpdate:]):
     13        (-[WKContentView dropInteraction:sessionDidExit:]):
     14        (-[WKContentView dropInteraction:performDrop:]):
     15
    1162020-03-25  Brady Eidson  <beidson@apple.com>
    217
  • trunk/Source/WebKit/UIProcess/ios/WKContentViewInteraction.mm

    r258919 r259008  
    77897789
    77907790    [[WebItemProviderPasteboard sharedInstance] setItemProviders:extractItemProvidersFromDropSession(session)];
    7791     _page->dragEntered(dragData, "data interaction pasteboard");
     7791    _page->dragEntered(dragData, WebCore::Pasteboard::nameOfDragPasteboard());
    77927792}
    77937793
     
    77977797
    77987798    auto dragData = [self dragDataForDropSession:session dragDestinationAction:[self _dragDestinationActionForDropSession:session]];
    7799     _page->dragUpdated(dragData, "data interaction pasteboard");
     7799    _page->dragUpdated(dragData, WebCore::Pasteboard::nameOfDragPasteboard());
    78007800    _dragDropInteractionState.dropSessionDidEnterOrUpdate(session, dragData);
    78017801
     
    78297829
    78307830    auto dragData = [self dragDataForDropSession:session dragDestinationAction:WKDragDestinationActionAny];
    7831     _page->dragExited(dragData, "data interaction pasteboard");
     7831    _page->dragExited(dragData, WebCore::Pasteboard::nameOfDragPasteboard());
    78327832    _page->resetCurrentDragInformation();
    78337833
     
    78737873        WebKit::SandboxExtension::HandleArray sandboxExtensionForUpload;
    78747874        retainedSelf->_page->createSandboxExtensionsIfNeeded(filenames, sandboxExtensionHandle, sandboxExtensionForUpload);
    7875         retainedSelf->_page->performDragOperation(capturedDragData, "data interaction pasteboard", WTFMove(sandboxExtensionHandle), WTFMove(sandboxExtensionForUpload));
     7875        retainedSelf->_page->performDragOperation(capturedDragData, WebCore::Pasteboard::nameOfDragPasteboard(), WTFMove(sandboxExtensionHandle), WTFMove(sandboxExtensionForUpload));
    78767876        if (shouldSnapshotView) {
    78777877            retainedSelf->_visibleContentViewSnapshot = [retainedSelf snapshotViewAfterScreenUpdates:NO];
Note: See TracChangeset for help on using the changeset viewer.