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

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

Issue 2530843003: Introduce InsertIncrementalTextCommand to respect existing style for composition (Closed)
Patch Set: Address xiaochengh@'s review 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 a21fa5177dcd6d12499e2e05e337499d259e7812..437980a51dff5c2ea4705dba5428aa8813a8091e 100644
--- a/third_party/WebKit/Source/core/editing/commands/TypingCommand.h
+++ b/third_party/WebKit/Source/core/editing/commands/TypingCommand.h
@@ -69,12 +69,14 @@ class CORE_EXPORT TypingCommand final : public CompositeEditCommand {
static void insertText(Document&,
const String&,
Options,
- TextCompositionType = TextCompositionNone);
+ TextCompositionType = TextCompositionNone,
+ const bool isIncrementalInsertion = false);
static void insertText(Document&,
const String&,
const VisibleSelection&,
Options,
- TextCompositionType = TextCompositionNone);
+ TextCompositionType = TextCompositionNone,
+ const bool isIncrementalInsertion = false);
static bool insertLineBreak(Document&);
static bool insertParagraphSeparator(Document&);
static bool insertParagraphSeparatorInQuotedContent(Document&);
@@ -93,6 +95,10 @@ class CORE_EXPORT TypingCommand final : public CompositeEditCommand {
void setCompositionType(TextCompositionType type) {
m_compositionType = type;
}
+ static void adjustSelectionAfterIncrementalInsertion(TypingCommand*,
+ LocalFrame*,
+ const size_t start,
+ const size_t end);
ETypingCommand commandTypeOfOpenCommand() const { return m_commandType; }
TextCompositionType compositionType() const { return m_compositionType; }
@@ -156,6 +162,8 @@ class CORE_EXPORT TypingCommand final : public CompositeEditCommand {
m_commandType = typingCommand;
}
+ bool isIncrementalInsertion() const { return m_isIncrementalInsertion; }
+
ETypingCommand m_commandType;
String m_textToInsert;
bool m_openForMoreTyping;
@@ -173,6 +181,8 @@ class CORE_EXPORT TypingCommand final : public CompositeEditCommand {
bool m_shouldRetainAutocorrectionIndicator;
bool m_shouldPreventSpellChecking;
+
+ bool m_isIncrementalInsertion;
};
DEFINE_TYPE_CASTS(TypingCommand,

Powered by Google App Engine
This is Rietveld 408576698