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

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

Issue 2636043002: Revert of [EditCommandSource] Pass source to |CompositEditCommand| and |TypingCommand| (3/3) (Closed)
Patch Set: Remove command source in ApplyStyleCommandTest.cpp Created 3 years, 11 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/InputMethodController.cpp
diff --git a/third_party/WebKit/Source/core/editing/InputMethodController.cpp b/third_party/WebKit/Source/core/editing/InputMethodController.cpp
index 3a1071d6f74f8c9ef1ef0225667f26604de33f75..1b11d96ae61cb76ff1d74a0a80537ee9d18c8bf5 100644
--- a/third_party/WebKit/Source/core/editing/InputMethodController.cpp
+++ b/third_party/WebKit/Source/core/editing/InputMethodController.cpp
@@ -144,9 +144,8 @@ void insertTextDuringCompositionWithEvents(
switch (compositionType) {
case TypingCommand::TextCompositionType::TextCompositionUpdate:
case TypingCommand::TextCompositionType::TextCompositionConfirm:
- TypingCommand::insertText(
- *frame.document(), EditCommandSource::kMenuOrKeyBinding, text,
- options, compositionType, isIncrementalInsertion);
+ TypingCommand::insertText(*frame.document(), text, options,
+ compositionType, isIncrementalInsertion);
break;
case TypingCommand::TextCompositionType::TextCompositionCancel:
// TODO(chongz): Use TypingCommand::insertText after TextEvent was
@@ -306,10 +305,8 @@ 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(),
- EditCommandSource::kMenuOrKeyBinding, 0);
- }
+ if (text.isEmpty())
+ TypingCommand::deleteSelection(document(), 0);
clear();
@@ -538,7 +535,6 @@ 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(),
- EditCommandSource::kMenuOrKeyBinding,
TypingCommand::PreventSpellChecking);
}
@@ -797,8 +793,7 @@ void InputMethodController::extendSelectionAndDelete(int before, int after) {
dispatchBeforeInputEditorCommand(
document().focusedElement(), InputEvent::InputType::DeleteContentBackward,
new RangeVector(1, m_frame->selection().firstRange()));
- TypingCommand::deleteSelection(document(),
- EditCommandSource::kMenuOrKeyBinding);
+ TypingCommand::deleteSelection(document());
}
// TODO(yabinh): We should reduce the number of selectionchange events.
@@ -833,8 +828,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(),
- EditCommandSource::kMenuOrKeyBinding);
+ TypingCommand::deleteSelection(document());
selectionEnd = selectionEnd - (selectionStart - adjustedStart);
selectionStart = adjustedStart;
@@ -859,8 +853,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(),
- EditCommandSource::kMenuOrKeyBinding);
+ TypingCommand::deleteSelection(document());
}
setSelectionOffsets(PlainTextRange(selectionStart, selectionEnd));

Powered by Google App Engine
This is Rietveld 408576698