summaryrefslogtreecommitdiffstats
path: root/chrome
diff options
context:
space:
mode:
authortony@chromium.org <tony@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2010-04-15 05:01:26 +0000
committertony@chromium.org <tony@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2010-04-15 05:01:26 +0000
commit7f00efae66f465dffe5b647a1e2616e0daa19987 (patch)
treed95e1c9ac7d6b27301e007fd21182a2541313d28 /chrome
parent63eddf23110f5b680d49cdd1985a6f1240e54801 (diff)
downloadchromium_src-7f00efae66f465dffe5b647a1e2616e0daa19987.zip
chromium_src-7f00efae66f465dffe5b647a1e2616e0daa19987.tar.gz
chromium_src-7f00efae66f465dffe5b647a1e2616e0daa19987.tar.bz2
Add an IME_CANCEL_COMPOSITION event. This is fired if
webkit can't handle the composition for some reason. For example, if the text field is disabled, we send this message back to the browser process. Review URL: http://codereview.chromium.org/1539037 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@44621 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'chrome')
-rw-r--r--chrome/common/render_messages.h1
-rw-r--r--chrome/renderer/render_widget.cc10
2 files changed, 8 insertions, 3 deletions
diff --git a/chrome/common/render_messages.h b/chrome/common/render_messages.h
index c76b430..cff7401 100644
--- a/chrome/common/render_messages.h
+++ b/chrome/common/render_messages.h
@@ -446,6 +446,7 @@ enum ViewHostMsg_ImeControl {
IME_DISABLE = 0,
IME_MOVE_WINDOWS,
IME_COMPLETE_COMPOSITION,
+ IME_CANCEL_COMPOSITION,
};
// Parameters for creating an audio output stream.
diff --git a/chrome/renderer/render_widget.cc b/chrome/renderer/render_widget.cc
index 77ec85f..d7676ed 100644
--- a/chrome/renderer/render_widget.cc
+++ b/chrome/renderer/render_widget.cc
@@ -710,9 +710,13 @@ void RenderWidget::OnImeSetComposition(WebCompositionCommand command,
if (!webwidget_)
return;
ime_control_busy_ = true;
- webwidget_->handleCompositionEvent(command, cursor_position,
- target_start, target_end,
- ime_string);
+ if (!webwidget_->handleCompositionEvent(command, cursor_position,
+ target_start, target_end, ime_string)) {
+ // If the composition event can't be handled, let the browser process
+ // know so it can update it's state.
+ Send(new ViewHostMsg_ImeUpdateStatus(routing_id(), IME_CANCEL_COMPOSITION,
+ WebRect()));
+ }
ime_control_busy_ = false;
}