Title: [154230] trunk/Source/WebCore
Revision
154230
Author
[email protected]
Date
2013-08-17 08:21:00 -0700 (Sat, 17 Aug 2013)

Log Message

<https://webkit.org/b/119947> Remove LEGACY_STYLE_ABSTRACT_CLIPBOARD_CLASS

Reviewed by Andreas Kling.

* dom/Clipboard.cpp:
(WebCore::Clipboard::Clipboard):
(WebCore::Clipboard::~Clipboard):
* dom/Clipboard.h:
Remove LEGACY_STYLE_ABSTRACT_CLIPBOARD_CLASS, LEGACY_VIRTUAL, and LEGACY_PURE.
Keep only the !USE(LEGACY_STYLE_ABSTRACT_CLIPBOARD_CLASS) side of all conditionals.

Modified Paths

Diff

Modified: trunk/Source/WebCore/ChangeLog (154229 => 154230)


--- trunk/Source/WebCore/ChangeLog	2013-08-17 14:56:48 UTC (rev 154229)
+++ trunk/Source/WebCore/ChangeLog	2013-08-17 15:21:00 UTC (rev 154230)
@@ -1,5 +1,18 @@
 2013-08-17  Darin Adler  <[email protected]>
 
+        <https://webkit.org/b/119947> Remove LEGACY_STYLE_ABSTRACT_CLIPBOARD_CLASS
+
+        Reviewed by Andreas Kling.
+
+        * dom/Clipboard.cpp:
+        (WebCore::Clipboard::Clipboard):
+        (WebCore::Clipboard::~Clipboard):
+        * dom/Clipboard.h:
+        Remove LEGACY_STYLE_ABSTRACT_CLIPBOARD_CLASS, LEGACY_VIRTUAL, and LEGACY_PURE.
+        Keep only the !USE(LEGACY_STYLE_ABSTRACT_CLIPBOARD_CLASS) side of all conditionals.
+
+2013-08-17  Darin Adler  <[email protected]>
+
         <https://webkit.org/b/119946> Move some code used only by EventHandler from Clipboard to EventHandler
 
         Reviewed by Andreas Kling.

Modified: trunk/Source/WebCore/dom/Clipboard.cpp (154229 => 154230)


--- trunk/Source/WebCore/dom/Clipboard.cpp	2013-08-17 14:56:48 UTC (rev 154229)
+++ trunk/Source/WebCore/dom/Clipboard.cpp	2013-08-17 15:21:00 UTC (rev 154230)
@@ -56,26 +56,20 @@
 
 #endif
 
-Clipboard::Clipboard(ClipboardAccessPolicy policy, ClipboardType clipboardType
-#if !USE(LEGACY_STYLE_ABSTRACT_CLIPBOARD_CLASS)
-    , PassOwnPtr<Pasteboard> pasteboard, bool forFileDrag
-#endif
-)
+Clipboard::Clipboard(ClipboardAccessPolicy policy, ClipboardType clipboardType, PassOwnPtr<Pasteboard> pasteboard, bool forFileDrag)
     : m_policy(policy)
     , m_dropEffect("uninitialized")
     , m_effectAllowed("uninitialized")
     , m_dragStarted(false)
     , m_clipboardType(clipboardType)
-#if !USE(LEGACY_STYLE_ABSTRACT_CLIPBOARD_CLASS)
     , m_pasteboard(pasteboard)
     , m_forFileDrag(forFileDrag)
-#endif
 {
 }
 
 Clipboard::~Clipboard()
 {
-#if !USE(LEGACY_STYLE_ABSTRACT_CLIPBOARD_CLASS) && ENABLE(DRAG_SUPPORT)
+#if ENABLE(DRAG_SUPPORT)
     if (m_dragImageLoader && m_dragImage)
         m_dragImageLoader->stopLoading(m_dragImage);
 #endif
@@ -218,21 +212,6 @@
         m_effectAllowed = effect;
 }
     
-#if USE(LEGACY_STYLE_ABSTRACT_CLIPBOARD_CLASS)
-
-void Clipboard::setDragImage(Element* element, int x, int y)
-{
-    if (!canSetDragImage())
-        return;
-
-    if (element && isHTMLImageElement(element) && !element->inDocument())
-        setDragImage(toHTMLImageElement(element)->cachedImage(), IntPoint(x, y));
-    else
-        setDragImageElement(element, IntPoint(x, y));
-}
-
-#else // !USE(LEGACY_STYLE_ABSTRACT_CLIPBOARD_CLASS)
-
 PassRefPtr<Clipboard> Clipboard::createForCopyAndPaste(ClipboardAccessPolicy policy)
 {
     return adoptRef(new Clipboard(policy, CopyAndPaste, policy == ClipboardWritable ? Pasteboard::createPrivate() : Pasteboard::createForCopyAndPaste()));
@@ -412,6 +391,4 @@
 
 #endif // ENABLE(DRAG_SUPPORT)
 
-#endif // !USE(LEGACY_STYLE_ABSTRACT_CLIPBOARD_CLASS)
-
 } // namespace WebCore

Modified: trunk/Source/WebCore/dom/Clipboard.h (154229 => 154230)


--- trunk/Source/WebCore/dom/Clipboard.h	2013-08-17 14:56:48 UTC (rev 154229)
+++ trunk/Source/WebCore/dom/Clipboard.h	2013-08-17 15:21:00 UTC (rev 154230)
@@ -31,23 +31,6 @@
 #include "IntPoint.h"
 #include "Node.h"
 
-// This DOM object now works by calling through to classes in the platform layer.
-// Specifically, the class currently named Pasteboard. The legacy style instead
-// uses this as an abstract base class.
-#define WTF_USE_LEGACY_STYLE_ABSTRACT_CLIPBOARD_CLASS 0
-
-#if USE(LEGACY_STYLE_ABSTRACT_CLIPBOARD_CLASS)
-#define LEGACY_VIRTUAL virtual
-#else
-#define LEGACY_VIRTUAL
-#endif
-
-#if USE(LEGACY_STYLE_ABSTRACT_CLIPBOARD_CLASS)
-#define LEGACY_PURE = 0
-#else
-#define LEGACY_PURE
-#endif
-
 namespace WebCore {
 
     class CachedImage;
@@ -70,7 +53,7 @@
         
         static PassRefPtr<Clipboard> create(ClipboardAccessPolicy, DragData*, Frame*);
 
-        LEGACY_VIRTUAL ~Clipboard();
+        ~Clipboard();
 
         bool isForCopyAndPaste() const { return m_clipboardType == CopyAndPaste; }
         bool isForDragAndDrop() const { return m_clipboardType == DragAndDrop; }
@@ -81,30 +64,26 @@
         String effectAllowed() const { return m_effectAllowed; }
         void setEffectAllowed(const String&);
     
-        LEGACY_VIRTUAL void clearData(const String& type) LEGACY_PURE;
-        LEGACY_VIRTUAL void clearData() LEGACY_PURE;
+        void clearData(const String& type);
+        void clearData();
 
         void setDragImage(Element*, int x, int y);
-#if USE(LEGACY_STYLE_ABSTRACT_CLIPBOARD_CLASS)
-        virtual void setDragImage(CachedImage*, const IntPoint&) = 0;
-        virtual void setDragImageElement(Node*, const IntPoint&) = 0;
-#endif
 
-        LEGACY_VIRTUAL String getData(const String& type) const LEGACY_PURE;
-        LEGACY_VIRTUAL bool setData(const String& type, const String& data) LEGACY_PURE;
+        String getData(const String& type) const;
+        bool setData(const String& type, const String& data);
     
-        LEGACY_VIRTUAL ListHashSet<String> types() const LEGACY_PURE;
-        LEGACY_VIRTUAL PassRefPtr<FileList> files() const LEGACY_PURE;
+        ListHashSet<String> types() const;
+        PassRefPtr<FileList> files() const;
 
         CachedImage* dragImage() const { return m_dragImage.get(); }
         Node* dragImageElement() const { return m_dragImageElement.get(); }
         
-        LEGACY_VIRTUAL DragImageRef createDragImage(IntPoint& dragLocation) const LEGACY_PURE;
-        LEGACY_VIRTUAL void writeURL(const KURL&, const String&, Frame*) LEGACY_PURE;
-        LEGACY_VIRTUAL void writeRange(Range*, Frame*) LEGACY_PURE;
-        LEGACY_VIRTUAL void writePlainText(const String&) LEGACY_PURE;
+        DragImageRef createDragImage(IntPoint& dragLocation) const;
+        void writeURL(const KURL&, const String&, Frame*);
+        void writeRange(Range*, Frame*);
+        void writePlainText(const String&);
 
-        LEGACY_VIRTUAL bool hasData() LEGACY_PURE;
+        bool hasData();
 
         void setAccessPolicy(ClipboardAccessPolicy);
         bool canReadTypes() const;
@@ -124,27 +103,21 @@
         void setDragHasStarted() { m_dragStarted = true; }
 
 #if ENABLE(DATA_TRANSFER_ITEMS)
-        LEGACY_VIRTUAL PassRefPtr<DataTransferItemList> items() = 0;
+        PassRefPtr<DataTransferItemList> items() = 0;
 #endif
         
-#if !USE(LEGACY_STYLE_ABSTRACT_CLIPBOARD_CLASS)
         static PassRefPtr<Clipboard> createForCopyAndPaste(ClipboardAccessPolicy);
 
         Pasteboard& pasteboard() { return *m_pasteboard; }
-#endif
 
-#if !USE(LEGACY_STYLE_ABSTRACT_CLIPBOARD_CLASS) && ENABLE(DRAG_SUPPORT)
+#if ENABLE(DRAG_SUPPORT)
         static PassRefPtr<Clipboard> createForDragAndDrop();
 
         void updateDragImage();
 #endif
 
     protected:
-#if !USE(LEGACY_STYLE_ABSTRACT_CLIPBOARD_CLASS)
         Clipboard(ClipboardAccessPolicy, ClipboardType, PassOwnPtr<Pasteboard>, bool forFileDrag = false);
-#else
-        Clipboard(ClipboardAccessPolicy, ClipboardType);
-#endif
 
         bool dragStarted() const { return m_dragStarted; }
         
@@ -161,19 +134,14 @@
         CachedResourceHandle<CachedImage> m_dragImage;
         RefPtr<Node> m_dragImageElement;
 
-#if !USE(LEGACY_STYLE_ABSTRACT_CLIPBOARD_CLASS)
     private:
         OwnPtr<Pasteboard> m_pasteboard;
         bool m_forFileDrag;
 #if ENABLE(DRAG_SUPPORT)
         OwnPtr<DragImageLoader> m_dragImageLoader;
 #endif
-#endif
     };
 
-#undef LEGACY_VIRTUAL
-#undef LEGACY_PURE
-
 } // namespace WebCore
 
 #endif // Clipboard_h
_______________________________________________
webkit-changes mailing list
[email protected]
https://lists.webkit.org/mailman/listinfo/webkit-changes

Reply via email to