Title: [150176] trunk/Source/WebCore
Revision
150176
Author
[email protected]
Date
2013-05-15 21:37:28 -0700 (Wed, 15 May 2013)

Log Message

Move drag-specific Clipboard functions inside ENABLE(DRAG_SUPPORT)
https://bugs.webkit.org/show_bug.cgi?id=116176

Reviewed by Andreas Kling.

* dom/Clipboard.cpp:
(WebCore::Clipboard::writeRange):
(WebCore::Clipboard::writePlainText):
(WebCore::Clipboard::writeURL):
Move these three functions inside ENABLE(DRAG_SUPPORT). Even though their names do
not make it obvious, these are here only for use by dragging code. Later we may
refactor them away entirely, but for now it's good not to compile them in on any
platform that does not support dragging.

Modified Paths

Diff

Modified: trunk/Source/WebCore/ChangeLog (150175 => 150176)


--- trunk/Source/WebCore/ChangeLog	2013-05-16 04:34:51 UTC (rev 150175)
+++ trunk/Source/WebCore/ChangeLog	2013-05-16 04:37:28 UTC (rev 150176)
@@ -1,3 +1,19 @@
+2013-05-15  Darin Adler  <[email protected]>
+
+        Move drag-specific Clipboard functions inside ENABLE(DRAG_SUPPORT)
+        https://bugs.webkit.org/show_bug.cgi?id=116176
+
+        Reviewed by Andreas Kling.
+
+        * dom/Clipboard.cpp:
+        (WebCore::Clipboard::writeRange):
+        (WebCore::Clipboard::writePlainText):
+        (WebCore::Clipboard::writeURL):
+        Move these three functions inside ENABLE(DRAG_SUPPORT). Even though their names do
+        not make it obvious, these are here only for use by dragging code. Later we may
+        refactor them away entirely, but for now it's good not to compile them in on any
+        platform that does not support dragging.
+
 2013-05-15  Andy Estes  <[email protected]>
 
         Resources from non-HTTP schemes should not be cached indefinitely

Modified: trunk/Source/WebCore/dom/Clipboard.cpp (150175 => 150176)


--- trunk/Source/WebCore/dom/Clipboard.cpp	2013-05-16 04:34:51 UTC (rev 150175)
+++ trunk/Source/WebCore/dom/Clipboard.cpp	2013-05-16 04:37:28 UTC (rev 150176)
@@ -338,29 +338,6 @@
     return fileList.release();
 }
 
-void Clipboard::writeRange(Range* range, Frame* frame)
-{
-    ASSERT(range);
-    ASSERT(frame);
-    // FIXME: This is a design mistake, a layering violation that should be fixed.
-    // The code to write the range to a pasteboard should be an Editor function that takes a pasteboard argument.
-    // FIXME: The frame argument seems redundant, since a Range is in a particular document, which has a corresponding frame.
-    m_pasteboard->writeSelection(range, frame->editor().smartInsertDeleteEnabled() && frame->selection()->granularity() == WordGranularity, frame, IncludeImageAltTextForClipboard);
-}
-
-void Clipboard::writePlainText(const String& text)
-{
-    m_pasteboard->writePlainText(text, Pasteboard::CannotSmartReplace);
-}
-
-void Clipboard::writeURL(const KURL& url, const String& title, Frame* frame)
-{
-    ASSERT(frame);
-    // FIXME: This is a design mistake, a layering violation that should be fixed.
-    // The pasteboard writeURL function should not take a frame argument, nor does this function need a frame.
-    m_pasteboard->writeURL(url, title, frame);
-}
-
 #if !ENABLE(DRAG_SUPPORT)
 
 void Clipboard::setDragImage(CachedImage*, const IntPoint&)
@@ -452,8 +429,31 @@
     m_clipboard->updateDragImage();
 }
 
-#endif
+void Clipboard::writeRange(Range* range, Frame* frame)
+{
+    ASSERT(range);
+    ASSERT(frame);
+    // FIXME: This is a design mistake, a layering violation that should be fixed.
+    // The code to write the range to a pasteboard should be an Editor function that takes a pasteboard argument.
+    // FIXME: The frame argument seems redundant, since a Range is in a particular document, which has a corresponding frame.
+    m_pasteboard->writeSelection(range, frame->editor().smartInsertDeleteEnabled() && frame->selection()->granularity() == WordGranularity, frame, IncludeImageAltTextForClipboard);
+}
 
-#endif
+void Clipboard::writePlainText(const String& text)
+{
+    m_pasteboard->writePlainText(text, Pasteboard::CannotSmartReplace);
+}
 
+void Clipboard::writeURL(const KURL& url, const String& title, Frame* frame)
+{
+    ASSERT(frame);
+    // FIXME: This is a design mistake, a layering violation that should be fixed.
+    // The pasteboard writeURL function should not take a frame argument, nor does this function need a frame.
+    m_pasteboard->writeURL(url, title, frame);
+}
+
+#endif // ENABLE(DRAG_SUPPORT)
+
+#endif // !USE(LEGACY_STYLE_ABSTRACT_CLIPBOARD_CLASS)
+
 } // namespace WebCore
_______________________________________________
webkit-changes mailing list
[email protected]
https://lists.webkit.org/mailman/listinfo/webkit-changes

Reply via email to