[Mac] Move clearAllData from ClipboardMac to PasteboardMac
authordarin@apple.com <darin@apple.com@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Mon, 13 May 2013 03:51:12 +0000 (03:51 +0000)
committerdarin@apple.com <darin@apple.com@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Mon, 13 May 2013 03:51:12 +0000 (03:51 +0000)
https://bugs.webkit.org/show_bug.cgi?id=116001

Reviewed by Andreas Kling.

* dom/Clipboard.cpp:
(WebCore::Clipboard::clearAllData): Added. Calls through to Pasteboard after
doing the canWriteData check, which is part of DOM rules, not the platform.

* dom/Clipboard.h: Made clearAllData non-virtual in non-legacy case.

* platform/mac/ClipboardMac.h: Removed clearAllData.
* platform/mac/ClipboardMac.mm: Ditto.

git-svn-id: https://svn.webkit.org/repository/webkit/trunk@149979 268f45cc-cd09-0410-ab3c-d52691b4dbfc

Source/WebCore/ChangeLog
Source/WebCore/dom/Clipboard.cpp
Source/WebCore/dom/Clipboard.h
Source/WebCore/platform/mac/ClipboardMac.h
Source/WebCore/platform/mac/ClipboardMac.mm

index 7a89fe1..1eb1cec 100644 (file)
@@ -1,5 +1,21 @@
 2013-05-12  Darin Adler  <darin@apple.com>
 
+        [Mac] Move clearAllData from ClipboardMac to PasteboardMac
+        https://bugs.webkit.org/show_bug.cgi?id=116001
+
+        Reviewed by Andreas Kling.
+
+        * dom/Clipboard.cpp:
+        (WebCore::Clipboard::clearAllData): Added. Calls through to Pasteboard after
+        doing the canWriteData check, which is part of DOM rules, not the platform.
+
+        * dom/Clipboard.h: Made clearAllData non-virtual in non-legacy case.
+
+        * platform/mac/ClipboardMac.h: Removed clearAllData.
+        * platform/mac/ClipboardMac.mm: Ditto.
+
+2013-05-12  Darin Adler  <darin@apple.com>
+
         [Mac] Move clearData from ClipboardMac to PasteboardMac
         https://bugs.webkit.org/show_bug.cgi?id=116000
 
index 83d08b5..046402d 100644 (file)
@@ -266,6 +266,14 @@ void Clipboard::clearData(const String& type)
     m_pasteboard->clear(type);
 }
 
+void Clipboard::clearAllData()
+{
+    if (!canWriteData())
+        return;
+
+    m_pasteboard->clear();
+}
+
 #endif
 
 } // namespace WebCore
index f25dc3f..0cf60c5 100644 (file)
@@ -80,7 +80,7 @@ namespace WebCore {
         void setEffectAllowed(const String&);
     
         LEGACY_VIRTUAL void clearData(const String& type) LEGACY_PURE;
-        virtual void clearAllData() = 0;
+        LEGACY_VIRTUAL void clearAllData() LEGACY_PURE;
         virtual String getData(const String& type) const = 0;
         virtual bool setData(const String& type, const String& data) = 0;
     
index 15a2e83..33366a2 100644 (file)
@@ -53,7 +53,6 @@ public:
 
     virtual ~ClipboardMac();
     
-    void clearAllData();
     String getData(const String& type) const;
     bool setData(const String& type, const String& data);
     
index f8e111d..fda0d21 100644 (file)
@@ -113,17 +113,6 @@ static void addHTMLClipboardTypesForCocoaType(ListHashSet<String>& resultTypes,
     resultTypes.add(cocoaType);
 }
 
-void ClipboardMac::clearAllData()
-{
-    if (!canWriteData())
-        return;
-
-    // note NSPasteboard enforces changeCount itself on writing - can't write if not the owner
-
-    Pasteboard pasteboard(m_pasteboardName);
-    pasteboard.clear();
-}
-
 static Vector<String> absoluteURLsFromPasteboardFilenames(const String& pasteboardName, bool onlyFirstURL = false)
 {
     Vector<String> fileList;