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

Unified Diff: components/arc/ime/arc_ime_service.cc

Issue 2027123002: ARC IME: Ignore InsertChar events while text input type is NONE. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Addressed review #6 Created 4 years, 7 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
« no previous file with comments | « no previous file | components/arc/ime/arc_ime_service_unittest.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: components/arc/ime/arc_ime_service.cc
diff --git a/components/arc/ime/arc_ime_service.cc b/components/arc/ime/arc_ime_service.cc
index 027f703941a6cd102d9e860f6816a792a776b2cc..3e4e4da932d13f4cb61a9b6306c4a0731139f688 100644
--- a/components/arc/ime/arc_ime_service.cc
+++ b/components/arc/ime/arc_ime_service.cc
@@ -188,6 +188,12 @@ void ArcImeService::InsertText(const base::string16& text) {
}
void ArcImeService::InsertChar(const ui::KeyEvent& event) {
+ // According to the document in text_input_client.h, InsertChar() is called
+ // even when the text input type is NONE. We ignore such events, since for
+ // ARC we are only interested in the event as a method of text input.
+ if (ime_type_ == ui::TEXT_INPUT_TYPE_NONE)
+ return;
+
// Drop 0x00-0x1f (C0 controls), 0x7f (DEL), and 0x80-0x9f (C1 controls).
// See: https://en.wikipedia.org/wiki/Unicode_control_characters
// They are control characters and not treated as a text insertion.
« no previous file with comments | « no previous file | components/arc/ime/arc_ime_service_unittest.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698