Changeset 150351 in webkit


Ignore:
Timestamp:
May 19, 2013 8:40:16 AM (11 years ago)
Author:
Darin Adler
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.
Location:
trunk/Source/WebCore
Files:
1 deleted
6 edited

Legend:

Unmodified
Added
Removed
  • trunk/Source/WebCore/ChangeLog

    r150350 r150351  
     12013-05-19  Darin Adler  <darin@apple.com>
     2
     3        Eliminate the Editor::newGeneralClipboard function
     4        https://bugs.webkit.org/show_bug.cgi?id=116410
     5
     6        Reviewed by Andreas Kling.
     7
     8        This is one of the clean-ups made possible by the changes to the DOM clipboard class.
     9        I had been waiting until all the platforms were moved over to it, but it turns out to be
     10        easy to do this now, just with #ifdefs.
     11
     12        * PlatformBlackBerry.cmake: Deleted EditorBlackBerry.cpp.
     13
     14        * editing/Editor.cpp:
     15        (WebCore::Editor::dispatchCPPEvent): Call Clipboard::createForCopyAndPaste directly when
     16        using the new version of the Clipboard class. Also some small style cleanup nearby.
     17
     18        * editing/blackberry/EditorBlackBerry.cpp: Removed. The only function in this file was
     19        newGeneralClipboard.
     20
     21        * editing/mac/EditorMac.mm: Deleted newGeneralClipboard.
     22        * platform/efl/ClipboardEfl.cpp: Ditto.
     23        * platform/gtk/ClipboardGtk.cpp: Ditto.
     24
    1252013-05-19  Martin Robinson  <mrobinson@igalia.com>
    226
  • trunk/Source/WebCore/PlatformBlackBerry.cmake

    r150319 r150351  
    9494# BlackBerry sources
    9595list(APPEND WebCore_SOURCES
    96     editing/blackberry/EditorBlackBerry.cpp
    9796    editing/blackberry/SmartReplaceBlackBerry.cpp
    9897    html/shadow/MediaControlsBlackBerry.cpp
  • trunk/Source/WebCore/editing/Editor.cpp

    r150140 r150351  
    698698// Returns whether caller should continue with "the default processing", which is the same as
    699699// the event handler NOT setting the return value to false
    700 bool Editor::dispatchCPPEvent(const AtomicString &eventType, ClipboardAccessPolicy policy)
     700bool Editor::dispatchCPPEvent(const AtomicString& eventType, ClipboardAccessPolicy policy)
    701701{
    702702    Node* target = findEventTargetFromSelection();
    703703    if (!target)
    704704        return true;
    705    
     705
     706#if !USE(LEGACY_STYLE_ABSTRACT_CLIPBOARD_CLASS)
     707    RefPtr<Clipboard> clipboard = Clipboard::createForCopyAndPaste(policy);
     708#else
     709    // FIXME: Remove declaration of newGeneralClipboard when removing LEGACY_STYLE_ABSTRACT_CLIPBOARD_CLASS.
    706710    RefPtr<Clipboard> clipboard = newGeneralClipboard(policy, m_frame);
    707 
    708     RefPtr<Event> evt = ClipboardEvent::create(eventType, true, true, clipboard);
    709     target->dispatchEvent(evt, IGNORE_EXCEPTION);
    710     bool noDefaultProcessing = evt->defaultPrevented();
     711#endif
     712
     713    RefPtr<Event> event = ClipboardEvent::create(eventType, true, true, clipboard);
     714    target->dispatchEvent(event, IGNORE_EXCEPTION);
     715    bool noDefaultProcessing = event->defaultPrevented();
    711716    if (noDefaultProcessing && policy == ClipboardWritable) {
    712717        Pasteboard* pasteboard = Pasteboard::generalPasteboard();
  • trunk/Source/WebCore/editing/mac/EditorMac.mm

    r150140 r150351  
    5858using namespace HTMLNames;
    5959
    60 PassRefPtr<Clipboard> Editor::newGeneralClipboard(ClipboardAccessPolicy policy, Frame*)
    61 {
    62     return Clipboard::createForCopyAndPaste(policy);
    63 }
    64 
    6560void Editor::showFontPanel()
    6661{
  • trunk/Source/WebCore/platform/efl/ClipboardEfl.cpp

    r150268 r150351  
    2828namespace WebCore {
    2929
    30 PassRefPtr<Clipboard> Editor::newGeneralClipboard(ClipboardAccessPolicy policy, Frame*)
    31 {
    32     return Clipboard::createForCopyAndPaste(policy);
    33 }
    34 
    3530DragImageRef Clipboard::createDragImage(IntPoint&) const
    3631{
  • trunk/Source/WebCore/platform/gtk/ClipboardGtk.cpp

    r150334 r150351  
    2727namespace WebCore {
    2828
    29 // FIXME: this should be moved to editing/gtk/EditorGtk.cpp.
    30 PassRefPtr<Clipboard> Editor::newGeneralClipboard(ClipboardAccessPolicy policy, Frame* frame)
    31 {
    32     return Clipboard::createForCopyAndPaste(policy);
    33 }
    34 
    3529DragImageRef Clipboard::createDragImage(IntPoint& location) const
    3630{
Note: See TracChangeset for help on using the changeset viewer.