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

Unified Diff: content/renderer/render_widget.cc

Issue 1995333002: Handle newCursorPosition correctly for Android's commitText() (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: adjust selection in confirmCompositionOrInsertText() Created 4 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: 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()));
}

Powered by Google App Engine
This is Rietveld 408576698