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

Unified Diff: chrome/browser/ui/input_method/input_method_engine_base.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 | « 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 4bf356d7bacd92e7637a0cdb2f62a4120866f38a..64ce74d63ba2e9973248b9577f032f8bfc5843ba 100644
--- a/chrome/browser/ui/input_method/input_method_engine_base.cc
+++ b/chrome/browser/ui/input_method/input_method_engine_base.cc
@@ -160,7 +160,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() {}
@@ -388,19 +390,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