Title: [259008] trunk/Source
Revision
259008
Author
wenson_hs...@apple.com
Date
2020-03-25 14:13:55 -0700 (Wed, 25 Mar 2020)

Log 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:]):

Modified Paths

Diff

Modified: trunk/Source/WebCore/ChangeLog (259007 => 259008)


--- trunk/Source/WebCore/ChangeLog	2020-03-25 20:48:55 UTC (rev 259007)
+++ trunk/Source/WebCore/ChangeLog	2020-03-25 21:13:55 UTC (rev 259008)
@@ -1,3 +1,26 @@
+2020-03-25  Wenson Hsieh  <wenson_hs...@apple.com>
+
+        Rename "data interaction pasteboard" to "drag and drop pasteboard"
+        https://bugs.webkit.org/show_bug.cgi?id=209556
+
+        Reviewed by Tim Horton.
+
+        "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):
+
 2020-03-25  Frank Yang  <guowei_y...@apple.com>
 
         Unprefix -webkit-text-orientation

Modified: trunk/Source/WebCore/platform/Pasteboard.h (259007 => 259008)


--- trunk/Source/WebCore/platform/Pasteboard.h	2020-03-25 20:48:55 UTC (rev 259007)
+++ trunk/Source/WebCore/platform/Pasteboard.h	2020-03-25 21:13:55 UTC (rev 259008)
@@ -250,6 +250,9 @@
 #endif
 
 #if PLATFORM(COCOA)
+#if ENABLE(DRAG_SUPPORT)
+    WEBCORE_EXPORT static String nameOfDragPasteboard();
+#endif
     static bool shouldTreatCocoaTypeAsFile(const String&);
     WEBCORE_EXPORT static NSArray *supportedFileUploadPasteboardTypes();
     int64_t changeCount() const;

Modified: trunk/Source/WebCore/platform/cocoa/DragDataCocoa.mm (259007 => 259008)


--- trunk/Source/WebCore/platform/cocoa/DragDataCocoa.mm	2020-03-25 20:48:55 UTC (rev 259007)
+++ trunk/Source/WebCore/platform/cocoa/DragDataCocoa.mm	2020-03-25 21:13:55 UTC (rev 259008)
@@ -126,7 +126,7 @@
 #if PLATFORM(MAC)
     , m_pasteboardName([[m_platformDragData draggingPasteboard] name])
 #else
-    , m_pasteboardName("data interaction pasteboard")
+    , m_pasteboardName(Pasteboard::nameOfDragPasteboard())
 #endif
 {
 }

Modified: trunk/Source/WebCore/platform/ios/PasteboardIOS.mm (259007 => 259008)


--- trunk/Source/WebCore/platform/ios/PasteboardIOS.mm	2020-03-25 20:48:55 UTC (rev 259007)
+++ trunk/Source/WebCore/platform/ios/PasteboardIOS.mm	2020-03-25 21:13:55 UTC (rev 259008)
@@ -64,9 +64,14 @@
     notImplemented();
 }
 
+String Pasteboard::nameOfDragPasteboard()
+{
+    return "drag and drop pasteboard";
+}
+
 std::unique_ptr<Pasteboard> Pasteboard::createForDragAndDrop()
 {
-    return makeUnique<Pasteboard>("data interaction pasteboard");
+    return makeUnique<Pasteboard>(Pasteboard::nameOfDragPasteboard());
 }
 
 std::unique_ptr<Pasteboard> Pasteboard::createForDragAndDrop(const DragData& dragData)
@@ -348,7 +353,7 @@
     // For now, data interaction is the only feature that uses item-provider-based pasteboard representations.
     // In the future, we may need to consult the client layer to determine whether or not the pasteboard supports
     // item types ranked by fidelity.
-    return m_pasteboardName == "data interaction pasteboard";
+    return m_pasteboardName == Pasteboard::nameOfDragPasteboard();
 }
 
 void Pasteboard::readRespectingUTIFidelities(PasteboardWebContentReader& reader, WebContentReadingPolicy policy, Optional<size_t> itemIndex)

Modified: trunk/Source/WebCore/platform/ios/PlatformPasteboardIOS.mm (259007 => 259008)


--- trunk/Source/WebCore/platform/ios/PlatformPasteboardIOS.mm	2020-03-25 20:48:55 UTC (rev 259007)
+++ trunk/Source/WebCore/platform/ios/PlatformPasteboardIOS.mm	2020-03-25 21:13:55 UTC (rev 259008)
@@ -60,7 +60,7 @@
 #if PASTEBOARD_SUPPORTS_ITEM_PROVIDERS
 PlatformPasteboard::PlatformPasteboard(const String& name)
 {
-    if (name == "data interaction pasteboard")
+    if (name == Pasteboard::nameOfDragPasteboard())
         m_pasteboard = [WebItemProviderPasteboard sharedInstance];
     else
         m_pasteboard = [PAL::getUIPasteboardClass() generalPasteboard];

Modified: trunk/Source/WebCore/platform/mac/PasteboardMac.mm (259007 => 259008)


--- trunk/Source/WebCore/platform/mac/PasteboardMac.mm	2020-03-25 20:48:55 UTC (rev 259007)
+++ trunk/Source/WebCore/platform/mac/PasteboardMac.mm	2020-03-25 21:13:55 UTC (rev 259008)
@@ -105,6 +105,11 @@
 }
 
 #if ENABLE(DRAG_SUPPORT)
+String Pasteboard::nameOfDragPasteboard()
+{
+    return NSPasteboardNameDrag;
+}
+
 std::unique_ptr<Pasteboard> Pasteboard::createForDragAndDrop()
 {
     ALLOW_DEPRECATED_DECLARATIONS_BEGIN

Modified: trunk/Source/WebKit/ChangeLog (259007 => 259008)


--- trunk/Source/WebKit/ChangeLog	2020-03-25 20:48:55 UTC (rev 259007)
+++ trunk/Source/WebKit/ChangeLog	2020-03-25 21:13:55 UTC (rev 259008)
@@ -1,3 +1,18 @@
+2020-03-25  Wenson Hsieh  <wenson_hs...@apple.com>
+
+        Rename "data interaction pasteboard" to "drag and drop pasteboard"
+        https://bugs.webkit.org/show_bug.cgi?id=209556
+
+        Reviewed by Tim Horton.
+
+        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:]):
+
 2020-03-25  Brady Eidson  <beid...@apple.com>
 
         Some WKWebView.h header doc cleanup.

Modified: trunk/Source/WebKit/UIProcess/ios/WKContentViewInteraction.mm (259007 => 259008)


--- trunk/Source/WebKit/UIProcess/ios/WKContentViewInteraction.mm	2020-03-25 20:48:55 UTC (rev 259007)
+++ trunk/Source/WebKit/UIProcess/ios/WKContentViewInteraction.mm	2020-03-25 21:13:55 UTC (rev 259008)
@@ -7788,7 +7788,7 @@
     _dragDropInteractionState.dropSessionDidEnterOrUpdate(session, dragData);
 
     [[WebItemProviderPasteboard sharedInstance] setItemProviders:extractItemProvidersFromDropSession(session)];
-    _page->dragEntered(dragData, "data interaction pasteboard");
+    _page->dragEntered(dragData, WebCore::Pasteboard::nameOfDragPasteboard());
 }
 
 - (UIDropProposal *)dropInteraction:(UIDropInteraction *)interaction sessionDidUpdate:(id <UIDropSession>)session
@@ -7796,7 +7796,7 @@
     [[WebItemProviderPasteboard sharedInstance] setItemProviders:extractItemProvidersFromDropSession(session)];
 
     auto dragData = [self dragDataForDropSession:session dragDestinationAction:[self _dragDestinationActionForDropSession:session]];
-    _page->dragUpdated(dragData, "data interaction pasteboard");
+    _page->dragUpdated(dragData, WebCore::Pasteboard::nameOfDragPasteboard());
     _dragDropInteractionState.dropSessionDidEnterOrUpdate(session, dragData);
 
     auto delegate = self.webViewUIDelegate;
@@ -7828,7 +7828,7 @@
     [[WebItemProviderPasteboard sharedInstance] setItemProviders:extractItemProvidersFromDropSession(session)];
 
     auto dragData = [self dragDataForDropSession:session dragDestinationAction:WKDragDestinationActionAny];
-    _page->dragExited(dragData, "data interaction pasteboard");
+    _page->dragExited(dragData, WebCore::Pasteboard::nameOfDragPasteboard());
     _page->resetCurrentDragInformation();
 
     _dragDropInteractionState.dropSessionDidExit();
@@ -7872,7 +7872,7 @@
         WebKit::SandboxExtension::Handle sandboxExtensionHandle;
         WebKit::SandboxExtension::HandleArray sandboxExtensionForUpload;
         retainedSelf->_page->createSandboxExtensionsIfNeeded(filenames, sandboxExtensionHandle, sandboxExtensionForUpload);
-        retainedSelf->_page->performDragOperation(capturedDragData, "data interaction pasteboard", WTFMove(sandboxExtensionHandle), WTFMove(sandboxExtensionForUpload));
+        retainedSelf->_page->performDragOperation(capturedDragData, WebCore::Pasteboard::nameOfDragPasteboard(), WTFMove(sandboxExtensionHandle), WTFMove(sandboxExtensionForUpload));
         if (shouldSnapshotView) {
             retainedSelf->_visibleContentViewSnapshot = [retainedSelf snapshotViewAfterScreenUpdates:NO];
             [retainedSelf->_visibleContentViewSnapshot setFrame:[retainedSelf bounds]];
_______________________________________________
webkit-changes mailing list
webkit-changes@lists.webkit.org
https://lists.webkit.org/mailman/listinfo/webkit-changes

Reply via email to