[Cocoa] Merge WebEditCommandProxy::nameForEditAction and undoNameForEditAction into...
authorwenson_hsieh@apple.com <wenson_hsieh@apple.com@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Fri, 4 Jan 2019 19:56:51 +0000 (19:56 +0000)
committerwenson_hsieh@apple.com <wenson_hsieh@apple.com@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Fri, 4 Jan 2019 19:56:51 +0000 (19:56 +0000)
commiteddc5362bd8048f387029118d874a78cb0ff3780
tree6d7cdbed91d279109397f6b20d3c6e11fba40f44
parenta87293fab3a557bf2821917e8d1522de7552d02a
[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.

git-svn-id: https://svn.webkit.org/repository/webkit/trunk@239627 268f45cc-cd09-0410-ab3c-d52691b4dbfc
15 files changed:
Source/WebCore/ChangeLog
Source/WebCore/Sources.txt
Source/WebCore/WebCore.xcodeproj/project.pbxproj
Source/WebCore/editing/EditAction.cpp [new file with mode: 0644]
Source/WebCore/editing/EditAction.h
Source/WebCore/editing/Editor.cpp
Source/WebKit/ChangeLog
Source/WebKit/UIProcess/Cocoa/WebViewImpl.mm
Source/WebKit/UIProcess/WebEditCommandProxy.cpp
Source/WebKit/UIProcess/WebEditCommandProxy.h
Source/WebKit/UIProcess/WebPageProxy.cpp
Source/WebKit/UIProcess/WebPageProxy.h
Source/WebKit/UIProcess/ios/PageClientImplIOS.mm
Source/WebKitLegacy/mac/ChangeLog
Source/WebKitLegacy/mac/WebCoreSupport/WebEditorClient.mm