Commit caf9248c authored by darin@apple.com's avatar darin@apple.com

2011-03-11 Darin Adler <darin@apple.com>

        Reviewed by Sam Weinig.

        Dragging image to desktop gives webloc instead of image file in WebKit2
        https://bugs.webkit.org/show_bug.cgi?id=56193

        * WebCore.exp.in: Added some additional exports. Re-sorted.
2011-03-11  Darin Adler  <darin@apple.com>

        Reviewed by Sam Weinig.

        Dragging image to desktop gives webloc instead of image file in WebKit2
        https://bugs.webkit.org/show_bug.cgi?id=56193

        * WebProcess/WebCoreSupport/mac/WebDragClientMac.mm:
        (WebKit::convertImageToBitmap): Added. Factored out from startDrag to
        make the startDrag code clearer.
        (WebKit::WebDragClient::startDrag): Streamlined code a bit.
        (WebKit::cachedImage): Added. Helper for function below.
        (WebKit::arrayForURLsWithTitles): Added. Helper for function below.
        (WebKit::WebDragClient::declareAndWriteDragImage): Added code to handle file
        promises and removed a log of uneeded code.
        (-[WKPasteboardFilePromiseOwner copyDropDirectory]): Added.
        (promisedDataClient): Added.
        (-[WKPasteboardOwner clearImage]): Added.
        (-[WKPasteboardOwner initWithImage:]): Added.
        (-[WKPasteboardOwner dealloc]): Added.
        (-[WKPasteboardOwner finalize]): Added.
        (-[WKPasteboardOwner pasteboard:provideDataForType:]): Added.
        (-[WKPasteboardOwner pasteboardChangedOwner:]): Added.
        (matchesExtensionOrEquivalent): Added.
        (-[WKPasteboardOwner namesOfPromisedFilesDroppedAtDestination:]): Added.
        Much of the new code above came from the WebKit1 drag code.

        * WebProcess/WebPage/WebPage.cpp:
        (WebKit::WebPage::dragEnded): Added call to Mac-only platformDragEnded.
        * WebProcess/WebPage/WebPage.h: Added Mac-only platformDragEnded and m_dragSource.
        * WebProcess/WebPage/mac/WebPageMac.mm:
        (WebKit::WebPage::setDragSource): Added.
        (WebKit::WebPage::platformDragEnded): Added.


git-svn-id: svn://svn.chromium.org/blink/trunk@80948 bbb929c8-8fbe-4397-9dbb-9b2b20218538
parent 37fa9f1e
2011-03-11 Darin Adler <darin@apple.com>
Reviewed by Sam Weinig.
Dragging image to desktop gives webloc instead of image file in WebKit2
https://bugs.webkit.org/show_bug.cgi?id=56193
* WebCore.exp.in: Added some additional exports. Re-sorted.
2011-03-12 Sheriff Bot <webkit.review.bot@gmail.com> 2011-03-12 Sheriff Bot <webkit.review.bot@gmail.com>
Unreviewed, rolling out r80919. Unreviewed, rolling out r80919.
......
...@@ -325,6 +325,7 @@ __ZN7WebCore13toDeviceSpaceERKNS_9FloatRectEP8NSWindow ...@@ -325,6 +325,7 @@ __ZN7WebCore13toDeviceSpaceERKNS_9FloatRectEP8NSWindow
__ZN7WebCore13toHTMLElementEPNS_21FormAssociatedElementE __ZN7WebCore13toHTMLElementEPNS_21FormAssociatedElementE
__ZN7WebCore13toJSDOMWindowEN3JSC7JSValueE __ZN7WebCore13toJSDOMWindowEN3JSC7JSValueE
__ZN7WebCore14CachedResource12removeClientEPNS_20CachedResourceClientE __ZN7WebCore14CachedResource12removeClientEPNS_20CachedResourceClientE
__ZN7WebCore14CachedResource16unregisterHandleEPNS_24CachedResourceHandleBaseE
__ZN7WebCore14CachedResource9addClientEPNS_20CachedResourceClientE __ZN7WebCore14CachedResource9addClientEPNS_20CachedResourceClientE
__ZN7WebCore14DocumentLoader10commitDataEPKci __ZN7WebCore14DocumentLoader10commitDataEPKci
__ZN7WebCore14DocumentLoader13attachToFrameEv __ZN7WebCore14DocumentLoader13attachToFrameEv
...@@ -553,6 +554,7 @@ __ZN7WebCore23createFragmentFromNodesEPNS_8DocumentERKN3WTF6VectorIPNS_4NodeELm0 ...@@ -553,6 +554,7 @@ __ZN7WebCore23createFragmentFromNodesEPNS_8DocumentERKN3WTF6VectorIPNS_4NodeELm0
__ZN7WebCore23getHostnamesWithCookiesERN3WTF7HashSetINS0_6StringENS0_10StringHashENS0_10HashTraitsIS2_EEEE __ZN7WebCore23getHostnamesWithCookiesERN3WTF7HashSetINS0_6StringENS0_10StringHashENS0_10HashTraitsIS2_EEEE
__ZN7WebCore23overrideDefaultLanguageERKN3WTF6StringE __ZN7WebCore23overrideDefaultLanguageERKN3WTF6StringE
__ZN7WebCore24BinaryPropertyListWriter17writePropertyListEv __ZN7WebCore24BinaryPropertyListWriter17writePropertyListEv
__ZN7WebCore24CachedResourceHandleBase11setResourceEPNS_14CachedResourceE
__ZN7WebCore24DocumentMarkerController13removeMarkersEj __ZN7WebCore24DocumentMarkerController13removeMarkersEj
__ZN7WebCore24DocumentMarkerController14markersForNodeEPNS_4NodeE __ZN7WebCore24DocumentMarkerController14markersForNodeEPNS_4NodeE
__ZN7WebCore24DocumentMarkerController14markersForNodeEPNS_4NodeE __ZN7WebCore24DocumentMarkerController14markersForNodeEPNS_4NodeE
...@@ -1291,12 +1293,16 @@ _wkAdvanceDefaultButtonPulseAnimation ...@@ -1291,12 +1293,16 @@ _wkAdvanceDefaultButtonPulseAnimation
_wkCGContextGetShouldSmoothFonts _wkCGContextGetShouldSmoothFonts
_wkCopyCFLocalizationPreferredName _wkCopyCFLocalizationPreferredName
_wkCopyCONNECTProxyResponse _wkCopyCONNECTProxyResponse
_wkCopyHTTPCookieStorage
_wkCopyNSURLResponseStatusLine _wkCopyNSURLResponseStatusLine
_wkCopyRequestWithStorageSession
_wkCreateCTLineWithUniCharProvider _wkCreateCTLineWithUniCharProvider
_wkCreateCustomCFReadStream _wkCreateCustomCFReadStream
_wkCreateNSURLConnectionDelegateProxy _wkCreateNSURLConnectionDelegateProxy
_wkCreatePrivateStorageSession
_wkCreateURLNPasteboardFlavorTypeName _wkCreateURLNPasteboardFlavorTypeName
_wkCreateURLPasteboardFlavorTypeName _wkCreateURLPasteboardFlavorTypeName
_wkDeleteHTTPCookie
_wkDrawBezeledTextArea _wkDrawBezeledTextArea
_wkDrawBezeledTextFieldCell _wkDrawBezeledTextFieldCell
_wkDrawCapsLockIndicator _wkDrawCapsLockIndicator
...@@ -1309,6 +1315,7 @@ _wkGetFontInLanguageForCharacter ...@@ -1309,6 +1315,7 @@ _wkGetFontInLanguageForCharacter
_wkGetFontInLanguageForRange _wkGetFontInLanguageForRange
_wkGetGlyphTransformedAdvances _wkGetGlyphTransformedAdvances
_wkGetGlyphsForCharacters _wkGetGlyphsForCharacters
_wkGetHTTPCookieAcceptPolicy
_wkGetHTTPPipeliningPriority _wkGetHTTPPipeliningPriority
_wkGetHyphenationLocationBeforeIndex _wkGetHyphenationLocationBeforeIndex
_wkGetMIMETypeForExtension _wkGetMIMETypeForExtension
...@@ -1318,6 +1325,7 @@ _wkGetNSURLResponseMustRevalidate ...@@ -1318,6 +1325,7 @@ _wkGetNSURLResponseMustRevalidate
_wkGetPreferredExtensionForMIMEType _wkGetPreferredExtensionForMIMEType
_wkGetUserToBaseCTM _wkGetUserToBaseCTM
_wkGetWheelEventDeltas _wkGetWheelEventDeltas
_wkHTTPCookiesForURL
_wkHitTestMediaUIPart _wkHitTestMediaUIPart
_wkInitializeMaximumHTTPConnectionCountPerHost _wkInitializeMaximumHTTPConnectionCountPerHost
_wkIsLatchingWheelEvent _wkIsLatchingWheelEvent
...@@ -1340,6 +1348,7 @@ _wkSetCONNECTProxyAuthorizationForStream ...@@ -1340,6 +1348,7 @@ _wkSetCONNECTProxyAuthorizationForStream
_wkSetCONNECTProxyForStream _wkSetCONNECTProxyForStream
_wkSetCookieStoragePrivateBrowsingEnabled _wkSetCookieStoragePrivateBrowsingEnabled
_wkSetDragImage _wkSetDragImage
_wkSetHTTPCookiesForURL
_wkSetHTTPPipeliningPriority _wkSetHTTPPipeliningPriority
_wkSetNSURLConnectionDefersCallbacks _wkSetNSURLConnectionDefersCallbacks
_wkSetNSURLRequestShouldContentSniff _wkSetNSURLRequestShouldContentSniff
...@@ -1349,13 +1358,6 @@ _wkSetUpFontCache ...@@ -1349,13 +1358,6 @@ _wkSetUpFontCache
_wkSignalCFReadStreamEnd _wkSignalCFReadStreamEnd
_wkSignalCFReadStreamError _wkSignalCFReadStreamError
_wkSignalCFReadStreamHasBytes _wkSignalCFReadStreamHasBytes
_wkCreatePrivateStorageSession
_wkCopyRequestWithStorageSession
_wkCopyHTTPCookieStorage
_wkGetHTTPCookieAcceptPolicy
_wkHTTPCookiesForURL
_wkSetHTTPCookiesForURL
_wkDeleteHTTPCookie
#if !defined(NDEBUG) #if !defined(NDEBUG)
__ZN7WebCore20LogNotYetImplementedE __ZN7WebCore20LogNotYetImplementedE
......
2011-03-11 Darin Adler <darin@apple.com>
Reviewed by Sam Weinig.
Dragging image to desktop gives webloc instead of image file in WebKit2
https://bugs.webkit.org/show_bug.cgi?id=56193
* WebProcess/WebCoreSupport/mac/WebDragClientMac.mm:
(WebKit::convertImageToBitmap): Added. Factored out from startDrag to
make the startDrag code clearer.
(WebKit::WebDragClient::startDrag): Streamlined code a bit.
(WebKit::cachedImage): Added. Helper for function below.
(WebKit::arrayForURLsWithTitles): Added. Helper for function below.
(WebKit::WebDragClient::declareAndWriteDragImage): Added code to handle file
promises and removed a log of uneeded code.
(-[WKPasteboardFilePromiseOwner copyDropDirectory]): Added.
(promisedDataClient): Added.
(-[WKPasteboardOwner clearImage]): Added.
(-[WKPasteboardOwner initWithImage:]): Added.
(-[WKPasteboardOwner dealloc]): Added.
(-[WKPasteboardOwner finalize]): Added.
(-[WKPasteboardOwner pasteboard:provideDataForType:]): Added.
(-[WKPasteboardOwner pasteboardChangedOwner:]): Added.
(matchesExtensionOrEquivalent): Added.
(-[WKPasteboardOwner namesOfPromisedFilesDroppedAtDestination:]): Added.
Much of the new code above came from the WebKit1 drag code.
* WebProcess/WebPage/WebPage.cpp:
(WebKit::WebPage::dragEnded): Added call to Mac-only platformDragEnded.
* WebProcess/WebPage/WebPage.h: Added Mac-only platformDragEnded and m_dragSource.
* WebProcess/WebPage/mac/WebPageMac.mm:
(WebKit::WebPage::setDragSource): Added.
(WebKit::WebPage::platformDragEnded): Added.
2011-03-12 Mark Rowe <mrowe@apple.com> 2011-03-12 Mark Rowe <mrowe@apple.com>
Fix the 32-bit build. Fix the 32-bit build.
......
...@@ -1514,6 +1514,7 @@ void WebPage::dragEnded(WebCore::IntPoint clientPosition, WebCore::IntPoint glob ...@@ -1514,6 +1514,7 @@ void WebPage::dragEnded(WebCore::IntPoint clientPosition, WebCore::IntPoint glob
IntPoint adjustedClientPosition(clientPosition.x() + m_page->dragController()->dragOffset().x(), clientPosition.y() + m_page->dragController()->dragOffset().y()); IntPoint adjustedClientPosition(clientPosition.x() + m_page->dragController()->dragOffset().x(), clientPosition.y() + m_page->dragController()->dragOffset().y());
IntPoint adjustedGlobalPosition(globalPosition.x() + m_page->dragController()->dragOffset().x(), globalPosition.y() + m_page->dragController()->dragOffset().y()); IntPoint adjustedGlobalPosition(globalPosition.x() + m_page->dragController()->dragOffset().x(), globalPosition.y() + m_page->dragController()->dragOffset().y());
platformDragEnded();
m_page->dragController()->dragEnded(); m_page->dragController()->dragEnded();
FrameView* view = m_page->mainFrame()->view(); FrameView* view = m_page->mainFrame()->view();
if (!view) if (!view)
...@@ -2109,4 +2110,10 @@ void WebPage::setMemoryCacheMessagesEnabled(bool memoryCacheMessagesEnabled) ...@@ -2109,4 +2110,10 @@ void WebPage::setMemoryCacheMessagesEnabled(bool memoryCacheMessagesEnabled)
m_page->setMemoryCacheClientCallsEnabled(memoryCacheMessagesEnabled); m_page->setMemoryCacheClientCallsEnabled(memoryCacheMessagesEnabled);
} }
#if !PLATFORM(MAC)
void WebPage::platformDragEnded()
{
}
#endif
} // namespace WebKit } // namespace WebKit
...@@ -61,6 +61,7 @@ ...@@ -61,6 +61,7 @@
#include "DictionaryPopupInfo.h" #include "DictionaryPopupInfo.h"
#include <wtf/RetainPtr.h> #include <wtf/RetainPtr.h>
OBJC_CLASS AccessibilityWebPageObject; OBJC_CLASS AccessibilityWebPageObject;
OBJC_CLASS NSObject;
#endif #endif
namespace CoreIPC { namespace CoreIPC {
...@@ -356,6 +357,10 @@ public: ...@@ -356,6 +357,10 @@ public:
void forceRepaintWithoutCallback(); void forceRepaintWithoutCallback();
#if PLATFORM(MAC)
void setDragSource(NSObject *);
#endif
private: private:
WebPage(uint64_t pageID, const WebPageCreationParameters&); WebPage(uint64_t pageID, const WebPageCreationParameters&);
...@@ -479,6 +484,8 @@ private: ...@@ -479,6 +484,8 @@ private:
void didSelectItemFromActiveContextMenu(const WebContextMenuItemData&); void didSelectItemFromActiveContextMenu(const WebContextMenuItemData&);
#endif #endif
void platformDragEnded();
OwnPtr<WebCore::Page> m_page; OwnPtr<WebCore::Page> m_page;
RefPtr<WebFrame> m_mainFrame; RefPtr<WebFrame> m_mainFrame;
RefPtr<InjectedBundleBackForwardList> m_backForwardList; RefPtr<InjectedBundleBackForwardList> m_backForwardList;
...@@ -518,6 +525,8 @@ private: ...@@ -518,6 +525,8 @@ private:
HashSet<PluginView*> m_pluginViews; HashSet<PluginView*> m_pluginViews;
RetainPtr<AccessibilityWebPageObject> m_mockAccessibilityElement; RetainPtr<AccessibilityWebPageObject> m_mockAccessibilityElement;
RetainPtr<NSObject> m_dragSource;
#elif PLATFORM(WIN) #elif PLATFORM(WIN)
// Our view's window (in the UI process). // Our view's window (in the UI process).
HWND m_nativeWindow; HWND m_nativeWindow;
......
/* /*
* Copyright (C) 2010 Apple Inc. All rights reserved. * Copyright (C) 2010, 2011 Apple Inc. All rights reserved.
* *
* Redistribution and use in source and binary forms, with or without * Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions * modification, are permitted provided that the following conditions
...@@ -481,4 +481,17 @@ bool WebPage::canHandleRequest(const WebCore::ResourceRequest& request) ...@@ -481,4 +481,17 @@ bool WebPage::canHandleRequest(const WebCore::ResourceRequest& request)
return request.url().protocolIs("applewebdata"); return request.url().protocolIs("applewebdata");
} }
void WebPage::setDragSource(NSObject *dragSource)
{
m_dragSource = dragSource;
}
void WebPage::platformDragEnded()
{
// The drag source we care about here is NSFilePromiseDragSource, which doesn't look at
// the arguments. It's OK to just pass arbitrary constant values, so we just pass all zeroes.
[m_dragSource.get() draggedImage:nil endedAt:NSZeroPoint operation:NSDragOperationNone];
m_dragSource = nullptr;
}
} // namespace WebKit } // namespace WebKit
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment