Diff
Modified: trunk/Source/WebCore/ChangeLog (109146 => 109147)
--- trunk/Source/WebCore/ChangeLog 2012-02-28 21:49:55 UTC (rev 109146)
+++ trunk/Source/WebCore/ChangeLog 2012-02-28 21:58:25 UTC (rev 109147)
@@ -1,3 +1,27 @@
+2012-02-28 Enrica Casucci <[email protected]>
+
+ More Pasteboard code cleanup.
+ https://bugs.webkit.org/show_bug.cgi?id=79816
+
+ Removing the last references to NSPasteboard.
+
+ Reviewed by Alexey Proskuryakov.
+
+ No new tests. No change in functionality.
+
+ * WebCore.xcodeproj/project.pbxproj:
+ * editing/mac/EditorMac.mm:
+ (WebCore::Editor::pasteWithPasteboard):
+ (WebCore::Editor::takeFindStringFromSelection):
+ * loader/EmptyClients.h:
+ (WebCore::EmptyEditorClient::setInsertionPasteboard):
+ * page/DragClient.h:
+ * page/EditorClient.h:
+ * platform/DragData.h:
+ * platform/Pasteboard.h:
+ * platform/mac/ClipboardMac.h:
+ * platform/mac/PasteboardHelper.h: Removed.
+
2012-02-28 Sheriff Bot <[email protected]>
Unreviewed, rolling out r109137.
Modified: trunk/Source/WebCore/WebCore.xcodeproj/project.pbxproj (109146 => 109147)
--- trunk/Source/WebCore/WebCore.xcodeproj/project.pbxproj 2012-02-28 21:49:55 UTC (rev 109146)
+++ trunk/Source/WebCore/WebCore.xcodeproj/project.pbxproj 2012-02-28 21:58:25 UTC (rev 109147)
@@ -3645,7 +3645,6 @@
A7D20F62107F406900A80392 /* JSWebGLActiveInfo.cpp in Sources */ = {isa = PBXBuildFile; fileRef = A7D20F60107F406900A80392 /* JSWebGLActiveInfo.cpp */; };
A7D20F63107F406900A80392 /* JSWebGLActiveInfo.h in Headers */ = {isa = PBXBuildFile; fileRef = A7D20F61107F406900A80392 /* JSWebGLActiveInfo.h */; };
A7D20F6D107F438B00A80392 /* WebGLActiveInfo.h in Headers */ = {isa = PBXBuildFile; fileRef = A7D20F6B107F438B00A80392 /* WebGLActiveInfo.h */; };
- A7D3C5240B576B4B002CA450 /* PasteboardHelper.h in Headers */ = {isa = PBXBuildFile; fileRef = A7D3C5230B576B4B002CA450 /* PasteboardHelper.h */; settings = {ATTRIBUTES = (Private, ); }; };
A7D6B3490F61104500B79FD1 /* WorkerScriptLoader.h in Headers */ = {isa = PBXBuildFile; fileRef = A7D6B3470F61104500B79FD1 /* WorkerScriptLoader.h */; };
A7D6B34A0F61104500B79FD1 /* WorkerScriptLoader.cpp in Sources */ = {isa = PBXBuildFile; fileRef = A7D6B3480F61104500B79FD1 /* WorkerScriptLoader.cpp */; };
A7DBF8DD1276919C006B6008 /* TextCheckingHelper.cpp in Sources */ = {isa = PBXBuildFile; fileRef = A7DBF8DB1276919C006B6008 /* TextCheckingHelper.cpp */; };
@@ -10547,7 +10546,6 @@
A7D20F60107F406900A80392 /* JSWebGLActiveInfo.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = JSWebGLActiveInfo.cpp; sourceTree = "<group>"; };
A7D20F61107F406900A80392 /* JSWebGLActiveInfo.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = JSWebGLActiveInfo.h; sourceTree = "<group>"; };
A7D20F6B107F438B00A80392 /* WebGLActiveInfo.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = WebGLActiveInfo.h; path = canvas/WebGLActiveInfo.h; sourceTree = "<group>"; };
- A7D3C5230B576B4B002CA450 /* PasteboardHelper.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = PasteboardHelper.h; sourceTree = "<group>"; };
A7D6B3470F61104500B79FD1 /* WorkerScriptLoader.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = WorkerScriptLoader.h; path = workers/WorkerScriptLoader.h; sourceTree = "<group>"; };
A7D6B3480F61104500B79FD1 /* WorkerScriptLoader.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; name = WorkerScriptLoader.cpp; path = workers/WorkerScriptLoader.cpp; sourceTree = "<group>"; };
A7DB418114CE1F0A00A2E316 /* ShadowRoot.idl */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text; path = ShadowRoot.idl; sourceTree = "<group>"; };
@@ -15123,7 +15121,6 @@
BC772C5D0C4EB3440083285F /* MIMETypeRegistryMac.mm */,
93500F3113FDE3BE0099EC24 /* NSScrollerImpDetails.h */,
52F52E1014A0134F00ACC397 /* NSScrollerImpDetails.mm */,
- A7D3C5230B576B4B002CA450 /* PasteboardHelper.h */,
4B2709810AF2E5E00065127F /* PasteboardMac.mm */,
CDEA762E146084DE008B31F1 /* PlatformClockCA.cpp */,
CDEA762F146084EE008B31F1 /* PlatformClockCA.h */,
@@ -23437,7 +23434,6 @@
BC76AC130DD7AD5C00415F34 /* ParserUtilities.h in Headers */,
F55B3DCA1251F12D003EF269 /* PasswordInputType.h in Headers */,
4B2708C70AF19EE40065127F /* Pasteboard.h in Headers */,
- A7D3C5240B576B4B002CA450 /* PasteboardHelper.h in Headers */,
C598905714E9C28000E8D18B /* PasteboardStrategy.h in Headers */,
B27535800B053814002CE64F /* Path.h in Headers */,
A88DD4870B4629A300C02990 /* PathTraversalState.h in Headers */,
Modified: trunk/Source/WebCore/editing/mac/EditorMac.mm (109146 => 109147)
--- trunk/Source/WebCore/editing/mac/EditorMac.mm 2012-02-28 21:49:55 UTC (rev 109146)
+++ trunk/Source/WebCore/editing/mac/EditorMac.mm 2012-02-28 21:58:25 UTC (rev 109147)
@@ -74,7 +74,7 @@
RefPtr<Range> range = selectedRange();
bool choosePlainText;
- m_frame->editor()->client()->setInsertionPasteboard([NSPasteboard generalPasteboard]);
+ m_frame->editor()->client()->setInsertionPasteboard(NSGeneralPboard);
#if !defined(BUILDING_ON_LEOPARD) && !defined(BUILDING_ON_SNOW_LEOPARD)
RefPtr<DocumentFragment> fragment = pasteboard->documentFragment(m_frame, range, allowPlainText, choosePlainText);
if (fragment && shouldInsertFragment(fragment, range, EditorInsertActionPasted))
@@ -94,7 +94,7 @@
pasteAsFragment(fragment, canSmartReplaceWithPasteboard(pasteboard), false);
}
#endif
- m_frame->editor()->client()->setInsertionPasteboard(nil);
+ m_frame->editor()->client()->setInsertionPasteboard(String());
}
static RenderStyle* styleForSelectionStart(Frame* frame, Node *&nodeToRemove)
@@ -282,11 +282,10 @@
return;
}
- NSString *nsSelectedText = m_frame->displayStringModifiedByEncoding(selectedText());
-
- NSPasteboard *findPasteboard = [NSPasteboard pasteboardWithName:NSFindPboard];
- [findPasteboard declareTypes:[NSArray arrayWithObject:NSStringPboardType] owner:nil];
- [findPasteboard setString:nsSelectedText forType:NSStringPboardType];
+ Vector<String> types;
+ types.append(String(NSStringPboardType));
+ platformStrategies()->pasteboardStrategy()->setTypes(types, NSFindPboard);
+ platformStrategies()->pasteboardStrategy()->setStringForType(m_frame->displayStringModifiedByEncoding(selectedText()), NSStringPboardType, NSFindPboard);
}
void Editor::writeSelectionToPasteboard(const String& pasteboardName, const Vector<String>& pasteboardTypes)
Modified: trunk/Source/WebCore/loader/EmptyClients.h (109146 => 109147)
--- trunk/Source/WebCore/loader/EmptyClients.h 2012-02-28 21:49:55 UTC (rev 109146)
+++ trunk/Source/WebCore/loader/EmptyClients.h 2012-02-28 21:58:25 UTC (rev 109147)
@@ -494,7 +494,7 @@
virtual NSString* userVisibleString(NSURL*) { return 0; }
virtual DocumentFragment* documentFragmentFromAttributedString(NSAttributedString*, Vector<RefPtr<ArchiveResource> >&) { return 0; };
- virtual void setInsertionPasteboard(NSPasteboard*) { };
+ virtual void setInsertionPasteboard(const String&) { };
virtual NSURL* canonicalizeURL(NSURL*) { return 0; }
virtual NSURL* canonicalizeURLString(NSString*) { return 0; }
#endif
Modified: trunk/Source/WebCore/page/DragClient.h (109146 => 109147)
--- trunk/Source/WebCore/page/DragClient.h 2012-02-28 21:49:55 UTC (rev 109146)
+++ trunk/Source/WebCore/page/DragClient.h 2012-02-28 21:58:25 UTC (rev 109147)
@@ -35,7 +35,6 @@
OBJC_CLASS DOMElement;
OBJC_CLASS NSURL;
OBJC_CLASS NSString;
-OBJC_CLASS NSPasteboard;
#endif
namespace WebCore {
Modified: trunk/Source/WebCore/page/EditorClient.h (109146 => 109147)
--- trunk/Source/WebCore/page/EditorClient.h 2012-02-28 21:49:55 UTC (rev 109146)
+++ trunk/Source/WebCore/page/EditorClient.h 2012-02-28 21:58:25 UTC (rev 109147)
@@ -37,7 +37,6 @@
#if PLATFORM(MAC)
OBJC_CLASS NSAttributedString;
-OBJC_CLASS NSPasteboard;
OBJC_CLASS NSString;
OBJC_CLASS NSURL;
#endif
@@ -117,7 +116,7 @@
#if PLATFORM(MAC)
virtual NSString* userVisibleString(NSURL*) = 0;
virtual DocumentFragment* documentFragmentFromAttributedString(NSAttributedString*, Vector< RefPtr<ArchiveResource> >&) = 0;
- virtual void setInsertionPasteboard(NSPasteboard*) = 0;
+ virtual void setInsertionPasteboard(const String& pasteboardName) = 0;
virtual NSURL* canonicalizeURL(NSURL*) = 0;
virtual NSURL* canonicalizeURLString(NSString*) = 0;
#endif
Modified: trunk/Source/WebCore/platform/DragData.h (109146 => 109147)
--- trunk/Source/WebCore/platform/DragData.h 2012-02-28 21:49:55 UTC (rev 109146)
+++ trunk/Source/WebCore/platform/DragData.h 2012-02-28 21:58:25 UTC (rev 109147)
@@ -46,8 +46,6 @@
typedef void* DragDataRef;
#endif
-OBJC_CLASS NSPasteboard;
-
#elif PLATFORM(QT)
QT_BEGIN_NAMESPACE
class QMimeData;
Modified: trunk/Source/WebCore/platform/Pasteboard.h (109146 => 109147)
--- trunk/Source/WebCore/platform/Pasteboard.h 2012-02-28 21:49:55 UTC (rev 109146)
+++ trunk/Source/WebCore/platform/Pasteboard.h 2012-02-28 21:58:25 UTC (rev 109147)
@@ -44,7 +44,6 @@
#if PLATFORM(MAC)
OBJC_CLASS NSFileWrapper;
-OBJC_CLASS NSPasteboard;
OBJC_CLASS NSArray;
#endif
Modified: trunk/Source/WebCore/platform/mac/ClipboardMac.h (109146 => 109147)
--- trunk/Source/WebCore/platform/mac/ClipboardMac.h 2012-02-28 21:49:55 UTC (rev 109146)
+++ trunk/Source/WebCore/platform/mac/ClipboardMac.h 2012-02-28 21:58:25 UTC (rev 109147)
@@ -31,7 +31,6 @@
#include <wtf/RetainPtr.h>
OBJC_CLASS NSImage;
-OBJC_CLASS NSPasteboard;
namespace WebCore {
Deleted: trunk/Source/WebCore/platform/mac/PasteboardHelper.h (109146 => 109147)
--- trunk/Source/WebCore/platform/mac/PasteboardHelper.h 2012-02-28 21:49:55 UTC (rev 109146)
+++ trunk/Source/WebCore/platform/mac/PasteboardHelper.h 2012-02-28 21:58:25 UTC (rev 109147)
@@ -1,55 +0,0 @@
-/*
- * Copyright (C) 2007 Apple Inc. All rights reserved.
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions
- * are met:
- * 1. Redistributions of source code must retain the above copyright
- * notice, this list of conditions and the following disclaimer.
- * 2. Redistributions in binary form must reproduce the above copyright
- * notice, this list of conditions and the following disclaimer in the
- * documentation and/or other materials provided with the distribution.
- *
- * THIS SOFTWARE IS PROVIDED BY APPLE COMPUTER, INC. ``AS IS'' AND ANY
- * EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
- * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
- * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL APPLE COMPUTER, INC. OR
- * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL,
- * EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,
- * PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR
- * PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY
- * OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
- * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
- * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
- */
-
-#ifndef PasteboardHelper_h
-#define PasteboardHelper_h
-
-/* FIXME: This is a helper class used to provide access to functionality inside
- * WebKit. The required functionality should eventually be migrated to WebCore
- * so that this class can be removed.
- */
-#if PLATFORM(MAC)
-
-#import <wtf/Forward.h>
-
-OBJC_CLASS DOMDocumentFragment;
-
-namespace WebCore {
-
- class Document;
-
- class PasteboardHelper {
- public:
- virtual ~PasteboardHelper() {}
- virtual String urlFromPasteboard(NSPasteboard*, String* title) const = 0;
- virtual String plainTextFromPasteboard(NSPasteboard*) const = 0;
- virtual DOMDocumentFragment* fragmentFromPasteboard(NSPasteboard*) const = 0;
- virtual NSArray* insertablePasteboardTypes() const = 0;
- };
-
-}
-#endif // PLATFORM(MAC)
-
-#endif // !PasteboardHelper_h
Modified: trunk/Source/WebKit/mac/ChangeLog (109146 => 109147)
--- trunk/Source/WebKit/mac/ChangeLog 2012-02-28 21:49:55 UTC (rev 109146)
+++ trunk/Source/WebKit/mac/ChangeLog 2012-02-28 21:58:25 UTC (rev 109147)
@@ -1,3 +1,16 @@
+2012-02-28 Enrica Casucci <[email protected]>
+
+ More Pasteboard code cleanup.
+ https://bugs.webkit.org/show_bug.cgi?id=79816
+
+ Removing the last references to NSPasteboard.
+
+ Reviewed by Alexey Proskuryakov.
+
+ * WebCoreSupport/WebEditorClient.h:
+ * WebCoreSupport/WebEditorClient.mm:
+ (WebEditorClient::setInsertionPasteboard):
+
2012-02-26 Hajime Morrita <[email protected]>
Move ChromeClient::showContextMenu() to ContextMenuClient
Modified: trunk/Source/WebKit/mac/WebCoreSupport/WebEditorClient.h (109146 => 109147)
--- trunk/Source/WebKit/mac/WebCoreSupport/WebEditorClient.h 2012-02-28 21:49:55 UTC (rev 109146)
+++ trunk/Source/WebKit/mac/WebCoreSupport/WebEditorClient.h 2012-02-28 21:58:25 UTC (rev 109147)
@@ -72,7 +72,7 @@
virtual NSString* userVisibleString(NSURL *) OVERRIDE;
virtual WebCore::DocumentFragment* documentFragmentFromAttributedString(NSAttributedString *, Vector< RefPtr<WebCore::ArchiveResource> >&) OVERRIDE;
- virtual void setInsertionPasteboard(NSPasteboard *) OVERRIDE;
+ virtual void setInsertionPasteboard(const String&) OVERRIDE;
virtual NSURL* canonicalizeURL(NSURL*) OVERRIDE;
virtual NSURL* canonicalizeURLString(NSString*) OVERRIDE;
Modified: trunk/Source/WebKit/mac/WebCoreSupport/WebEditorClient.mm (109146 => 109147)
--- trunk/Source/WebKit/mac/WebCoreSupport/WebEditorClient.mm 2012-02-28 21:49:55 UTC (rev 109146)
+++ trunk/Source/WebKit/mac/WebCoreSupport/WebEditorClient.mm 2012-02-28 21:58:25 UTC (rev 109147)
@@ -373,9 +373,9 @@
return core(fragment);
}
-void WebEditorClient::setInsertionPasteboard(NSPasteboard *pasteboard)
+void WebEditorClient::setInsertionPasteboard(const String& pasteboardName)
{
- [m_webView _setInsertionPasteboard:pasteboard];
+ [m_webView _setInsertionPasteboard:[NSPasteboard pasteboardWithName:pasteboardName]];
}
Modified: trunk/Source/WebKit2/ChangeLog (109146 => 109147)
--- trunk/Source/WebKit2/ChangeLog 2012-02-28 21:49:55 UTC (rev 109146)
+++ trunk/Source/WebKit2/ChangeLog 2012-02-28 21:58:25 UTC (rev 109147)
@@ -1,3 +1,16 @@
+2012-02-28 Enrica Casucci <[email protected]>
+
+ More Pasteboard code cleanup.
+ https://bugs.webkit.org/show_bug.cgi?id=79816
+
+ Removing the last references to NSPasteboard.
+
+ Reviewed by Alexey Proskuryakov.
+
+ * WebProcess/WebCoreSupport/WebEditorClient.h:
+ * WebProcess/WebCoreSupport/mac/WebEditorClientMac.mm:
+ (WebKit::WebEditorClient::setInsertionPasteboard):
+
2012-02-28 Alexey Proskuryakov <[email protected]>
[Mac] Add an experimental SPI for plug-ins to enter sandbox
Modified: trunk/Source/WebKit2/WebProcess/WebCoreSupport/WebEditorClient.h (109146 => 109147)
--- trunk/Source/WebKit2/WebProcess/WebCoreSupport/WebEditorClient.h 2012-02-28 21:49:55 UTC (rev 109146)
+++ trunk/Source/WebKit2/WebProcess/WebCoreSupport/WebEditorClient.h 2012-02-28 21:58:25 UTC (rev 109147)
@@ -94,7 +94,7 @@
#if PLATFORM(MAC)
virtual NSString *userVisibleString(NSURL *) OVERRIDE;
virtual WebCore::DocumentFragment* documentFragmentFromAttributedString(NSAttributedString *, Vector< RefPtr<WebCore::ArchiveResource> >&) OVERRIDE;
- virtual void setInsertionPasteboard(NSPasteboard *) OVERRIDE;
+ virtual void setInsertionPasteboard(const String& pasteboardName) OVERRIDE;
virtual NSURL* canonicalizeURL(NSURL*) OVERRIDE;
virtual NSURL* canonicalizeURLString(NSString*) OVERRIDE;
#endif
Modified: trunk/Source/WebKit2/WebProcess/WebCoreSupport/mac/WebEditorClientMac.mm (109146 => 109147)
--- trunk/Source/WebKit2/WebProcess/WebCoreSupport/mac/WebEditorClientMac.mm 2012-02-28 21:49:55 UTC (rev 109146)
+++ trunk/Source/WebKit2/WebProcess/WebCoreSupport/mac/WebEditorClientMac.mm 2012-02-28 21:58:25 UTC (rev 109147)
@@ -126,7 +126,7 @@
return core(fragment);
}
-void WebEditorClient::setInsertionPasteboard(NSPasteboard *)
+void WebEditorClient::setInsertionPasteboard(const String&)
{
// This is used only by Mail, no need to implement it now.
notImplemented();