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>
Unreviewed, rolling out r80919.
......
......@@ -325,6 +325,7 @@ __ZN7WebCore13toDeviceSpaceERKNS_9FloatRectEP8NSWindow
__ZN7WebCore13toHTMLElementEPNS_21FormAssociatedElementE
__ZN7WebCore13toJSDOMWindowEN3JSC7JSValueE
__ZN7WebCore14CachedResource12removeClientEPNS_20CachedResourceClientE
__ZN7WebCore14CachedResource16unregisterHandleEPNS_24CachedResourceHandleBaseE
__ZN7WebCore14CachedResource9addClientEPNS_20CachedResourceClientE
__ZN7WebCore14DocumentLoader10commitDataEPKci
__ZN7WebCore14DocumentLoader13attachToFrameEv
......@@ -553,6 +554,7 @@ __ZN7WebCore23createFragmentFromNodesEPNS_8DocumentERKN3WTF6VectorIPNS_4NodeELm0
__ZN7WebCore23getHostnamesWithCookiesERN3WTF7HashSetINS0_6StringENS0_10StringHashENS0_10HashTraitsIS2_EEEE
__ZN7WebCore23overrideDefaultLanguageERKN3WTF6StringE
__ZN7WebCore24BinaryPropertyListWriter17writePropertyListEv
__ZN7WebCore24CachedResourceHandleBase11setResourceEPNS_14CachedResourceE
__ZN7WebCore24DocumentMarkerController13removeMarkersEj
__ZN7WebCore24DocumentMarkerController14markersForNodeEPNS_4NodeE
__ZN7WebCore24DocumentMarkerController14markersForNodeEPNS_4NodeE
......@@ -1291,12 +1293,16 @@ _wkAdvanceDefaultButtonPulseAnimation
_wkCGContextGetShouldSmoothFonts
_wkCopyCFLocalizationPreferredName
_wkCopyCONNECTProxyResponse
_wkCopyHTTPCookieStorage
_wkCopyNSURLResponseStatusLine
_wkCopyRequestWithStorageSession
_wkCreateCTLineWithUniCharProvider
_wkCreateCustomCFReadStream
_wkCreateNSURLConnectionDelegateProxy
_wkCreatePrivateStorageSession
_wkCreateURLNPasteboardFlavorTypeName
_wkCreateURLPasteboardFlavorTypeName
_wkDeleteHTTPCookie
_wkDrawBezeledTextArea
_wkDrawBezeledTextFieldCell
_wkDrawCapsLockIndicator
......@@ -1309,6 +1315,7 @@ _wkGetFontInLanguageForCharacter
_wkGetFontInLanguageForRange
_wkGetGlyphTransformedAdvances
_wkGetGlyphsForCharacters
_wkGetHTTPCookieAcceptPolicy
_wkGetHTTPPipeliningPriority
_wkGetHyphenationLocationBeforeIndex
_wkGetMIMETypeForExtension
......@@ -1318,6 +1325,7 @@ _wkGetNSURLResponseMustRevalidate
_wkGetPreferredExtensionForMIMEType
_wkGetUserToBaseCTM
_wkGetWheelEventDeltas
_wkHTTPCookiesForURL
_wkHitTestMediaUIPart
_wkInitializeMaximumHTTPConnectionCountPerHost
_wkIsLatchingWheelEvent
......@@ -1340,6 +1348,7 @@ _wkSetCONNECTProxyAuthorizationForStream
_wkSetCONNECTProxyForStream
_wkSetCookieStoragePrivateBrowsingEnabled
_wkSetDragImage
_wkSetHTTPCookiesForURL
_wkSetHTTPPipeliningPriority
_wkSetNSURLConnectionDefersCallbacks
_wkSetNSURLRequestShouldContentSniff
......@@ -1349,13 +1358,6 @@ _wkSetUpFontCache
_wkSignalCFReadStreamEnd
_wkSignalCFReadStreamError
_wkSignalCFReadStreamHasBytes
_wkCreatePrivateStorageSession
_wkCopyRequestWithStorageSession
_wkCopyHTTPCookieStorage
_wkGetHTTPCookieAcceptPolicy
_wkHTTPCookiesForURL
_wkSetHTTPCookiesForURL
_wkDeleteHTTPCookie
#if !defined(NDEBUG)
__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>
Fix the 32-bit build.
......
......@@ -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 adjustedGlobalPosition(globalPosition.x() + m_page->dragController()->dragOffset().x(), globalPosition.y() + m_page->dragController()->dragOffset().y());
platformDragEnded();
m_page->dragController()->dragEnded();
FrameView* view = m_page->mainFrame()->view();
if (!view)
......@@ -2109,4 +2110,10 @@ void WebPage::setMemoryCacheMessagesEnabled(bool memoryCacheMessagesEnabled)
m_page->setMemoryCacheClientCallsEnabled(memoryCacheMessagesEnabled);
}
#if !PLATFORM(MAC)
void WebPage::platformDragEnded()
{
}
#endif
} // namespace WebKit
......@@ -61,6 +61,7 @@
#include "DictionaryPopupInfo.h"
#include <wtf/RetainPtr.h>
OBJC_CLASS AccessibilityWebPageObject;
OBJC_CLASS NSObject;
#endif
namespace CoreIPC {
......@@ -356,6 +357,10 @@ public:
void forceRepaintWithoutCallback();
#if PLATFORM(MAC)
void setDragSource(NSObject *);
#endif
private:
WebPage(uint64_t pageID, const WebPageCreationParameters&);
......@@ -479,6 +484,8 @@ private:
void didSelectItemFromActiveContextMenu(const WebContextMenuItemData&);
#endif
void platformDragEnded();
OwnPtr<WebCore::Page> m_page;
RefPtr<WebFrame> m_mainFrame;
RefPtr<InjectedBundleBackForwardList> m_backForwardList;
......@@ -518,6 +525,8 @@ private:
HashSet<PluginView*> m_pluginViews;
RetainPtr<AccessibilityWebPageObject> m_mockAccessibilityElement;
RetainPtr<NSObject> m_dragSource;
#elif PLATFORM(WIN)
// Our view's window (in the UI process).
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
* modification, are permitted provided that the following conditions
......@@ -481,4 +481,17 @@ bool WebPage::canHandleRequest(const WebCore::ResourceRequest& request)
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
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