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

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

Issue 2532803002: 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 | « chrome/browser/ui/input_method/input_method_engine_base.h ('k') | 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_base.cc
diff --git a/chrome/browser/ui/input_method/input_method_engine_base.cc b/chrome/browser/ui/input_method/input_method_engine_base.cc
index 6d7a6f5a8967573d0bce3ed8f1092e355cc10fc0..322d596a752897421e376fcb686e925787ab75e5 100644
--- a/chrome/browser/ui/input_method/input_method_engine_base.cc
+++ b/chrome/browser/ui/input_method/input_method_engine_base.cc
@@ -163,7 +163,9 @@ InputMethodEngineBase::InputMethodEngineBase()
sent_key_event_(nullptr),
profile_(nullptr),
next_request_id_(1),
+ composition_changed_(false),
text_(""),
+ commit_text_changed_(false),
handling_key_event_(false) {}
InputMethodEngineBase::~InputMethodEngineBase() {}
@@ -391,19 +393,21 @@ void InputMethodEngineBase::KeyEventHandled(const std::string& extension_id,
// and setComposition calls.
ui::IMEInputContextHandlerInterface* input_context =
ui::IMEBridge::Get()->GetInputContextHandler();
- if (!text_.empty()) {
+ if (commit_text_changed_) {
if (input_context) {
input_context->CommitText(text_);
}
text_ = "";
+ commit_text_changed_ = false;
}
- if (!composition_.text.empty()) {
+ if (composition_changed_) {
if (input_context) {
input_context->UpdateCompositionText(
composition_, composition_.selection.start(), true);
}
composition_.Clear();
+ composition_changed_ = false;
}
RequestMap::iterator request = request_map_.find(request_id);
« no previous file with comments | « chrome/browser/ui/input_method/input_method_engine_base.h ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698