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

Unified Diff: chrome/views/controls/text_field.cc

Issue 42621: Moving WM_IME_CHAR handling out of the FocusManager (Closed) Base URL: svn://chrome-svn/chrome/trunk/src/
Patch Set: '' Created 11 years, 9 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
« no previous file with comments | « no previous file | chrome/views/focus/focus_manager.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: chrome/views/controls/text_field.cc
===================================================================
--- chrome/views/controls/text_field.cc (revision 12559)
+++ chrome/views/controls/text_field.cc (working copy)
@@ -73,6 +73,7 @@
MSG_WM_CREATE(OnCreate)
MSG_WM_CUT(OnCut)
MSG_WM_DESTROY(OnDestroy)
+ MESSAGE_HANDLER_EX(WM_IME_CHAR, OnImeChar)
MESSAGE_HANDLER_EX(WM_IME_STARTCOMPOSITION, OnImeStartComposition)
MESSAGE_HANDLER_EX(WM_IME_COMPOSITION, OnImeComposition)
MSG_WM_KEYDOWN(OnKeyDown)
@@ -121,6 +122,7 @@
LRESULT OnCreate(CREATESTRUCT* create_struct);
void OnCut();
void OnDestroy();
+ LRESULT OnImeChar(UINT message, WPARAM wparam, LPARAM lparam);
LRESULT OnImeStartComposition(UINT message, WPARAM wparam, LPARAM lparam);
LRESULT OnImeComposition(UINT message, WPARAM wparam, LPARAM lparam);
void OnKeyDown(TCHAR key, UINT repeat_count, UINT flags);
@@ -439,6 +441,15 @@
TRACK_HWND_DESTRUCTION(m_hWnd);
}
+LRESULT TextField::Edit::OnImeChar(UINT message, WPARAM wparam, LPARAM lparam) {
+ // http://crbug.com/7707: a rich-edit control may crash when it receives a
+ // WM_IME_CHAR message while it is processing a WM_IME_COMPOSITION message.
+ // Since view controls don't need WM_IME_CHAR messages, we prevent WM_IME_CHAR
+ // messages from being dispatched to view controls via the CallWindowProc()
+ // call.
+ return 0;
+}
+
LRESULT TextField::Edit::OnImeStartComposition(UINT message,
WPARAM wparam,
LPARAM lparam) {
« no previous file with comments | « no previous file | chrome/views/focus/focus_manager.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698