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

Unified Diff: content/renderer/render_widget.cc

Issue 12093068: Adding missing UpdateTextInputState calls after each ime event. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Adding an Android IME test Created 7 years, 10 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 6cfeabef714dcacb689c72eda7cbe3a6a8ff43c1..789fcdeef6db9e5efebe85149fb5aa358e563ba7 100644
--- a/content/renderer/render_widget.cc
+++ b/content/renderer/render_widget.cc
@@ -145,6 +145,7 @@ RenderWidget::RenderWidget(WebKit::WebPopupType popup_type,
needs_repainting_on_restore_(false),
has_focus_(false),
handling_input_event_(false),
+ handling_ime_event_(false),
closing_(false),
is_swapped_out_(swapped_out),
input_method_is_active_(false),
@@ -1566,6 +1567,7 @@ void RenderWidget::OnImeSetComposition(
int selection_start, int selection_end) {
if (!webwidget_)
return;
+ handling_ime_event_ = true;
if (webwidget_->setComposition(
text, WebVector<WebCompositionUnderline>(underlines),
selection_start, selection_end)) {
@@ -1600,13 +1602,15 @@ void RenderWidget::OnImeSetComposition(
}
UpdateCompositionInfo(range, std::vector<gfx::Rect>());
}
+ handling_ime_event_ = false;
+ UpdateTextInputState(DO_NOT_SHOW_IME);
}
void RenderWidget::OnImeConfirmComposition(
const string16& text, const ui::Range& replacement_range) {
if (!webwidget_)
return;
-
+ handling_ime_event_ = true;
handling_input_event_ = true;
webwidget_->confirmComposition(text);
handling_input_event_ = false;
@@ -1618,7 +1622,9 @@ void RenderWidget::OnImeConfirmComposition(
range.set_start(location);
range.set_end(location + length);
}
+ handling_ime_event_ = false;
UpdateCompositionInfo(range, std::vector<gfx::Rect>());
+ UpdateTextInputState(DO_NOT_SHOW_IME);
}
// This message causes the renderer to render an image of the
@@ -1844,6 +1850,8 @@ static bool IsDateTimeInput(ui::TextInputType type) {
void RenderWidget::UpdateTextInputState(ShowIme show_ime) {
+ if (handling_ime_event_)
+ return;
bool show_ime_if_needed = (show_ime == SHOW_IME_IF_NEEDED);
if (!show_ime_if_needed && !input_method_is_active_)
return;

Powered by Google App Engine
This is Rietveld 408576698