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

Unified Diff: third_party/WebKit/Source/core/editing/InputMethodController.cpp

Issue 2574793002: [Editing] Store |CommandSource| in |CompositeEditCommand| (Closed)
Patch Set: 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/InputMethodController.cpp
diff --git a/third_party/WebKit/Source/core/editing/InputMethodController.cpp b/third_party/WebKit/Source/core/editing/InputMethodController.cpp
index bae3cea1d0ff453dbdafaf3f688cb67b036bec9d..08f0805281e004f7fde67f28950c48ec0b17d83c 100644
--- a/third_party/WebKit/Source/core/editing/InputMethodController.cpp
+++ b/third_party/WebKit/Source/core/editing/InputMethodController.cpp
@@ -124,7 +124,8 @@ void insertTextDuringCompositionWithEvents(
switch (compositionType) {
case TypingCommand::TextCompositionType::TextCompositionUpdate:
- TypingCommand::insertText(*frame.document(), text, options,
+ TypingCommand::insertText(*frame.document(),
+ CommandSource::MenuOrKeyBinding, text, options,
compositionType);
break;
case TypingCommand::TextCompositionType::TextCompositionConfirm:
@@ -289,8 +290,10 @@ bool InputMethodController::replaceComposition(const String& text) {
// If text is empty, then delete the old composition here. If text is
// non-empty, InsertTextCommand::input will delete the old composition with
// an optimized replace operation.
- if (text.isEmpty())
- TypingCommand::deleteSelection(document(), 0);
+ if (text.isEmpty()) {
+ TypingCommand::deleteSelection(document(), CommandSource::MenuOrKeyBinding,
+ 0);
+ }
clear();
@@ -637,6 +640,7 @@ void InputMethodController::setComposition(
// composition, however some IME (e.g. Japanese IBus-Anthy) did this, so
// we simply delete selection without sending extra events.
TypingCommand::deleteSelection(document(),
+ CommandSource::MenuOrKeyBinding,
TypingCommand::PreventSpellChecking);
}
@@ -919,7 +923,7 @@ void InputMethodController::extendSelectionAndDelete(int before, int after) {
dispatchBeforeInputEditorCommand(
document().focusedElement(), InputEvent::InputType::DeleteContentBackward,
new RangeVector(1, m_frame->selection().firstRange()));
- TypingCommand::deleteSelection(document());
+ TypingCommand::deleteSelection(document(), CommandSource::MenuOrKeyBinding);
}
// TODO(yabinh): We should reduce the number of selectionchange events.
@@ -954,7 +958,7 @@ void InputMethodController::deleteSurroundingText(int before, int after) {
const int adjustedStart = start - static_cast<int>(diff);
if (!setSelectionOffsets(PlainTextRange(adjustedStart, selectionStart)))
return;
- TypingCommand::deleteSelection(document());
+ TypingCommand::deleteSelection(document(), CommandSource::MenuOrKeyBinding);
selectionEnd = selectionEnd - (selectionStart - adjustedStart);
selectionStart = adjustedStart;
@@ -979,7 +983,7 @@ void InputMethodController::deleteSurroundingText(int before, int after) {
const int adjustedEnd = end + static_cast<int>(diff);
if (!setSelectionOffsets(PlainTextRange(selectionEnd, adjustedEnd)))
return;
- TypingCommand::deleteSelection(document());
+ TypingCommand::deleteSelection(document(), CommandSource::MenuOrKeyBinding);
}
setSelectionOffsets(PlainTextRange(selectionStart, selectionEnd));

Powered by Google App Engine
This is Rietveld 408576698