Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(395)

Unified Diff: Source/web/WebLocalFrameImpl.cpp

Issue 337473010: Move implementation of WebFrameImpl::executeCommand to Editor (Closed) Base URL: https://chromium.googlesource.com/chromium/blink.git@master
Patch Set: 2014-06-27T03:18:08 Created 6 years, 6 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
Index: Source/web/WebLocalFrameImpl.cpp
diff --git a/Source/web/WebLocalFrameImpl.cpp b/Source/web/WebLocalFrameImpl.cpp
index 1f6faf02141b781864e355b02a28c3a238dd273f..3644b3824e1f2bc71fc00a73c3b6999e7aee91b4 100644
--- a/Source/web/WebLocalFrameImpl.cpp
+++ b/Source/web/WebLocalFrameImpl.cpp
@@ -1051,50 +1051,18 @@ bool WebLocalFrameImpl::executeCommand(const WebString& name, const WebNode& nod
if (pluginContainer && pluginContainer->executeEditCommand(name))
return true;
- bool result = true;
-
- // Specially handling commands that Editor::execCommand does not directly
- // support.
- if (command == "DeleteToEndOfParagraph") {
- if (!frame()->editor().deleteWithDirection(DirectionForward, ParagraphBoundary, true, false))
- frame()->editor().deleteWithDirection(DirectionForward, CharacterGranularity, true, false);
- } else if (command == "DeleteBackward") {
- result = frame()->editor().command(AtomicString("BackwardDelete")).execute();
- } else if (command == "DeleteForward") {
- result = frame()->editor().command(AtomicString("ForwardDelete")).execute();
- } else if (command == "AdvanceToNextMisspelling") {
- // Wee need to pass false here or else the currently selected word will never be skipped.
- frame()->spellChecker().advanceToNextMisspelling(false);
- } else if (command == "ToggleSpellPanel") {
- frame()->spellChecker().showSpellingGuessPanel();
- } else {
- result = frame()->editor().command(command).execute();
- }
- return result;
+ return frame()->editor().executeCommand(command);
}
bool WebLocalFrameImpl::executeCommand(const WebString& name, const WebString& value, const WebNode& node)
{
ASSERT(frame());
- String webName = name;
WebPluginContainerImpl* pluginContainer = pluginContainerFromNode(frame(), node);
if (pluginContainer && pluginContainer->executeEditCommand(name, value))
return true;
- // moveToBeginningOfDocument and moveToEndfDocument are only handled by WebKit for editable nodes.
- if (!frame()->editor().canEdit() && webName == "moveToBeginningOfDocument")
- return viewImpl()->bubblingScroll(ScrollUp, ScrollByDocument);
-
- if (!frame()->editor().canEdit() && webName == "moveToEndOfDocument")
- return viewImpl()->bubblingScroll(ScrollDown, ScrollByDocument);
-
- if (webName == "showGuessPanel") {
- frame()->spellChecker().showSpellingGuessPanel();
- return true;
- }
-
- return frame()->editor().command(webName).execute(value);
+ return frame()->editor().executeCommand(name, value);
}
bool WebLocalFrameImpl::isCommandEnabled(const WebString& name) const

Powered by Google App Engine
This is Rietveld 408576698