summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorhbono@chromium.org <hbono@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2009-08-19 08:35:17 +0000
committerhbono@chromium.org <hbono@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2009-08-19 08:35:17 +0000
commitb5bdca8334d91521cead662c49e2af90ce9602da (patch)
tree7fd51e15bc70d77df6be1ed14b32983174be9d27
parent93539982f59384355b07ae0581e07d0c5fd3300c (diff)
downloadchromium_src-b5bdca8334d91521cead662c49e2af90ce9602da.zip
chromium_src-b5bdca8334d91521cead662c49e2af90ce9602da.tar.gz
chromium_src-b5bdca8334d91521cead662c49e2af90ce9602da.tar.bz2
A quick fix for Issue 19421.
This issue is caused by AutocompleteEditViewMac::SetText() that updates the value of an AutocompleteEditField instance while an input method is composing text. Same as Windows, NSTextView finishes an ongoing composition when we update the value of an AutocompleteEditField object. To fix this issue, we check whether or not NSTextView has marked text and exit if it has. BUG=19421 "Korean IME does not work in the omnibox" TEST=Select Korean 2-set keyboard, type 'g', 'k', 's', 'r', 'm', 'f' keys, and verify we can see two Korean syllables. +rohitrao for reviewers since shess is out for the week Review URL: http://codereview.chromium.org/171103 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@23702 0039d316-1c4b-4281-b951-d872f2087c98
-rw-r--r--chrome/browser/autocomplete/autocomplete_edit_view_mac.mm12
1 files changed, 12 insertions, 0 deletions
diff --git a/chrome/browser/autocomplete/autocomplete_edit_view_mac.mm b/chrome/browser/autocomplete/autocomplete_edit_view_mac.mm
index 5843584..feb7b453 100644
--- a/chrome/browser/autocomplete/autocomplete_edit_view_mac.mm
+++ b/chrome/browser/autocomplete/autocomplete_edit_view_mac.mm
@@ -364,6 +364,18 @@ void AutocompleteEditViewMac::ClosePopup() {
}
void AutocompleteEditViewMac::SetText(const std::wstring& display_text) {
+ // Exit if an input method is composing text.
+ // 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];