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

Unified Diff: chrome/browser/autocomplete/autocomplete_edit_view_mac.mm

Issue 171103: A quick fix for Issue 19421.... (Closed) Base URL: svn://chrome-svn/chrome/trunk/src/
Patch Set: Created 11 years, 4 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 | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: chrome/browser/autocomplete/autocomplete_edit_view_mac.mm
===================================================================
--- chrome/browser/autocomplete/autocomplete_edit_view_mac.mm (revision 23601)
+++ chrome/browser/autocomplete/autocomplete_edit_view_mac.mm (working copy)
@@ -362,6 +362,18 @@
}
void AutocompleteEditViewMac::SetText(const std::wstring& display_text) {
+ // Exit if an input method is composing text.
rohitrao (ping after 24h) 2009/08/18 21:42:35 Is this guaranteed to be called again once the tex
Hironori Bono 2009/08/19 05:23:38 Yes. This function is called when this NSTextField
+ // NSTextView finishes an ongoing composition when updating the value of an
+ // NSTextField instance. This prevents inputting non-ASCII characters which
+ // need input methods, such as Latin characters, CJK characters, etc.
+ // To prevent updating this NSTextField value while an input method is
+ // composing text, we check whether or not the field editor for this control
+ // has marked text, text being composed by an input method, and return if
+ // the editor has marked text.
+ NSTextView* text_view = static_cast<NSTextView*>([field_ currentEditor]);
+ if (text_view && [text_view hasMarkedText])
+ return;
+
NSString* ss = base::SysWideToNSString(display_text);
NSMutableAttributedString* as =
[[[NSMutableAttributedString alloc] initWithString:ss] autorelease];
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698