Diff
Modified: trunk/Source/WebCore/ChangeLog (154261 => 154262)
--- trunk/Source/WebCore/ChangeLog 2013-08-19 04:46:41 UTC (rev 154261)
+++ trunk/Source/WebCore/ChangeLog 2013-08-19 05:25:07 UTC (rev 154262)
@@ -1,3 +1,32 @@
+2013-08-18 Darin Adler <[email protected]>
+
+ <https://webkit.org/b/119993> Remove most remaining platform-specific code from Clipboard class
+
+ Reviewed by Sam Weinig.
+
+ * GNUmakefile.list.am: Removed ClipboardGtk.cpp.
+ * PlatformEfl.cmake: Removed ClipboardEfl.cpp.
+ * PlatformGTK.cmake: Removed ClipboardGtk.cpp.
+ * PlatformWinCE.cmake: Removed ClipboardWin.cpp.
+ * Target.pri: Removed ClipboardQt.cpp.
+ * WebCore.vcxproj/WebCore.vcxproj: Removed ClipboardWin.cpp and ClipboardWin.h.
+ * WebCore.vcxproj/WebCore.vcxproj.filters: Removed ClipboardWin.cpp and ClipboardWin.h.
+
+ * dom/Clipboard.cpp:
+ (WebCore::Clipboard::createDragImage): Added. Version that works for all platforms
+ other than Mac, identical to the old one used in GTK and Qt, and close to the one used
+ on Windows.
+
+ * platform/mac/ClipboardMac.mm: Trimmed includes down, and added a FIXME about next steps.
+
+ * platform/qt/DataTransferItemListQt.h: Removed "friend class ClipboardQt", which refers
+ to a now-nonexistent class.
+
+ * platform/efl/ClipboardEfl.cpp: Removed.
+ * platform/gtk/ClipboardGtk.cpp: Removed.
+ * platform/qt/ClipboardQt.cpp: Removed.
+ * platform/win/ClipboardWin.cpp: Removed.
+
2013-08-17 Darin Adler <[email protected]>
<https://webkit.org/b/119949> Factor Clipboard into drag and non-drag parts
Modified: trunk/Source/WebCore/GNUmakefile.list.am (154261 => 154262)
--- trunk/Source/WebCore/GNUmakefile.list.am 2013-08-19 04:46:41 UTC (rev 154261)
+++ trunk/Source/WebCore/GNUmakefile.list.am 2013-08-19 05:25:07 UTC (rev 154262)
@@ -6149,7 +6149,6 @@
Source/WebCore/platform/graphics/gtk/ImageBufferGtk.cpp \
Source/WebCore/platform/gtk/AsyncFileSystemGtk.cpp \
Source/WebCore/platform/gtk/AsyncFileSystemGtk.h \
- Source/WebCore/platform/gtk/ClipboardGtk.cpp \
Source/WebCore/platform/gtk/ClipboardUtilitiesGtk.cpp \
Source/WebCore/platform/gtk/ClipboardUtilitiesGtk.h \
Source/WebCore/platform/gtk/DataObjectGtk.cpp \
Modified: trunk/Source/WebCore/PlatformEfl.cmake (154261 => 154262)
--- trunk/Source/WebCore/PlatformEfl.cmake 2013-08-19 04:46:41 UTC (rev 154261)
+++ trunk/Source/WebCore/PlatformEfl.cmake 2013-08-19 05:25:07 UTC (rev 154262)
@@ -55,7 +55,6 @@
platform/efl/AsyncFileSystemEfl.cpp
platform/efl/BatteryProviderEfl.cpp
- platform/efl/ClipboardEfl.cpp
platform/ContextMenuNone.cpp
platform/ContextMenuItemNone.cpp
platform/efl/CursorEfl.cpp
Modified: trunk/Source/WebCore/PlatformGTK.cmake (154261 => 154262)
--- trunk/Source/WebCore/PlatformGTK.cmake 2013-08-19 04:46:41 UTC (rev 154261)
+++ trunk/Source/WebCore/PlatformGTK.cmake 2013-08-19 05:25:07 UTC (rev 154262)
@@ -59,7 +59,6 @@
platform/audio/gstreamer/WebKitWebAudioSourceGStreamer.cpp
platform/gtk/AsyncFileSystemGtk.cpp
- platform/gtk/ClipboardGtk.cpp
platform/gtk/ClipboardUtilitiesGtk.cpp
platform/gtk/ContextMenuGtk.cpp
platform/gtk/ContextMenuItemGtk.cpp
Modified: trunk/Source/WebCore/PlatformWinCE.cmake (154261 => 154262)
--- trunk/Source/WebCore/PlatformWinCE.cmake 2013-08-19 04:46:41 UTC (rev 154261)
+++ trunk/Source/WebCore/PlatformWinCE.cmake 2013-08-19 05:25:07 UTC (rev 154262)
@@ -36,7 +36,6 @@
platform/win/BitmapInfo.cpp
platform/win/ClipboardUtilitiesWin.cpp
- platform/win/ClipboardWin.cpp
platform/win/ContextMenuItemWin.cpp
platform/win/ContextMenuWin.cpp
platform/win/CursorWin.cpp
Modified: trunk/Source/WebCore/Target.pri (154261 => 154262)
--- trunk/Source/WebCore/Target.pri 2013-08-19 04:46:41 UTC (rev 154261)
+++ trunk/Source/WebCore/Target.pri 2013-08-19 05:25:07 UTC (rev 154262)
@@ -2908,7 +2908,6 @@
platform/Cursor.cpp \
platform/ContextMenu.cpp \
platform/ContextMenuItem.cpp \
- platform/qt/ClipboardQt.cpp \
platform/ContextMenuItemNone.cpp \
platform/ContextMenuNone.cpp \
platform/qt/CursorQt.cpp \
Modified: trunk/Source/WebCore/WebCore.vcxproj/WebCore.vcxproj (154261 => 154262)
--- trunk/Source/WebCore/WebCore.vcxproj/WebCore.vcxproj 2013-08-19 04:46:41 UTC (rev 154261)
+++ trunk/Source/WebCore/WebCore.vcxproj/WebCore.vcxproj 2013-08-19 05:25:07 UTC (rev 154262)
@@ -7440,7 +7440,6 @@
<ClCompile Include="..\platform\win\BitmapInfo.cpp" />
<ClCompile Include="..\platform\win\BString.cpp" />
<ClCompile Include="..\platform\win\ClipboardUtilitiesWin.cpp" />
- <ClCompile Include="..\platform\win\ClipboardWin.cpp" />
<ClCompile Include="..\platform\win\ContextMenuItemWin.cpp" />
<ClCompile Include="..\platform\win\ContextMenuWin.cpp" />
<ClCompile Include="..\platform\win\CursorWin.cpp" />
@@ -19293,7 +19292,6 @@
<ClInclude Include="..\platform\win\BitmapInfo.h" />
<ClInclude Include="..\platform\win\BString.h" />
<ClInclude Include="..\platform\win\ClipboardUtilitiesWin.h" />
- <ClInclude Include="..\platform\win\ClipboardWin.h" />
<ClInclude Include="..\platform\win\COMPtr.h" />
<ClInclude Include="..\platform\win\DefWndProcWindowClass.h" />
<ClInclude Include="..\platform\win\DelayLoadedModulesEnumerator.h" />
Modified: trunk/Source/WebCore/WebCore.vcxproj/WebCore.vcxproj.filters (154261 => 154262)
--- trunk/Source/WebCore/WebCore.vcxproj/WebCore.vcxproj.filters 2013-08-19 04:46:41 UTC (rev 154261)
+++ trunk/Source/WebCore/WebCore.vcxproj/WebCore.vcxproj.filters 2013-08-19 05:25:07 UTC (rev 154262)
@@ -1227,9 +1227,6 @@
<ClCompile Include="..\platform\win\ClipboardUtilitiesWin.cpp">
<Filter>platform\win</Filter>
</ClCompile>
- <ClCompile Include="..\platform\win\ClipboardWin.cpp">
- <Filter>platform\win</Filter>
- </ClCompile>
<ClCompile Include="..\platform\win\ContextMenuItemWin.cpp">
<Filter>platform\win</Filter>
</ClCompile>
@@ -8311,9 +8308,6 @@
<ClInclude Include="..\platform\win\ClipboardUtilitiesWin.h">
<Filter>platform\win</Filter>
</ClInclude>
- <ClInclude Include="..\platform\win\ClipboardWin.h">
- <Filter>platform\win</Filter>
- </ClInclude>
<ClInclude Include="..\platform\win\COMPtr.h">
<Filter>platform\win</Filter>
</ClInclude>
Modified: trunk/Source/WebCore/dom/Clipboard.cpp (154261 => 154262)
--- trunk/Source/WebCore/dom/Clipboard.cpp 2013-08-19 04:46:41 UTC (rev 154261)
+++ trunk/Source/WebCore/dom/Clipboard.cpp 2013-08-19 05:25:07 UTC (rev 154262)
@@ -271,6 +271,25 @@
m_pasteboard->setDragImage(computedImage, computedHotSpot);
}
+#if !PLATFORM(MAC)
+
+DragImageRef Clipboard::createDragImage(IntPoint& location) const
+{
+ location = m_dragLocation;
+
+ if (m_dragImage)
+ return createDragImageFromImage(m_dragImage->image(), ImageOrientationDescription());
+
+ if (m_dragImageElement) {
+ if (Frame* frame = m_dragImageElement->document()->frame())
+ return frame->nodeImage(m_dragImageElement.get());
+ }
+
+ return 0; // We do not have enough information to create a drag image, use the default icon.
+}
+
+#endif
+
PassOwnPtr<DragImageLoader> DragImageLoader::create(Clipboard* clipboard)
{
return adoptPtr(new DragImageLoader(clipboard));
Deleted: trunk/Source/WebCore/platform/efl/ClipboardEfl.cpp (154261 => 154262)
--- trunk/Source/WebCore/platform/efl/ClipboardEfl.cpp 2013-08-19 04:46:41 UTC (rev 154261)
+++ trunk/Source/WebCore/platform/efl/ClipboardEfl.cpp 2013-08-19 05:25:07 UTC (rev 154262)
@@ -1,44 +0,0 @@
-/*
- * Copyright (C) 2008 INdT - Instituto Nokia de Tecnologia
- * Copyright (C) 2009-2010 ProFUSION embedded systems
- * Copyright (C) 2009-2010 Samsung Electronics
- *
- * 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 "Clipboard.h"
-
-#include "DataTransferItemList.h"
-#include "Editor.h"
-#include "NotImplemented.h"
-
-namespace WebCore {
-
-DragImageRef Clipboard::createDragImage(IntPoint&) const
-{
- notImplemented();
- return 0;
-}
-
-#if ENABLE(DATA_TRANSFER_ITEMS)
-PassRefPtr<DataTransferItemList> Clipboard::items()
-{
- notImplemented();
- return 0;
-}
-#endif
-
-}
Deleted: trunk/Source/WebCore/platform/gtk/ClipboardGtk.cpp (154261 => 154262)
--- trunk/Source/WebCore/platform/gtk/ClipboardGtk.cpp 2013-08-19 04:46:41 UTC (rev 154261)
+++ trunk/Source/WebCore/platform/gtk/ClipboardGtk.cpp 2013-08-19 05:25:07 UTC (rev 154262)
@@ -1,45 +0,0 @@
-/*
- * 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 "Clipboard.h"
-
-#include "CachedImage.h"
-#include "Document.h"
-#include "Editor.h"
-#include "Element.h"
-#include "Frame.h"
-#include "Pasteboard.h"
-
-namespace WebCore {
-
-DragImageRef Clipboard::createDragImage(IntPoint& location) const
-{
- location = m_dragLocation;
-
- if (m_dragImage)
- return createDragImageFromImage(m_dragImage->image(), ImageOrientationDescription());
-
- if (m_dragImageElement) {
- Document* document = m_dragImageElement->document();
- if (Frame* frame = document->frame())
- return frame->nodeImage(m_dragImageElement.get());
- }
-
- return 0; // We do not have enough information to create a drag image, use the default icon.
-}
-
-}
Modified: trunk/Source/WebCore/platform/mac/ClipboardMac.mm (154261 => 154262)
--- trunk/Source/WebCore/platform/mac/ClipboardMac.mm 2013-08-19 04:46:41 UTC (rev 154261)
+++ trunk/Source/WebCore/platform/mac/ClipboardMac.mm 2013-08-19 05:25:07 UTC (rev 154262)
@@ -27,21 +27,14 @@
#import "Clipboard.h"
#import "CachedImage.h"
-#import "DOMElementInternal.h"
-#import "Document.h"
-#import "DragClient.h"
-#import "DragController.h"
-#import "DragData.h"
#import "Element.h"
-#import "Frame.h"
#import "FrameSnapshottingMac.h"
-#import "Page.h"
-#import "Pasteboard.h"
-#import "PasteboardStrategy.h"
-#import "PlatformStrategies.h"
namespace WebCore {
-
+
+// FIXME: Need to refactor and figure out how to handle the flipping in a more sensible way so we can
+// use the default Clipboard::dragImage from Clipboard.cpp. Note also that this handles cases that
+// Clipboard::dragImage in Clipboard.cpp does not handle correctly, so must resolve that as well.
DragImageRef Clipboard::createDragImage(IntPoint& location) const
{
NSImage *result = nil;
Deleted: trunk/Source/WebCore/platform/qt/ClipboardQt.cpp (154261 => 154262)
--- trunk/Source/WebCore/platform/qt/ClipboardQt.cpp 2013-08-19 04:46:41 UTC (rev 154261)
+++ trunk/Source/WebCore/platform/qt/ClipboardQt.cpp 2013-08-19 05:25:07 UTC (rev 154262)
@@ -1,59 +0,0 @@
-/*
- * Copyright (C) 2007 Apple Inc. All rights reserved.
- * Copyright (C) 2006, 2007 Apple Inc. All rights reserved.
- * Copyright (C) 2008 Nokia Corporation and/or its subsidiary(-ies)
- * Copyright (C) 2010 Sencha, Inc. All rights reserved.
- * Copyright (C) 2013 Cisco Systems, 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.
- */
-
-#include "config.h"
-#include "Clipboard.h"
-
-#include "CachedImage.h"
-#include "Document.h"
-#include "Editor.h"
-#include "Element.h"
-#include "Frame.h"
-#include "Image.h"
-#include "Pasteboard.h"
-
-namespace WebCore {
-
-DragImageRef Clipboard::createDragImage(IntPoint& location) const
-{
- location = m_dragLocation;
-
- if (m_dragImage)
- return createDragImageFromImage(m_dragImage->image(), ImageOrientationDescription());
-
- if (m_dragImageElement) {
- Document* document = m_dragImageElement->document();
- if (Frame* frame = document->frame())
- return frame->nodeImage(m_dragImageElement.get());
- }
-
- return 0; // We do not have enough information to create a drag image, use the default icon.
-}
-
-}
Modified: trunk/Source/WebCore/platform/qt/DataTransferItemListQt.h (154261 => 154262)
--- trunk/Source/WebCore/platform/qt/DataTransferItemListQt.h 2013-08-19 04:46:41 UTC (rev 154261)
+++ trunk/Source/WebCore/platform/qt/DataTransferItemListQt.h 2013-08-19 05:25:07 UTC (rev 154262)
@@ -50,7 +50,6 @@
virtual void add(PassRefPtr<File>);
- friend class ClipboardQt;
private:
DataTransferItemListQt(PassRefPtr<Clipboard>, ScriptExecutionContext*);
Deleted: trunk/Source/WebCore/platform/win/ClipboardWin.cpp (154261 => 154262)
--- trunk/Source/WebCore/platform/win/ClipboardWin.cpp 2013-08-19 04:46:41 UTC (rev 154261)
+++ trunk/Source/WebCore/platform/win/ClipboardWin.cpp 2013-08-19 05:25:07 UTC (rev 154262)
@@ -1,61 +0,0 @@
-/*
- * Copyright (C) 2006, 2007 Apple Inc. All rights reserved.
- * Copyright (C) 2013 Xueqing Huang <[email protected]>
- *
- * 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.
- */
-
-#include "config.h"
-#include "Clipboard.h"
-
-#include "CachedImage.h"
-#include "ClipboardUtilitiesWin.h"
-#include "Document.h"
-#include "Element.h"
-#include "Frame.h"
-#include "HTMLNames.h"
-#include "HTMLParserIdioms.h"
-#include "NotImplemented.h"
-#include "Pasteboard.h"
-#include "markup.h"
-
-namespace WebCore {
-
-DragImageRef Clipboard::createDragImage(IntPoint& dragLocation) const
-{
- HBITMAP result = 0;
- if (m_dragImage) {
-#if USE(CAIRO) || USE(CG)
- result = createDragImageFromImage(m_dragImage->image(), ImageOrientationDescription());
- dragLocation = m_dragLocation;
-#else
- notImplemented();
-#endif
- } else if (m_dragImageElement) {
- Node* node = m_dragImageElement.get();
- result = node->document()->frame()->nodeImage(node);
- dragLocation = m_dragLocation;
- }
- return result;
-}
-
-} // namespace WebCore