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

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

Issue 1284433002: Revise ui::DomKey to unify character and non-character codes. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 5 years, 4 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
Index: chrome/browser/chromeos/input_method/input_method_engine.cc
diff --git a/chrome/browser/chromeos/input_method/input_method_engine.cc b/chrome/browser/chromeos/input_method/input_method_engine.cc
index d985f6a565f11cf3e1666c4ddcaca214efb9de65..8d0d94cfc62b59637bb4cb6cda14a0dac7fe52a9 100644
--- a/chrome/browser/chromeos/input_method/input_method_engine.cc
+++ b/chrome/browser/chromeos/input_method/input_method_engine.cc
@@ -309,18 +309,10 @@ bool InputMethodEngine::SendKeyEvents(
flags |= event.shift_key ? ui::EF_SHIFT_DOWN : ui::EF_NONE;
flags |= event.caps_lock ? ui::EF_CAPS_LOCK_DOWN : ui::EF_NONE;
- base::char16 ch = 0;
- // 4-bytes UTF-8 string is at least 2-characters UTF-16 string.
- // And Key char can only be single UTF-16 character.
- if (!event.key.empty() && event.key.size() < 4) {
- base::string16 key_char = base::UTF8ToUTF16(event.key);
- if (key_char.size() == 1)
- ch = key_char[0];
- }
ui::KeyEvent ui_event(
type, key_code,
ui::KeycodeConverter::CodeStringToDomCode(event.code.c_str()), flags,
- ui::KeycodeConverter::KeyStringToDomKey(event.key.c_str()), ch,
+ ui::KeycodeConverter::KeyStringToDomKey(event.key.c_str()),
kpschoedel 2015/08/07 20:42:11 KeyStringToDomKey() now handles the case where |ke
Wez 2015/08/13 22:31:48 What does it return if the string passed is neithe
kpschoedel 2015/08/17 20:16:14 DomKey::NONE; this is noted in the declaration com
Wez 2015/08/18 22:34:32 Acknowledged.
ui::EventTimeForNow());
base::AutoReset<const ui::KeyEvent*> reset_sent_key(&sent_key_event_,
&ui_event);

Powered by Google App Engine
This is Rietveld 408576698