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

Unified Diff: content/browser/renderer_host/ime_adapter_android.cc

Issue 17074005: [Android] Change "handling" of unhandled key events. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: ps2 Created 7 years, 6 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 | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: content/browser/renderer_host/ime_adapter_android.cc
diff --git a/content/browser/renderer_host/ime_adapter_android.cc b/content/browser/renderer_host/ime_adapter_android.cc
index 95dc541a2fafec7faadd54003a95bee002b4e78b..e6371ccf61ee55181df9c9209bea625ad4e066ec 100644
--- a/content/browser/renderer_host/ime_adapter_android.cc
+++ b/content/browser/renderer_host/ime_adapter_android.cc
@@ -119,14 +119,20 @@ bool ImeAdapterAndroid::SendKeyEvent(JNIEnv* env, jobject,
NativeWebKeyboardEvent event = NativeWebKeyboardEventFromKeyEvent(
env, original_key_event, action, modifiers,
time_ms, key_code, is_system_key, unicode_char);
+ bool key_down_text_insertion =
+ event.type == WebKit::WebInputEvent::RawKeyDown && event.text[0];
+ // If we are going to follow up with a synthetic Char event, then that's the
+ // one we expect to test if it's handled or unhandled, so skip handling the
+ // "real" event in the browser.
+ event.skip_in_browser = key_down_text_insertion;
rwhva_->SendKeyEvent(event);
- if (event.type == WebKit::WebInputEvent::RawKeyDown && event.text[0]) {
+ if (key_down_text_insertion) {
// Send a Char event, but without an os_event since we don't want to
// roundtrip back to java such synthetic event.
NativeWebKeyboardEvent char_event(event);
char_event.os_event = NULL;
- event.type = WebKit::WebInputEvent::Char;
- rwhva_->SendKeyEvent(event);
+ char_event.type = WebKit::WebInputEvent::Char;
+ rwhva_->SendKeyEvent(char_event);
}
return true;
}
« 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