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

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 the missing selection values to EditorInfo Created 7 years, 11 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
« content/renderer/render_widget.h ('K') | « content/renderer/render_widget.h ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: content/renderer/render_widget.cc
diff --git a/content/renderer/render_widget.cc b/content/renderer/render_widget.cc
index f3cbedf90b13b8c23e499389c0f4ff04d2474a57..8e46a3f822f0739c199954c9a59177004783a2a1 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_)
jamesr 2013/02/01 00:26:43 ah sorry, missed this file. This is a bit fragile
+ return;
bool show_ime_if_needed = (show_ime == SHOW_IME_IF_NEEDED);
if (!show_ime_if_needed && !input_method_is_active_)
return;
« content/renderer/render_widget.h ('K') | « content/renderer/render_widget.h ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698