⚠ Archived content — this site is no longer maintained.   Current WebKit documentation is at docs.webkit.org.

Changeset 239627 in webkit


Ignore:
Timestamp:
Jan 4, 2019, 11:56:51 AM (8 years ago)
Author:
Wenson Hsieh
Message:

[Cocoa] Merge WebEditCommandProxy::nameForEditAction and undoNameForEditAction into a single function
https://bugs.webkit.org/show_bug.cgi?id=193129

Reviewed by Tim Horton.

Source/WebCore:

Adds a new helper function that returns the undo/redo name for a given EditAction. No change in behavior.

  • Sources.txt:
  • WebCore.xcodeproj/project.pbxproj:
  • editing/EditAction.cpp: Copied from Source/WebKit/UIProcess/WebEditCommandProxy.cpp.

(WebCore::nameForUndoRedo):

  • editing/EditAction.h:
  • editing/Editor.cpp:

Source/WebKit:

Remove WebEditCommandProxy::nameForEditAction and use WebCore::nameForUndoRedo instead.

  • UIProcess/Cocoa/WebViewImpl.mm:

(WebKit::WebViewImpl::registerEditCommand):

  • UIProcess/WebEditCommandProxy.cpp:

(WebKit::WebEditCommandProxy::WebEditCommandProxy):
(WebKit::WebEditCommandProxy::~WebEditCommandProxy):
(WebKit::WebEditCommandProxy::nameForEditAction): Deleted.

  • UIProcess/WebEditCommandProxy.h:
  • UIProcess/WebPageProxy.cpp:

(WebKit::WebPageProxy::addEditCommand):
(WebKit::WebPageProxy::removeEditCommand):
(WebKit::WebPageProxy::isValidEditCommand): Deleted.

Bit of drive-by refactoring: remove an unused function, and make addEditCommand and removeEditCommand take
references instead of pointers, since these are assumed to be nonnull.

  • UIProcess/WebPageProxy.h:
  • UIProcess/ios/PageClientImplIOS.mm:

(WebKit::PageClientImpl::registerEditCommand):

Source/WebKitLegacy/mac:

Remove undoNameForEditAction and use WebCore::nameForUndoRedo instead.

  • WebCoreSupport/WebEditorClient.mm:

(WebEditorClient::registerUndoOrRedoStep):
(undoNameForEditAction): Deleted.

Location:
trunk/Source
Files:
14 edited
1 copied

Legend:

Unmodified
Added
Removed
  • trunk/Source/WebCore/ChangeLog

    r239625 r239627  
     12019-01-04  Wenson Hsieh  <wenson_hsieh@apple.com>
     2
     3        [Cocoa] Merge WebEditCommandProxy::nameForEditAction and undoNameForEditAction into a single function
     4        https://bugs.webkit.org/show_bug.cgi?id=193129
     5
     6        Reviewed by Tim Horton.
     7
     8        Adds a new helper function that returns the undo/redo name for a given EditAction. No change in behavior.
     9
     10        * Sources.txt:
     11        * WebCore.xcodeproj/project.pbxproj:
     12        * editing/EditAction.cpp: Copied from Source/WebKit/UIProcess/WebEditCommandProxy.cpp.
     13        (WebCore::nameForUndoRedo):
     14        * editing/EditAction.h:
     15        * editing/Editor.cpp:
     16
    1172019-01-03  Matt Rajca  <mrajca@apple.com>
    218
  • trunk/Source/WebCore/Sources.txt

    r239520 r239627  
    914914editing/DictationAlternative.cpp
    915915editing/DictationCommand.cpp
     916editing/EditAction.cpp
    916917editing/EditCommand.cpp
    917918editing/Editing.cpp
  • trunk/Source/WebCore/WebCore.xcodeproj/project.pbxproj

    r239520 r239627  
    1493614936                F48D2AA42159740D00C6752B /* ColorCocoa.mm */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.cpp.objcpp; path = ColorCocoa.mm; sourceTree = "<group>"; };
    1493714937                F49786871FF45FA500E060AB /* PasteboardItemInfo.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = PasteboardItemInfo.h; sourceTree = "<group>"; };
     14938                F49E98E421DEE6C1009AE55E /* EditAction.cpp */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.cpp.cpp; path = EditAction.cpp; sourceTree = "<group>"; };
    1493814939                F4D43D64218802E600ECECAC /* SerializedAttachmentData.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = SerializedAttachmentData.h; sourceTree = "<group>"; };
    1493914940                F4D9817D2195FBF6008230FC /* ChangeListTypeCommand.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = ChangeListTypeCommand.h; sourceTree = "<group>"; };
     
    2078120782                                CECADFC5153778FF00E37068 /* DictationCommand.h */,
    2078220783                                2D5646AF1B8F8493003C4994 /* DictionaryPopupInfo.h */,
     20784                                F49E98E421DEE6C1009AE55E /* EditAction.cpp */,
    2078320785                                93309D93099E64910056E581 /* EditAction.h */,
    2078420786                                93309D94099E64910056E581 /* EditCommand.cpp */,
  • trunk/Source/WebCore/editing/EditAction.cpp

    r239626 r239627  
    11/*
    2  * Copyright (C) 2010 Apple Inc. All rights reserved.
     2 * Copyright (C) 2019 Apple Inc. All rights reserved.
    33 *
    44 * Redistribution and use in source and binary forms, with or without
     
    2525
    2626#include "config.h"
    27 #include "WebEditCommandProxy.h"
     27#include "EditAction.h"
    2828
    29 #include "UndoOrRedo.h"
    30 #include "WebPageMessages.h"
    31 #include "WebPageProxy.h"
    32 #include "WebProcessProxy.h"
    33 #include <WebCore/LocalizedStrings.h>
    34 #include <wtf/text/WTFString.h>
     29#include "LocalizedStrings.h"
    3530
    36 namespace WebKit {
    37 using namespace WebCore;
     31namespace WebCore {
    3832
    39 WebEditCommandProxy::WebEditCommandProxy(WebUndoStepID commandID, WebCore::EditAction editAction, WebPageProxy* page)
    40     : m_commandID(commandID)
    41     , m_editAction(editAction)
    42     , m_page(page)
     33String nameForUndoRedo(EditAction editAction)
    4334{
    44     m_page->addEditCommand(this);
    45 }
    46 
    47 WebEditCommandProxy::~WebEditCommandProxy()
    48 {
    49     if (m_page)
    50         m_page->removeEditCommand(this);
    51 }
    52 
    53 void WebEditCommandProxy::unapply()
    54 {
    55     if (!m_page || !m_page->isValid())
    56         return;
    57 
    58     m_page->process().send(Messages::WebPage::UnapplyEditCommand(m_commandID), m_page->pageID(), IPC::SendOption::DispatchMessageEvenWhenWaitingForSyncReply);
    59     m_page->registerEditCommand(*this, UndoOrRedo::Redo);
    60 }
    61 
    62 void WebEditCommandProxy::reapply()
    63 {
    64     if (!m_page || !m_page->isValid())
    65         return;
    66 
    67     m_page->process().send(Messages::WebPage::ReapplyEditCommand(m_commandID), m_page->pageID(), IPC::SendOption::DispatchMessageEvenWhenWaitingForSyncReply);
    68     m_page->registerEditCommand(*this, UndoOrRedo::Undo);
    69 }
    70 
    71 String WebEditCommandProxy::nameForEditAction(EditAction editAction)
    72 {
    73     // FIXME: This is identical to code in WebKit's WebEditorClient class; would be nice to share the strings instead of having two copies.
    7435    switch (editAction) {
    7536    case EditAction::Unspecified:
     
    7738    case EditAction::InsertReplacement:
    7839    case EditAction::InsertFromDrop:
    79         return String();
     40        return { };
    8041    case EditAction::SetColor:
    8142        return WEB_UI_STRING_KEY("Set Color", "Set Color (Undo action name)", "Undo action name");
     
    181142        return WEB_UI_STRING_KEY("Insert Drawing", "Insert Drawing (Undo action name)", "Undo action name");
    182143    }
    183     return String();
     144    return { };
    184145}
    185146
    186 } // namespace WebKit
     147} // namespace WebCore
  • trunk/Source/WebCore/editing/EditAction.h

    r238475 r239627  
    2525
    2626#pragma once
     27
     28namespace WTF {
     29class String;
     30}
    2731
    2832namespace WebCore {
     
    9296};
    9397
     98WEBCORE_EXPORT WTF::String nameForUndoRedo(EditAction);
     99
    94100} // namespace WebCore
  • trunk/Source/WebCore/editing/Editor.cpp

    r239584 r239627  
    3333#include "CSSComputedStyleDeclaration.h"
    3434#include "CSSPropertyNames.h"
     35#include "CSSValueList.h"
     36#include "CSSValuePool.h"
    3537#include "CachedResourceLoader.h"
    3638#include "ChangeListTypeCommand.h"
     
    6466#include "HTMLInputElement.h"
    6567#include "HTMLNames.h"
     68#include "HTMLOListElement.h"
    6669#include "HTMLQuoteElement.h"
    6770#include "HTMLSpanElement.h"
     71#include "HTMLUListElement.h"
    6872#include "HitTestResult.h"
    6973#include "IndentOutdentCommand.h"
  • trunk/Source/WebKit/ChangeLog

    r239625 r239627  
     12019-01-04  Wenson Hsieh  <wenson_hsieh@apple.com>
     2
     3        [Cocoa] Merge WebEditCommandProxy::nameForEditAction and undoNameForEditAction into a single function
     4        https://bugs.webkit.org/show_bug.cgi?id=193129
     5
     6        Reviewed by Tim Horton.
     7
     8        Remove WebEditCommandProxy::nameForEditAction and use WebCore::nameForUndoRedo instead.
     9
     10        * UIProcess/Cocoa/WebViewImpl.mm:
     11        (WebKit::WebViewImpl::registerEditCommand):
     12        * UIProcess/WebEditCommandProxy.cpp:
     13        (WebKit::WebEditCommandProxy::WebEditCommandProxy):
     14        (WebKit::WebEditCommandProxy::~WebEditCommandProxy):
     15        (WebKit::WebEditCommandProxy::nameForEditAction): Deleted.
     16        * UIProcess/WebEditCommandProxy.h:
     17        * UIProcess/WebPageProxy.cpp:
     18        (WebKit::WebPageProxy::addEditCommand):
     19        (WebKit::WebPageProxy::removeEditCommand):
     20        (WebKit::WebPageProxy::isValidEditCommand): Deleted.
     21
     22        Bit of drive-by refactoring: remove an unused function, and make addEditCommand and removeEditCommand take
     23        references instead of pointers, since these are assumed to be nonnull.
     24
     25        * UIProcess/WebPageProxy.h:
     26        * UIProcess/ios/PageClientImplIOS.mm:
     27        (WebKit::PageClientImpl::registerEditCommand):
     28
    1292019-01-03  Matt Rajca  <mrajca@apple.com>
    230
  • trunk/Source/WebKit/UIProcess/Cocoa/WebViewImpl.mm

    r239558 r239627  
    26782678void WebViewImpl::registerEditCommand(Ref<WebEditCommandProxy>&& command, UndoOrRedo undoOrRedo)
    26792679{
    2680     auto actionName = WebEditCommandProxy::nameForEditAction(command->editAction());
     2680    auto actionName = WebCore::nameForUndoRedo(command->editAction());
    26812681    auto commandObjC = adoptNS([[WKEditCommand alloc] initWithWebEditCommandProxy:WTFMove(command)]);
    26822682
  • trunk/Source/WebKit/UIProcess/WebEditCommandProxy.cpp

    r239589 r239627  
    4242    , m_page(page)
    4343{
    44     m_page->addEditCommand(this);
     44    m_page->addEditCommand(*this);
    4545}
    4646
     
    4848{
    4949    if (m_page)
    50         m_page->removeEditCommand(this);
     50        m_page->removeEditCommand(*this);
    5151}
    5252
     
    6969}
    7070
    71 String WebEditCommandProxy::nameForEditAction(EditAction editAction)
    72 {
    73     // FIXME: This is identical to code in WebKit's WebEditorClient class; would be nice to share the strings instead of having two copies.
    74     switch (editAction) {
    75     case EditAction::Unspecified:
    76     case EditAction::Insert:
    77     case EditAction::InsertReplacement:
    78     case EditAction::InsertFromDrop:
    79         return String();
    80     case EditAction::SetColor:
    81         return WEB_UI_STRING_KEY("Set Color", "Set Color (Undo action name)", "Undo action name");
    82     case EditAction::SetBackgroundColor:
    83         return WEB_UI_STRING_KEY("Set Background Color", "Set Background Color (Undo action name)", "Undo action name");
    84     case EditAction::TurnOffKerning:
    85         return WEB_UI_STRING_KEY("Turn Off Kerning", "Turn Off Kerning (Undo action name)", "Undo action name");
    86     case EditAction::TightenKerning:
    87         return WEB_UI_STRING_KEY("Tighten Kerning", "Tighten Kerning (Undo action name)", "Undo action name");
    88     case EditAction::LoosenKerning:
    89         return WEB_UI_STRING_KEY("Loosen Kerning", "Loosen Kerning (Undo action name)", "Undo action name");
    90     case EditAction::UseStandardKerning:
    91         return WEB_UI_STRING_KEY("Use Standard Kerning", "Use Standard Kerning (Undo action name)", "Undo action name");
    92     case EditAction::TurnOffLigatures:
    93         return WEB_UI_STRING_KEY("Turn Off Ligatures", "Turn Off Ligatures (Undo action name)", "Undo action name");
    94     case EditAction::UseStandardLigatures:
    95         return WEB_UI_STRING_KEY("Use Standard Ligatures", "Use Standard Ligatures (Undo action name)", "Undo action name");
    96     case EditAction::UseAllLigatures:
    97         return WEB_UI_STRING_KEY("Use All Ligatures", "Use All Ligatures (Undo action name)", "Undo action name");
    98     case EditAction::RaiseBaseline:
    99         return WEB_UI_STRING_KEY("Raise Baseline", "Raise Baseline (Undo action name)", "Undo action name");
    100     case EditAction::LowerBaseline:
    101         return WEB_UI_STRING_KEY("Lower Baseline", "Lower Baseline (Undo action name)", "Undo action name");
    102     case EditAction::SetTraditionalCharacterShape:
    103         return WEB_UI_STRING_KEY("Set Traditional Character Shape", "Set Traditional Character Shape (Undo action name)", "Undo action name");
    104     case EditAction::SetFont:
    105         return WEB_UI_STRING_KEY("Set Font", "Set Font (Undo action name)", "Undo action name");
    106     case EditAction::ChangeAttributes:
    107         return WEB_UI_STRING_KEY("Change Attributes", "Change Attributes (Undo action name)", "Undo action name");
    108     case EditAction::AlignLeft:
    109         return WEB_UI_STRING_KEY("Align Left", "Align Left (Undo action name)", "Undo action name");
    110     case EditAction::AlignRight:
    111         return WEB_UI_STRING_KEY("Align Right", "Align Right (Undo action name)", "Undo action name");
    112     case EditAction::Center:
    113         return WEB_UI_STRING_KEY("Center", "Center (Undo action name)", "Undo action name");
    114     case EditAction::Justify:
    115         return WEB_UI_STRING_KEY("Justify", "Justify (Undo action name)", "Undo action name");
    116     case EditAction::SetWritingDirection:
    117         return WEB_UI_STRING_KEY("Set Writing Direction", "Set Writing Direction (Undo action name)", "Undo action name");
    118     case EditAction::Subscript:
    119         return WEB_UI_STRING_KEY("Subscript", "Subscript (Undo action name)", "Undo action name");
    120     case EditAction::Superscript:
    121         return WEB_UI_STRING_KEY("Superscript", "Superscript (Undo action name)", "Undo action name");
    122     case EditAction::Underline:
    123         return WEB_UI_STRING_KEY("Underline", "Underline (Undo action name)", "Undo action name");
    124     case EditAction::Outline:
    125         return WEB_UI_STRING_KEY("Outline", "Outline (Undo action name)", "Undo action name");
    126     case EditAction::Unscript:
    127         return WEB_UI_STRING_KEY("Unscript", "Unscript (Undo action name)", "Undo action name");
    128     case EditAction::DeleteByDrag:
    129         return WEB_UI_STRING_KEY("Drag", "Drag (Undo action name)", "Undo action name");
    130     case EditAction::Cut:
    131         return WEB_UI_STRING_KEY("Cut", "Cut (Undo action name)", "Undo action name");
    132     case EditAction::Bold:
    133         return WEB_UI_STRING_KEY("Bold", "Bold (Undo action name)", "Undo action name");
    134     case EditAction::Italics:
    135         return WEB_UI_STRING_KEY("Italics", "Italics (Undo action name)", "Undo action name");
    136     case EditAction::Delete:
    137         return WEB_UI_STRING_KEY("Delete", "Delete (Undo action name)", "Undo action name");
    138     case EditAction::Dictation:
    139         return WEB_UI_STRING_KEY("Dictation", "Dictation (Undo action name)", "Undo action name");
    140     case EditAction::Paste:
    141         return WEB_UI_STRING_KEY("Paste", "Paste (Undo action name)", "Undo action name");
    142     case EditAction::PasteFont:
    143         return WEB_UI_STRING_KEY("Paste Font", "Paste Font (Undo action name)", "Undo action name");
    144     case EditAction::PasteRuler:
    145         return WEB_UI_STRING_KEY("Paste Ruler", "Paste Ruler (Undo action name)", "Undo action name");
    146     case EditAction::TypingDeleteSelection:
    147     case EditAction::TypingDeleteBackward:
    148     case EditAction::TypingDeleteForward:
    149     case EditAction::TypingDeleteWordBackward:
    150     case EditAction::TypingDeleteWordForward:
    151     case EditAction::TypingDeleteLineBackward:
    152     case EditAction::TypingDeleteLineForward:
    153     case EditAction::TypingDeletePendingComposition:
    154     case EditAction::TypingDeleteFinalComposition:
    155     case EditAction::TypingInsertText:
    156     case EditAction::TypingInsertLineBreak:
    157     case EditAction::TypingInsertParagraph:
    158     case EditAction::TypingInsertPendingComposition:
    159     case EditAction::TypingInsertFinalComposition:
    160         return WEB_UI_STRING_KEY("Typing", "Typing (Undo action name)", "Undo action name");
    161     case EditAction::CreateLink:
    162         return WEB_UI_STRING_KEY("Create Link", "Create Link (Undo action name)", "Undo action name");
    163     case EditAction::Unlink:
    164         return WEB_UI_STRING_KEY("Unlink", "Unlink (Undo action name)", "Undo action name");
    165     case EditAction::InsertUnorderedList:
    166     case EditAction::InsertOrderedList:
    167         return WEB_UI_STRING_KEY("Insert List", "Insert List (Undo action name)", "Undo action name");
    168     case EditAction::FormatBlock:
    169         return WEB_UI_STRING_KEY("Formatting", "Format Block (Undo action name)", "Undo action name");
    170     case EditAction::Indent:
    171         return WEB_UI_STRING_KEY("Indent", "Indent (Undo action name)", "Undo action name");
    172     case EditAction::Outdent:
    173         return WEB_UI_STRING_KEY("Outdent", "Outdent (Undo action name)", "Undo action name");
    174     // FIXME: We should give internal clients a way to override these undo names. For instance, Mail refers to ordered and unordered lists as "numbered" and "bulleted" lists, respectively,
    175     // despite the fact that ordered and unordered lists are not necessarily displayed using bullets and numerals.
    176     case EditAction::ConvertToOrderedList:
    177         return WEB_UI_STRING_KEY("Convert to Ordered List", "Convert to Ordered List (Undo action name)", "Undo action name");
    178     case EditAction::ConvertToUnorderedList:
    179         return WEB_UI_STRING_KEY("Convert to Unordered List", "Convert to Unordered List (Undo action name)", "Undo action name");
    180     case EditAction::InsertEditableImage:
    181         return WEB_UI_STRING_KEY("Insert Drawing", "Insert Drawing (Undo action name)", "Undo action name");
    182     }
    183     return String();
    184 }
    185 
    18671} // namespace WebKit
  • trunk/Source/WebKit/UIProcess/WebEditCommandProxy.h

    r239589 r239627  
    5353    void reapply();
    5454
    55     static String nameForEditAction(WebCore::EditAction);
    56 
    5755private:
    5856    WebEditCommandProxy(WebUndoStepID commandID, WebCore::EditAction, WebPageProxy*);
  • trunk/Source/WebKit/UIProcess/WebPageProxy.cpp

    r239589 r239627  
    57125712}
    57135713
    5714 void WebPageProxy::addEditCommand(WebEditCommandProxy* command)
    5715 {
    5716     m_editCommandSet.add(command);
    5717 }
    5718 
    5719 void WebPageProxy::removeEditCommand(WebEditCommandProxy* command)
    5720 {
    5721     m_editCommandSet.remove(command);
    5722 
    5723     if (!isValid())
    5724         return;
    5725     m_process->send(Messages::WebPage::DidRemoveEditCommand(command->commandID()), m_pageID);
     5714void WebPageProxy::addEditCommand(WebEditCommandProxy& command)
     5715{
     5716    m_editCommandSet.add(&command);
     5717}
     5718
     5719void WebPageProxy::removeEditCommand(WebEditCommandProxy& command)
     5720{
     5721    m_editCommandSet.remove(&command);
     5722
     5723    if (!isValid())
     5724        return;
     5725    m_process->send(Messages::WebPage::DidRemoveEditCommand(command.commandID()), m_pageID);
    57265726}
    57275727
     
    57345734{
    57355735    return pageClient().canUndoRedo(UndoOrRedo::Redo);
    5736 }
    5737 
    5738 bool WebPageProxy::isValidEditCommand(WebEditCommandProxy* command)
    5739 {
    5740     return m_editCommandSet.find(command) != m_editCommandSet.end();
    57415736}
    57425737
  • trunk/Source/WebKit/UIProcess/WebPageProxy.h

    r239589 r239627  
    10081008    virtual void updateAcceleratedCompositingMode(const LayerTreeContext&);
    10091009
    1010     void addEditCommand(WebEditCommandProxy*);
    1011     void removeEditCommand(WebEditCommandProxy*);
    1012     bool isValidEditCommand(WebEditCommandProxy*);
     1010    void addEditCommand(WebEditCommandProxy&);
     1011    void removeEditCommand(WebEditCommandProxy&);
    10131012    void registerEditCommand(Ref<WebEditCommandProxy>&&, UndoOrRedo);
    10141013
  • trunk/Source/WebKit/UIProcess/ios/PageClientImplIOS.mm

    r239558 r239627  
    266266void PageClientImpl::registerEditCommand(Ref<WebEditCommandProxy>&& command, UndoOrRedo undoOrRedo)
    267267{
    268     auto actionName = WebEditCommandProxy::nameForEditAction(command->editAction());
     268    auto actionName = WebCore::nameForUndoRedo(command->editAction());
    269269    auto commandObjC = adoptNS([[WKEditCommand alloc] initWithWebEditCommandProxy:WTFMove(command)]);
    270270   
  • trunk/Source/WebKitLegacy/mac/ChangeLog

    r239584 r239627  
     12019-01-04  Wenson Hsieh  <wenson_hsieh@apple.com>
     2
     3        [Cocoa] Merge WebEditCommandProxy::nameForEditAction and undoNameForEditAction into a single function
     4        https://bugs.webkit.org/show_bug.cgi?id=193129
     5
     6        Reviewed by Tim Horton.
     7
     8        Remove undoNameForEditAction and use WebCore::nameForUndoRedo instead.
     9
     10        * WebCoreSupport/WebEditorClient.mm:
     11        (WebEditorClient::registerUndoOrRedoStep):
     12        (undoNameForEditAction): Deleted.
     13
    1142019-01-02  Wenson Hsieh  <wenson_hsieh@apple.com>
    215
  • trunk/Source/WebKitLegacy/mac/WebCoreSupport/WebEditorClient.mm

    r238475 r239627  
    590590}
    591591
    592 static NSString* undoNameForEditAction(EditAction editAction)
    593 {
    594     // FIXME: This is identical to code in WebKit2's WebEditCommandProxy class; would be nice to share the strings instead of having two copies.
    595     switch (editAction) {
    596     case EditAction::Unspecified: return nil;
    597     case EditAction::Insert: return nil;
    598     case EditAction::InsertReplacement: return nil;
    599     case EditAction::InsertFromDrop: return nil;
    600     case EditAction::SetColor: return UI_STRING_KEY_INTERNAL("Set Color", "Set Color (Undo action name)", "Undo action name");
    601     case EditAction::SetBackgroundColor: return UI_STRING_KEY_INTERNAL("Set Background Color", "Set Background Color (Undo action name)", "Undo action name");
    602     case EditAction::TurnOffKerning: return UI_STRING_KEY_INTERNAL("Turn Off Kerning", "Turn Off Kerning (Undo action name)", "Undo action name");
    603     case EditAction::TightenKerning: return UI_STRING_KEY_INTERNAL("Tighten Kerning", "Tighten Kerning (Undo action name)", "Undo action name");
    604     case EditAction::LoosenKerning: return UI_STRING_KEY_INTERNAL("Loosen Kerning", "Loosen Kerning (Undo action name)", "Undo action name");
    605     case EditAction::UseStandardKerning: return UI_STRING_KEY_INTERNAL("Use Standard Kerning", "Use Standard Kerning (Undo action name)", "Undo action name");
    606     case EditAction::TurnOffLigatures: return UI_STRING_KEY_INTERNAL("Turn Off Ligatures", "Turn Off Ligatures (Undo action name)", "Undo action name");
    607     case EditAction::UseStandardLigatures: return UI_STRING_KEY_INTERNAL("Use Standard Ligatures", "Use Standard Ligatures (Undo action name)", "Undo action name");
    608     case EditAction::UseAllLigatures: return UI_STRING_KEY_INTERNAL("Use All Ligatures", "Use All Ligatures (Undo action name)", "Undo action name");
    609     case EditAction::RaiseBaseline: return UI_STRING_KEY_INTERNAL("Raise Baseline", "Raise Baseline (Undo action name)", "Undo action name");
    610     case EditAction::LowerBaseline: return UI_STRING_KEY_INTERNAL("Lower Baseline", "Lower Baseline (Undo action name)", "Undo action name");
    611     case EditAction::SetTraditionalCharacterShape: return UI_STRING_KEY_INTERNAL("Set Traditional Character Shape", "Set Traditional Character Shape (Undo action name)", "Undo action name");
    612     case EditAction::SetFont: return UI_STRING_KEY_INTERNAL("Set Font", "Set Font (Undo action name)", "Undo action name");
    613     case EditAction::ChangeAttributes: return UI_STRING_KEY_INTERNAL("Change Attributes", "Change Attributes (Undo action name)", "Undo action name");
    614     case EditAction::AlignLeft: return UI_STRING_KEY_INTERNAL("Align Left", "Align Left (Undo action name)", "Undo action name");
    615     case EditAction::AlignRight: return UI_STRING_KEY_INTERNAL("Align Right", "Align Right (Undo action name)", "Undo action name");
    616     case EditAction::Center: return UI_STRING_KEY_INTERNAL("Center", "Center (Undo action name)", "Undo action name");
    617     case EditAction::Justify: return UI_STRING_KEY_INTERNAL("Justify", "Justify (Undo action name)", "Undo action name");
    618     case EditAction::SetWritingDirection: return UI_STRING_KEY_INTERNAL("Set Writing Direction", "Set Writing Direction (Undo action name)", "Undo action name");
    619     case EditAction::Subscript: return UI_STRING_KEY_INTERNAL("Subscript", "Subscript (Undo action name)", "Undo action name");
    620     case EditAction::Superscript: return UI_STRING_KEY_INTERNAL("Superscript", "Superscript (Undo action name)", "Undo action name");
    621     case EditAction::Underline: return UI_STRING_KEY_INTERNAL("Underline", "Underline (Undo action name)", "Undo action name");
    622     case EditAction::Outline: return UI_STRING_KEY_INTERNAL("Outline", "Outline (Undo action name)", "Undo action name");
    623     case EditAction::Unscript: return UI_STRING_KEY_INTERNAL("Unscript", "Unscript (Undo action name)", "Undo action name");
    624     case EditAction::DeleteByDrag: return UI_STRING_KEY_INTERNAL("Drag", "Drag (Undo action name)", "Undo action name");
    625     case EditAction::Cut: return UI_STRING_KEY_INTERNAL("Cut", "Cut (Undo action name)", "Undo action name");
    626     case EditAction::Paste: return UI_STRING_KEY_INTERNAL("Paste", "Paste (Undo action name)", "Undo action name");
    627     case EditAction::PasteFont: return UI_STRING_KEY_INTERNAL("Paste Font", "Paste Font (Undo action name)", "Undo action name");
    628     case EditAction::PasteRuler: return UI_STRING_KEY_INTERNAL("Paste Ruler", "Paste Ruler (Undo action name)", "Undo action name");
    629     case EditAction::TypingDeleteSelection:
    630     case EditAction::TypingDeleteBackward:
    631     case EditAction::TypingDeleteForward:
    632     case EditAction::TypingDeleteWordBackward:
    633     case EditAction::TypingDeleteWordForward:
    634     case EditAction::TypingDeleteLineBackward:
    635     case EditAction::TypingDeleteLineForward:
    636     case EditAction::TypingDeletePendingComposition:
    637     case EditAction::TypingDeleteFinalComposition:
    638     case EditAction::TypingInsertText:
    639     case EditAction::TypingInsertLineBreak:
    640     case EditAction::TypingInsertParagraph:
    641     case EditAction::TypingInsertPendingComposition:
    642     case EditAction::TypingInsertFinalComposition:
    643         return UI_STRING_KEY_INTERNAL("Typing", "Typing (Undo action name)", "Undo action name");
    644     case EditAction::CreateLink: return UI_STRING_KEY_INTERNAL("Create Link", "Create Link (Undo action name)", "Undo action name");
    645     case EditAction::Unlink: return UI_STRING_KEY_INTERNAL("Unlink", "Unlink (Undo action name)", "Undo action name");
    646     case EditAction::InsertOrderedList:
    647     case EditAction::InsertUnorderedList:
    648         return UI_STRING_KEY_INTERNAL("Insert List", "Insert List (Undo action name)", "Undo action name");
    649     case EditAction::FormatBlock: return UI_STRING_KEY_INTERNAL("Formatting", "Format Block (Undo action name)", "Undo action name");
    650     case EditAction::Indent: return UI_STRING_KEY_INTERNAL("Indent", "Indent (Undo action name)", "Undo action name");
    651     case EditAction::Outdent: return UI_STRING_KEY_INTERNAL("Outdent", "Outdent (Undo action name)", "Undo action name");
    652     case EditAction::Bold: return UI_STRING_KEY_INTERNAL("Bold", "Bold (Undo action name)", "Undo action name");
    653     case EditAction::Italics: return UI_STRING_KEY_INTERNAL("Italics", "Italics (Undo action name)", "Undo action name");
    654     case EditAction::Delete: return UI_STRING_KEY_INTERNAL("Delete", "Delete (Undo action name)", "Undo action name");
    655     case EditAction::Dictation: return UI_STRING_KEY_INTERNAL("Dictation", "Dictation (Undo action name)", "Undo action name");
    656     case EditAction::ConvertToOrderedList: return UI_STRING_KEY_INTERNAL("Convert to Ordered List", "Convert to Ordered List (Undo action name)", "Undo action name");
    657     case EditAction::ConvertToUnorderedList: return UI_STRING_KEY_INTERNAL("Convert to Unordered List", "Convert to Unordered List (Undo action name)", "Undo action name");
    658     case EditAction::InsertEditableImage: return UI_STRING_KEY_INTERNAL("Insert Drawing", "Insert Drawing (Undo action name)", "Undo action name");
    659     }
    660     return nil;
    661 }
    662 
    663592void WebEditorClient::registerUndoOrRedoStep(UndoStep& step, bool isRedo)
    664593{
     
    673602#endif
    674603
    675     NSString *actionName = undoNameForEditAction(step.editingAction());
     604    NSString *actionName = WebCore::nameForUndoRedo(step.editingAction());
    676605    WebUndoStep *webEntry = [WebUndoStep stepWithUndoStep:step];
    677606    [undoManager registerUndoWithTarget:m_undoTarget.get() selector:(isRedo ? @selector(redoEditing:) : @selector(undoEditing:)) object:webEntry];
Note: See TracChangeset for help on using the changeset viewer.