Refactor ClipboardMac class to use PlatformStrategies.
authorenrica@apple.com <enrica@apple.com@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Wed, 15 Feb 2012 23:08:25 +0000 (23:08 +0000)
committerenrica@apple.com <enrica@apple.com@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Wed, 15 Feb 2012 23:08:25 +0000 (23:08 +0000)
commit6d9962f673fe6c0032d656846b350f0075371f73
treec90fa42a14a337701c6f3c7f533945e3b119ce42
parent0633dcbe01454f9ff22f381e12a975320ea4b7aa
Refactor ClipboardMac class to use PlatformStrategies.
https://bugs.webkit.org/show_bug.cgi?id=78554

Reviewed by Anders Carlsson.

Source/WebCore:

No new tests. No change in behavior.

* WebCore.exp.in: Added new exported methods of the PlatformPasteboard class
* editing/mac/EditorMac.mm:
(WebCore::Editor::newGeneralClipboard): Use name based pasteboard references.
* page/DragClient.h:
(WebCore::DragClient::declareAndWriteDragImage): Ditto.
* page/mac/EventHandlerMac.mm:
(WebCore::EventHandler::createDraggingClipboard): Ditto.
* platform/PasteboardStrategy.h: Added new methods to get a unique pasteboard name
and the pasteboard change count.
* platform/PlatformPasteboard.h: Ditto.
* platform/mac/ClipboardMac.h:
(WebCore::ClipboardMac::create): Using name based pasteboard.
(WebCore::ClipboardMac::pasteboardName): Replacing the old pasteboard() method.
* platform/mac/ClipboardMac.mm: All the methods below have been modified to avoid
using Objective-C types and direct access to NSPasteboard object.
(WebCore::Clipboard::create):
(WebCore::ClipboardMac::ClipboardMac):
(WebCore::ClipboardMac::hasData):
(WebCore::cocoaTypeFromHTMLClipboardType):
(WebCore::utiTypeFromCocoaType):
(WebCore::addHTMLClipboardTypesForCocoaType):
(WebCore::ClipboardMac::clearData):
(WebCore::ClipboardMac::clearAllData):
(WebCore::absoluteURLsFromPasteboardFilenames):
(WebCore::absoluteURLsFromPasteboard):
(WebCore::ClipboardMac::getData):
(WebCore::ClipboardMac::setData):
(WebCore::ClipboardMac::types):
(WebCore::ClipboardMac::files):
(WebCore::ClipboardMac::setDragImage):
(WebCore::ClipboardMac::writeRange):
(WebCore::ClipboardMac::writePlainText):
(WebCore::ClipboardMac::writeURL):
(WebCore::ClipboardMac::declareAndWriteDragImage):
* platform/mac/PasteboardMac.mm:
(WebCore::Pasteboard::writeClipboard): Using name based pasteboard reference.
* platform/mac/PlatformPasteboardMac.mm:
(WebCore::PlatformPasteboard::getPathnamesForType): Fixed to support NSArray and NString content.
(WebCore::PlatformPasteboard::changeCount): Added.
(WebCore::PlatformPasteboard::uniqueName): Added.

Source/WebKit/mac:

* WebCoreSupport/WebDragClient.h: Changed methods signature to use name based pasteboard.
* WebCoreSupport/WebDragClient.mm: Ditto.
(WebDragClient::willPerformDragSourceAction):
(WebDragClient::startDrag):
(WebDragClient::declareAndWriteDragImage):
* WebCoreSupport/WebPlatformStrategies.h: Added new methods.
* WebCoreSupport/WebPlatformStrategies.mm:
(WebPlatformStrategies::changeCount):
(WebPlatformStrategies::uniqueName):

Source/WebKit2:

* WebProcess/WebCoreSupport/WebDragClient.h: Changed method signature to reference
the pasteboard by name.
* WebProcess/WebCoreSupport/WebPlatformStrategies.cpp: Added new methods.
(WebKit::WebPlatformStrategies::changeCount):
(WebKit::WebPlatformStrategies::uniqueName):
* WebProcess/WebCoreSupport/WebPlatformStrategies.h: Ditto.
* WebProcess/WebCoreSupport/mac/WebDragClientMac.mm:
(WebKit::WebDragClient::declareAndWriteDragImage): Changed method signature to reference
the pasteboard by name.

git-svn-id: http://svn.webkit.org/repository/webkit/trunk@107844 268f45cc-cd09-0410-ab3c-d52691b4dbfc
21 files changed:
Source/WebCore/ChangeLog
Source/WebCore/WebCore.exp.in
Source/WebCore/editing/mac/EditorMac.mm
Source/WebCore/page/DragClient.h
Source/WebCore/page/mac/EventHandlerMac.mm
Source/WebCore/platform/PasteboardStrategy.h
Source/WebCore/platform/PlatformPasteboard.h
Source/WebCore/platform/mac/ClipboardMac.h
Source/WebCore/platform/mac/ClipboardMac.mm
Source/WebCore/platform/mac/PasteboardMac.mm
Source/WebCore/platform/mac/PlatformPasteboardMac.mm
Source/WebKit/mac/ChangeLog
Source/WebKit/mac/WebCoreSupport/WebDragClient.h
Source/WebKit/mac/WebCoreSupport/WebDragClient.mm
Source/WebKit/mac/WebCoreSupport/WebPlatformStrategies.h
Source/WebKit/mac/WebCoreSupport/WebPlatformStrategies.mm
Source/WebKit2/ChangeLog
Source/WebKit2/WebProcess/WebCoreSupport/WebDragClient.h
Source/WebKit2/WebProcess/WebCoreSupport/WebPlatformStrategies.cpp
Source/WebKit2/WebProcess/WebCoreSupport/WebPlatformStrategies.h
Source/WebKit2/WebProcess/WebCoreSupport/mac/WebDragClientMac.mm