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

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

Issue 2583993002: [Editing] Introduce |CompositeEditCommand::willApplyEditing()| in prepare for 'beforeinput' (1/3) (Closed)
Patch Set: Add TODO, remove |willApply()| Created 4 years 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.h
diff --git a/third_party/WebKit/Source/core/editing/commands/TypingCommand.h b/third_party/WebKit/Source/core/editing/commands/TypingCommand.h
index 49242a6bc4405b9ea382348852ab1b920c6dc62f..ecc6a3df2097432c17d46c927a6ed7a77490a758 100644
--- a/third_party/WebKit/Source/core/editing/commands/TypingCommand.h
+++ b/third_party/WebKit/Source/core/editing/commands/TypingCommand.h
@@ -107,8 +107,7 @@ class CORE_EXPORT TypingCommand final : public CompositeEditCommand {
ETypingCommand commandTypeOfOpenCommand() const { return m_commandType; }
TextCompositionType compositionType() const { return m_compositionType; }
- // |TypingCommand| may contain multiple |InsertTextCommand|, should return
- // |textDataForInputEvent()| of the last one.
+ // Returns text data of the last added typing.
String textDataForInputEvent() const final;
private:
@@ -160,6 +159,10 @@ class CORE_EXPORT TypingCommand final : public CompositeEditCommand {
LocalFrame*);
void updatePreservesTypingStyle(ETypingCommand);
+ // Returns |false| to cancel adding typing.
+ bool willAddTypingToOpenCommand(EditCommandSource,
+ InputEvent::InputType,
+ const String& text = nullAtom);
void typingAddedToOpenCommand(ETypingCommand);
bool makeEditableRootEmpty(EditingState*);
@@ -171,6 +174,7 @@ class CORE_EXPORT TypingCommand final : public CompositeEditCommand {
ETypingCommand m_commandType;
String m_textToInsert;
+ InputEvent::InputType m_inputType;
bool m_openForMoreTyping;
bool m_selectInsertedText;
bool m_smartDelete;

Powered by Google App Engine
This is Rietveld 408576698