Chromium Code Reviews| Index: content/browser/renderer_host/render_widget_host_view_android.cc |
| diff --git a/content/browser/renderer_host/render_widget_host_view_android.cc b/content/browser/renderer_host/render_widget_host_view_android.cc |
| index 339fec9359479b8e4d1c9ffaf578260748595c82..c65266ef7ee1cd848d317db98c9ae1be4eb4f31d 100644 |
| --- a/content/browser/renderer_host/render_widget_host_view_android.cc |
| +++ b/content/browser/renderer_host/render_widget_host_view_android.cc |
| @@ -1744,6 +1744,11 @@ void RenderWidgetHostViewAndroid::RunAckCallbacks() { |
| void RenderWidgetHostViewAndroid::OnGestureEvent( |
| const ui::GestureEventData& gesture) { |
| + // Confirm existing composition text on TAP gesture, to make sure the input |
| + // caret won't be moved with an ongoing composition text. |
| + if (gesture.type() == ui::ET_GESTURE_TAP) |
| + FinishImeCompositionSession(); |
| + |
| blink::WebGestureEvent web_gesture = |
| CreateWebGestureEventFromGestureEventData(gesture); |
| // TODO(jdduke): Remove this workaround after Android fixes UiAutomator to |
| @@ -1928,6 +1933,16 @@ void RenderWidgetHostViewAndroid::OnStylusSelectTap(base::TimeTicks time, |
| SendGestureEvent(long_press); |
| } |
| +void RenderWidgetHostViewAndroid::FinishImeCompositionSession() { |
| + if (!ime_adapter_android_.HasComposition()) |
| + return; |
| + if (host_) { |
| + host_->ImeConfirmComposition(base::string16(), gfx::Range::InvalidRange(), |
|
aurimas (slooooooooow)
2015/03/19 05:40:30
This will get called even if the user taps inside
|
| + false); |
| + } |
| + ImeCancelComposition(); |
| +} |
| + |
| // static |
| void RenderWidgetHostViewBase::GetDefaultScreenInfo( |
| blink::WebScreenInfo* results) { |