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

Unified Diff: third_party/WebKit/Source/core/editing/commands/TypingCommand.cpp

Issue 2151353002: [InputEvent] Replace |EditAction| with |InputType| (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@inputevent-text-styling
Patch Set: Replaced |EditAction| with |InputType| Created 4 years, 5 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: third_party/WebKit/Source/core/editing/commands/TypingCommand.cpp
diff --git a/third_party/WebKit/Source/core/editing/commands/TypingCommand.cpp b/third_party/WebKit/Source/core/editing/commands/TypingCommand.cpp
index fbd532e77a9fb2f5a49da3f27929a04b4b70f583..87de35bab7a234c90605155dbe2beb157d0ed619 100644
--- a/third_party/WebKit/Source/core/editing/commands/TypingCommand.cpp
+++ b/third_party/WebKit/Source/core/editing/commands/TypingCommand.cpp
@@ -298,9 +298,24 @@ void TypingCommand::doApply(EditingState* editingState)
NOTREACHED();
}
-EditAction TypingCommand::editingAction() const
+InputEvent::InputType TypingCommand::inputType() const
{
- return EditActionTyping;
+ // TODO(chongz): Map commands based on |m_granularity| and direction.
+ switch (commandTypeOfOpenCommand()) {
+ case DeleteSelection:
+ case DeleteKey:
+ case ForwardDeleteKey:
+ return InputEvent::InputType::DeleteContentBackward;
+ case InsertText:
+ return InputEvent::InputType::InsertText;
+ case InsertLineBreak:
+ return InputEvent::InputType::InsertLineBreak;
+ case InsertParagraphSeparator:
+ case InsertParagraphSeparatorInQuotedContent:
+ return InputEvent::InputType::InsertParagraph;
+ default:
+ return InputEvent::InputType::None;
+ }
}
void TypingCommand::markMisspellingsAfterTyping(ETypingCommand commandType)

Powered by Google App Engine
This is Rietveld 408576698