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

Unified Diff: chrome/browser/ui/input_method/input_method_engine.cc

Issue 2525723005: Makes delay commitText/setComposition can deal with empty text/composition. (Closed)
Patch Set: Created 4 years, 1 month 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 | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: chrome/browser/ui/input_method/input_method_engine.cc
diff --git a/chrome/browser/ui/input_method/input_method_engine.cc b/chrome/browser/ui/input_method/input_method_engine.cc
index a2395de71d6149818400c830b1fb58c3a99d1049..ebdc95ffc5aa5d40538f96351fdf7ae8a08ae60e 100644
--- a/chrome/browser/ui/input_method/input_method_engine.cc
+++ b/chrome/browser/ui/input_method/input_method_engine.cc
@@ -146,8 +146,9 @@ void InputMethodEngine::UpdateComposition(
ui::IMEInputContextHandlerInterface* input_context =
ui::IMEBridge::Get()->GetInputContextHandler();
// If the IME extension is handling key event, hold the composition text
- // until the key event is handled.
- if (input_context && !handling_key_event_) {
+ // until the key event is handled. However, if trying to clear the
+ // composition, do UpdateCompositionText at once.
+ if ((input_context && !handling_key_event_) || composition_.text.empty()) {
input_context->UpdateCompositionText(composition_, cursor_pos, is_visible);
Azure Wei 2016/11/23 07:53:42 In UpdateCompositionText(), we would send a faked
Shu Chen 2016/11/24 02:57:57 Done.
composition_.Clear();
}
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698