Index: content/renderer/input/render_widget_input_handler.cc |
diff --git a/content/renderer/input/render_widget_input_handler.cc b/content/renderer/input/render_widget_input_handler.cc |
index d5d5255c02f9c864a383a94ca1745f640d47461b..d566f21c4151eb47184eba7c15b4d97c8d51f438 100644 |
--- a/content/renderer/input/render_widget_input_handler.cc |
+++ b/content/renderer/input/render_widget_input_handler.cc |
@@ -9,6 +9,7 @@ |
#include <utility> |
#include "base/auto_reset.h" |
+#include "base/command_line.h" |
#include "base/metrics/histogram_macros.h" |
#include "base/trace_event/trace_event_synthetic_delay.h" |
#include "build/build_config.h" |
@@ -17,6 +18,7 @@ |
#include "content/common/input/input_event_ack.h" |
#include "content/common/input/input_event_ack_state.h" |
#include "content/common/input/web_input_event_traits.h" |
+#include "content/public/common/content_switches.h" |
#include "content/renderer/gpu/render_widget_compositor.h" |
#include "content/renderer/ime_event_guard.h" |
#include "content/renderer/input/render_widget_input_handler_delegate.h" |
@@ -208,10 +210,12 @@ void RenderWidgetInputHandler::HandleInputEvent( |
#if defined(OS_ANDROID) |
bool from_ime = false; |
+ bool use_ime_thread = base::CommandLine::ForCurrentProcess()->HasSwitch( |
+ switches::kUseImeThread); |
// For most keyboard events, we want the change source to be FROM_IME because |
// we don't need to update IME states in AdapterInputConnection. |
- if (WebInputEvent::isKeyboardEventType(input_event.type)) { |
+ if (!use_ime_thread && WebInputEvent::isKeyboardEventType(input_event.type)) { |
const WebKeyboardEvent& key_event = |
*static_cast<const WebKeyboardEvent*>(&input_event); |
// TODO(changwan): this if-condition is a stop-gap solution to update IME |
@@ -226,8 +230,9 @@ void RenderWidgetInputHandler::HandleInputEvent( |
key_event.nativeKeyCode != AKEYCODE_DPAD_LEFT && |
key_event.nativeKeyCode != AKEYCODE_DPAD_RIGHT && |
key_event.nativeKeyCode != AKEYCODE_DPAD_UP && |
- key_event.nativeKeyCode != AKEYCODE_DPAD_DOWN) |
+ key_event.nativeKeyCode != AKEYCODE_DPAD_DOWN) { |
from_ime = true; |
+ } |
} |
ImeEventGuard guard(widget_, false, from_ime); |