Chromium Code Reviews| Index: content/renderer/render_widget.cc |
| diff --git a/content/renderer/render_widget.cc b/content/renderer/render_widget.cc |
| index e3382c9f10bb524229de2f33378552e331dbe04a..7db8a691370ef9353989a4b9a1fe98a5b8d66dc4 100644 |
| --- a/content/renderer/render_widget.cc |
| +++ b/content/renderer/render_widget.cc |
| @@ -1374,11 +1374,12 @@ void RenderWidget::OnImeSetComposition( |
| void RenderWidget::OnImeConfirmComposition(const base::string16& text, |
| const gfx::Range& replacement_range, |
| - bool keep_selection) { |
| + bool keep_selection, |
| + int new_cursor_pos) { |
| #if defined(ENABLE_PLUGINS) |
| if (focused_pepper_plugin_) { |
| focused_pepper_plugin_->render_frame()->OnImeConfirmComposition( |
| - text, replacement_range, keep_selection); |
| + text, replacement_range, keep_selection, new_cursor_pos); |
| return; |
| } |
| #endif |
| @@ -1392,11 +1393,12 @@ void RenderWidget::OnImeConfirmComposition(const base::string16& text, |
| ImeEventGuard guard(this); |
| input_handler_->set_handling_input_event(true); |
| if (text.length()) |
| - webwidget_->confirmComposition(text); |
| + webwidget_->confirmComposition(text, new_cursor_pos); |
| else if (keep_selection) |
| - webwidget_->confirmComposition(WebWidget::KeepSelection); |
| + webwidget_->confirmComposition(WebWidget::KeepSelection, new_cursor_pos); |
| else |
| - webwidget_->confirmComposition(WebWidget::DoNotKeepSelection); |
| + webwidget_->confirmComposition(WebWidget::DoNotKeepSelection, |
| + new_cursor_pos); |
| input_handler_->set_handling_input_event(false); |
| UpdateCompositionInfo(false /* not an immediate request */); |
| } |
| @@ -1901,7 +1903,7 @@ void RenderWidget::resetInputMethod() { |
| if (text_input_type_ != ui::TEXT_INPUT_TYPE_NONE) { |
| // If a composition text exists, then we need to let the browser process |
| // to cancel the input method's ongoing composition session. |
| - if (webwidget_->confirmComposition()) |
| + if (webwidget_->confirmComposition(1)) |
|
Changwan Ryu
2016/08/03 07:37:30
you shouldn't pass 1 here
yabinh
2016/08/08 07:33:43
Done.
|
| Send(new InputHostMsg_ImeCancelComposition(routing_id())); |
| } |