summaryrefslogtreecommitdiffstats
path: root/chrome/browser/ime_input.cc
diff options
context:
space:
mode:
authorhbono@chromium.org <hbono@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2010-05-28 06:29:33 +0000
committerhbono@chromium.org <hbono@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2010-05-28 06:29:33 +0000
commitb49eb8716bbae4181c840c4a010665e3cc5aea8f (patch)
tree4403a0e756accca746a1d0f1468df60ea9fb7eb4 /chrome/browser/ime_input.cc
parentf649c5eda1375c0499ba93f2b10f3c573df8c3f8 (diff)
downloadchromium_src-b49eb8716bbae4181c840c4a010665e3cc5aea8f.zip
chromium_src-b49eb8716bbae4181c840c4a010665e3cc5aea8f.tar.gz
chromium_src-b49eb8716bbae4181c840c4a010665e3cc5aea8f.tar.bz2
Cancels an ongoing IME composition when receiving an IME_CANCEL_COMPOSITION event on Windows.
This change just adds ImeInput::CancelIME() and use it when receiving an IME_CANCEL_COMPOSITION event. (I'm not sure it works well with all IMEs, though.) BUG=9883 TEST=none Review URL: http://codereview.chromium.org/2099012 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@48470 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'chrome/browser/ime_input.cc')
-rw-r--r--chrome/browser/ime_input.cc13
1 files changed, 12 insertions, 1 deletions
diff --git a/chrome/browser/ime_input.cc b/chrome/browser/ime_input.cc
index 21b5229..3f60670 100644
--- a/chrome/browser/ime_input.cc
+++ b/chrome/browser/ime_input.cc
@@ -1,4 +1,4 @@
-// Copyright (c) 2006-2008 The Chromium Authors. All rights reserved.
+// Copyright (c) 2010 The Chromium Authors. All rights reserved.
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.
@@ -304,6 +304,17 @@ void ImeInput::DisableIME(HWND window_handle) {
::ImmAssociateContextEx(window_handle, NULL, 0);
}
+void ImeInput::CancelIME(HWND window_handle) {
+ if (is_composing_) {
+ HIMC imm_context = ::ImmGetContext(window_handle);
+ if (imm_context) {
+ ::ImmNotifyIME(imm_context, NI_COMPOSITIONSTR, CPS_CANCEL, 0);
+ ::ImmReleaseContext(window_handle, imm_context);
+ }
+ ResetComposition(window_handle);
+ }
+}
+
void ImeInput::EnableIME(HWND window_handle,
const gfx::Rect& caret_rect,
bool complete) {