- Revision
- 150351
- Author
- [email protected]
- Date
- 2013-05-19 08:40:16 -0700 (Sun, 19 May 2013)
Log Message
Eliminate the Editor::newGeneralClipboard function
https://bugs.webkit.org/show_bug.cgi?id=116410
Reviewed by Andreas Kling.
This is one of the clean-ups made possible by the changes to the DOM clipboard class.
I had been waiting until all the platforms were moved over to it, but it turns out to be
easy to do this now, just with #ifdefs.
* PlatformBlackBerry.cmake: Deleted EditorBlackBerry.cpp.
* editing/Editor.cpp:
(WebCore::Editor::dispatchCPPEvent): Call Clipboard::createForCopyAndPaste directly when
using the new version of the Clipboard class. Also some small style cleanup nearby.
* editing/blackberry/EditorBlackBerry.cpp: Removed. The only function in this file was
newGeneralClipboard.
* editing/mac/EditorMac.mm: Deleted newGeneralClipboard.
* platform/efl/ClipboardEfl.cpp: Ditto.
* platform/gtk/ClipboardGtk.cpp: Ditto.
Modified Paths
Removed Paths
Diff
Modified: trunk/Source/WebCore/ChangeLog (150350 => 150351)
--- trunk/Source/WebCore/ChangeLog 2013-05-19 14:56:07 UTC (rev 150350)
+++ trunk/Source/WebCore/ChangeLog 2013-05-19 15:40:16 UTC (rev 150351)
@@ -1,3 +1,27 @@
+2013-05-19 Darin Adler <[email protected]>
+
+ Eliminate the Editor::newGeneralClipboard function
+ https://bugs.webkit.org/show_bug.cgi?id=116410
+
+ Reviewed by Andreas Kling.
+
+ This is one of the clean-ups made possible by the changes to the DOM clipboard class.
+ I had been waiting until all the platforms were moved over to it, but it turns out to be
+ easy to do this now, just with #ifdefs.
+
+ * PlatformBlackBerry.cmake: Deleted EditorBlackBerry.cpp.
+
+ * editing/Editor.cpp:
+ (WebCore::Editor::dispatchCPPEvent): Call Clipboard::createForCopyAndPaste directly when
+ using the new version of the Clipboard class. Also some small style cleanup nearby.
+
+ * editing/blackberry/EditorBlackBerry.cpp: Removed. The only function in this file was
+ newGeneralClipboard.
+
+ * editing/mac/EditorMac.mm: Deleted newGeneralClipboard.
+ * platform/efl/ClipboardEfl.cpp: Ditto.
+ * platform/gtk/ClipboardGtk.cpp: Ditto.
+
2013-05-19 Martin Robinson <[email protected]>
GtkSelectionData length is off by one
Modified: trunk/Source/WebCore/PlatformBlackBerry.cmake (150350 => 150351)
--- trunk/Source/WebCore/PlatformBlackBerry.cmake 2013-05-19 14:56:07 UTC (rev 150350)
+++ trunk/Source/WebCore/PlatformBlackBerry.cmake 2013-05-19 15:40:16 UTC (rev 150351)
@@ -93,7 +93,6 @@
# BlackBerry sources
list(APPEND WebCore_SOURCES
- editing/blackberry/EditorBlackBerry.cpp
editing/blackberry/SmartReplaceBlackBerry.cpp
html/shadow/MediaControlsBlackBerry.cpp
page/blackberry/AccessibilityObjectBlackBerry.cpp
Modified: trunk/Source/WebCore/editing/Editor.cpp (150350 => 150351)
--- trunk/Source/WebCore/editing/Editor.cpp 2013-05-19 14:56:07 UTC (rev 150350)
+++ trunk/Source/WebCore/editing/Editor.cpp 2013-05-19 15:40:16 UTC (rev 150351)
@@ -697,17 +697,22 @@
// Returns whether caller should continue with "the default processing", which is the same as
// the event handler NOT setting the return value to false
-bool Editor::dispatchCPPEvent(const AtomicString &eventType, ClipboardAccessPolicy policy)
+bool Editor::dispatchCPPEvent(const AtomicString& eventType, ClipboardAccessPolicy policy)
{
Node* target = findEventTargetFromSelection();
if (!target)
return true;
-
+
+#if !USE(LEGACY_STYLE_ABSTRACT_CLIPBOARD_CLASS)
+ RefPtr<Clipboard> clipboard = Clipboard::createForCopyAndPaste(policy);
+#else
+ // FIXME: Remove declaration of newGeneralClipboard when removing LEGACY_STYLE_ABSTRACT_CLIPBOARD_CLASS.
RefPtr<Clipboard> clipboard = newGeneralClipboard(policy, m_frame);
+#endif
- RefPtr<Event> evt = ClipboardEvent::create(eventType, true, true, clipboard);
- target->dispatchEvent(evt, IGNORE_EXCEPTION);
- bool noDefaultProcessing = evt->defaultPrevented();
+ RefPtr<Event> event = ClipboardEvent::create(eventType, true, true, clipboard);
+ target->dispatchEvent(event, IGNORE_EXCEPTION);
+ bool noDefaultProcessing = event->defaultPrevented();
if (noDefaultProcessing && policy == ClipboardWritable) {
Pasteboard* pasteboard = Pasteboard::generalPasteboard();
pasteboard->clear();
Deleted: trunk/Source/WebCore/editing/blackberry/EditorBlackBerry.cpp (150350 => 150351)
--- trunk/Source/WebCore/editing/blackberry/EditorBlackBerry.cpp 2013-05-19 14:56:07 UTC (rev 150350)
+++ trunk/Source/WebCore/editing/blackberry/EditorBlackBerry.cpp 2013-05-19 15:40:16 UTC (rev 150351)
@@ -1,32 +0,0 @@
-/*
- * Copyright (C) 2009 Torch Mobile Inc. http://www.torchmobile.com/
- * Copyright (C) 2010, 2011 Research In Motion Limited. All rights reserved.
- *
- * This library is free software; you can redistribute it and/or
- * modify it under the terms of the GNU Lesser General Public
- * License as published by the Free Software Foundation; either
- * version 2 of the License, or (at your option) any later version.
- *
- * This library is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
- * Lesser General Public License for more details.
- *
- * You should have received a copy of the GNU Lesser General Public
- * License along with this library; if not, write to the Free Software
- * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
- */
-
-#include "config.h"
-#include "Editor.h"
-
-#include "Clipboard.h"
-
-namespace WebCore {
-
-PassRefPtr<Clipboard> Editor::newGeneralClipboard(ClipboardAccessPolicy policy, Frame*)
-{
- return Clipboard::createForCopyAndPaste(policy);
-}
-
-} // namespace WebCore
Modified: trunk/Source/WebCore/editing/mac/EditorMac.mm (150350 => 150351)
--- trunk/Source/WebCore/editing/mac/EditorMac.mm 2013-05-19 14:56:07 UTC (rev 150350)
+++ trunk/Source/WebCore/editing/mac/EditorMac.mm 2013-05-19 15:40:16 UTC (rev 150351)
@@ -57,11 +57,6 @@
using namespace HTMLNames;
-PassRefPtr<Clipboard> Editor::newGeneralClipboard(ClipboardAccessPolicy policy, Frame*)
-{
- return Clipboard::createForCopyAndPaste(policy);
-}
-
void Editor::showFontPanel()
{
[[NSFontManager sharedFontManager] orderFrontFontPanel:nil];
Modified: trunk/Source/WebCore/platform/efl/ClipboardEfl.cpp (150350 => 150351)
--- trunk/Source/WebCore/platform/efl/ClipboardEfl.cpp 2013-05-19 14:56:07 UTC (rev 150350)
+++ trunk/Source/WebCore/platform/efl/ClipboardEfl.cpp 2013-05-19 15:40:16 UTC (rev 150351)
@@ -27,11 +27,6 @@
namespace WebCore {
-PassRefPtr<Clipboard> Editor::newGeneralClipboard(ClipboardAccessPolicy policy, Frame*)
-{
- return Clipboard::createForCopyAndPaste(policy);
-}
-
DragImageRef Clipboard::createDragImage(IntPoint&) const
{
notImplemented();
Modified: trunk/Source/WebCore/platform/gtk/ClipboardGtk.cpp (150350 => 150351)
--- trunk/Source/WebCore/platform/gtk/ClipboardGtk.cpp 2013-05-19 14:56:07 UTC (rev 150350)
+++ trunk/Source/WebCore/platform/gtk/ClipboardGtk.cpp 2013-05-19 15:40:16 UTC (rev 150351)
@@ -26,12 +26,6 @@
namespace WebCore {
-// FIXME: this should be moved to editing/gtk/EditorGtk.cpp.
-PassRefPtr<Clipboard> Editor::newGeneralClipboard(ClipboardAccessPolicy policy, Frame* frame)
-{
- return Clipboard::createForCopyAndPaste(policy);
-}
-
DragImageRef Clipboard::createDragImage(IntPoint& location) const
{
location = m_dragLoc;