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

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

Issue 2143923002: Introduce 'TextCompositionCancel' for cancelComposition (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Rebase 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
« no previous file with comments | « no previous file | third_party/WebKit/Source/core/editing/commands/TypingCommand.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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 92edae82b2ed749dbd3568522b7a2ad71782d6ed..bae3cea1d0ff453dbdafaf3f688cb67b036bec9d 100644
--- a/third_party/WebKit/Source/core/editing/InputMethodController.cpp
+++ b/third_party/WebKit/Source/core/editing/InputMethodController.cpp
@@ -84,9 +84,11 @@ void insertTextDuringCompositionWithEvents(
DCHECK(compositionType ==
TypingCommand::TextCompositionType::TextCompositionUpdate ||
compositionType ==
- TypingCommand::TextCompositionType::TextCompositionConfirm)
+ TypingCommand::TextCompositionType::TextCompositionConfirm ||
+ compositionType ==
+ TypingCommand::TextCompositionType::TextCompositionCancel)
<< "compositionType should be TextCompositionUpdate or "
- "TextCompositionConfirm, but got "
+ "TextCompositionConfirm or TextCompositionCancel, but got "
<< static_cast<int>(compositionType);
if (!frame.document())
return;
@@ -126,6 +128,7 @@ void insertTextDuringCompositionWithEvents(
compositionType);
break;
case TypingCommand::TextCompositionType::TextCompositionConfirm:
+ case TypingCommand::TextCompositionType::TextCompositionCancel:
// TODO(chongz): Use TypingCommand::insertText after TextEvent was
// removed. (Removed from spec since 2012)
// See TextEvent.idl.
@@ -379,7 +382,7 @@ void InputMethodController::cancelComposition() {
dispatchCompositionUpdateEvent(frame(), emptyString());
insertTextDuringCompositionWithEvents(
frame(), emptyString(), 0,
- TypingCommand::TextCompositionType::TextCompositionConfirm);
+ TypingCommand::TextCompositionType::TextCompositionCancel);
// Event handler might destroy document.
if (!isAvailable())
return;
« no previous file with comments | « no previous file | third_party/WebKit/Source/core/editing/commands/TypingCommand.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698