summaryrefslogtreecommitdiffstats
path: root/views/controls
diff options
context:
space:
mode:
authorhbono@chromium.org <hbono@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2009-05-26 22:16:19 +0000
committerhbono@chromium.org <hbono@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2009-05-26 22:16:19 +0000
commit3ca3baa83e12bde14fbc453c963bc7bdfe477fa3 (patch)
tree3f3789e24e7b9607a01f89e77d58011444acded3 /views/controls
parent75ae666eca3866f94338e3ed9ccd6a1a672f3429 (diff)
downloadchromium_src-3ca3baa83e12bde14fbc453c963bc7bdfe477fa3.zip
chromium_src-3ca3baa83e12bde14fbc453c963bc7bdfe477fa3.tar.gz
chromium_src-3ca3baa83e12bde14fbc453c963bc7bdfe477fa3.tar.bz2
A quick fix for Issue 11863 (Take 2).
This change is exactly the same change as <http://codereview.chromium.org/115353>. I would like to re-send this change because the PC that I created this original change has been dead and I have not been able to commit. This issue is caused by a stupid mistake of mine that I forgot adding a WM_IME_ENDCOMPOSITION handler to update the find results when a composition is finished (or canceled). This change adds a handler for WM_IME_ENDCOMPOSITION messages to update the find results. BUG=11863 "Korean find-in-page: Backspace all the way, Chrome will highlight all the characters that contain the first consonant" TEST=Open a Korean page, type Control+F keys, Switch the input language to Korean, type a right-alt key, type a 'w' key, type a 'k' key, type a 'a' key, type a backspace key, and verify there are not any highlited characters. Review URL: http://codereview.chromium.org/113847 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@16934 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'views/controls')
-rw-r--r--views/controls/text_field.cc16
1 files changed, 16 insertions, 0 deletions
diff --git a/views/controls/text_field.cc b/views/controls/text_field.cc
index 3ca548c..1d00321 100644
--- a/views/controls/text_field.cc
+++ b/views/controls/text_field.cc
@@ -75,6 +75,7 @@ class TextField::Edit
MESSAGE_HANDLER_EX(WM_IME_CHAR, OnImeChar)
MESSAGE_HANDLER_EX(WM_IME_STARTCOMPOSITION, OnImeStartComposition)
MESSAGE_HANDLER_EX(WM_IME_COMPOSITION, OnImeComposition)
+ MESSAGE_HANDLER_EX(WM_IME_ENDCOMPOSITION, OnImeEndComposition)
MSG_WM_KEYDOWN(OnKeyDown)
MSG_WM_LBUTTONDBLCLK(OnLButtonDblClk)
MSG_WM_LBUTTONDOWN(OnLButtonDown)
@@ -123,6 +124,7 @@ class TextField::Edit
LRESULT OnImeChar(UINT message, WPARAM wparam, LPARAM lparam);
LRESULT OnImeStartComposition(UINT message, WPARAM wparam, LPARAM lparam);
LRESULT OnImeComposition(UINT message, WPARAM wparam, LPARAM lparam);
+ LRESULT OnImeEndComposition(UINT message, WPARAM wparam, LPARAM lparam);
void OnKeyDown(TCHAR key, UINT repeat_count, UINT flags);
void OnLButtonDblClk(UINT keys, const CPoint& point);
void OnLButtonDown(UINT keys, const CPoint& point);
@@ -504,6 +506,20 @@ LRESULT TextField::Edit::OnImeComposition(UINT message,
return result;
}
+LRESULT TextField::Edit::OnImeEndComposition(UINT message,
+ WPARAM wparam,
+ LPARAM lparam) {
+ // Bug 11863: Korean IMEs send a WM_IME_ENDCOMPOSITION message without
+ // sending any WM_IME_COMPOSITION messages when a user deletes all
+ // composition characters, i.e. a composition string becomes empty. To handle
+ // this case, we need to update the find results when a composition is
+ // finished or canceled.
+ parent_->SyncText();
+ if (parent_->GetController())
+ parent_->GetController()->ContentsChanged(parent_, GetText());
+ return DefWindowProc(message, wparam, lparam);
+}
+
void TextField::Edit::OnKeyDown(TCHAR key, UINT repeat_count, UINT flags) {
// NOTE: Annoyingly, ctrl-alt-<key> generates WM_KEYDOWN rather than
// WM_SYSKEYDOWN, so we need to check (flags & KF_ALTDOWN) in various places