diff options
author | suzhe@chromium.org <suzhe@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2010-12-09 20:18:24 +0000 |
---|---|---|
committer | suzhe@chromium.org <suzhe@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2010-12-09 20:18:24 +0000 |
commit | 4bb2c404e6f9fe9ce90f6164726ccc43adfb65b9 (patch) | |
tree | a858bb34fe56a253b4fdb308797e26022d742d78 /chrome/browser/autocomplete | |
parent | 93066a119beb49642444df4111184212dd503398 (diff) | |
download | chromium_src-4bb2c404e6f9fe9ce90f6164726ccc43adfb65b9.zip chromium_src-4bb2c404e6f9fe9ce90f6164726ccc43adfb65b9.tar.gz chromium_src-4bb2c404e6f9fe9ce90f6164726ccc43adfb65b9.tar.bz2 |
Checks whether the autocomplete controller can accept keywords before the composition text of input methods sets in the omnibox. This will prevent committing the current composition text incorrectly.
BUG=61204
TEST=Enter the keyword of an extension and type space, and inserting text with an input method, then the composition text should not be committed.
Review URL: http://codereview.chromium.org/4103011
git-svn-id: svn://svn.chromium.org/chrome/trunk/src@68761 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'chrome/browser/autocomplete')
-rw-r--r-- | chrome/browser/autocomplete/autocomplete_edit_view_mac.h | 1 | ||||
-rw-r--r-- | chrome/browser/autocomplete/autocomplete_edit_view_mac.mm | 5 |
2 files changed, 6 insertions, 0 deletions
diff --git a/chrome/browser/autocomplete/autocomplete_edit_view_mac.h b/chrome/browser/autocomplete/autocomplete_edit_view_mac.h index 06d5e09..d486cc5 100644 --- a/chrome/browser/autocomplete/autocomplete_edit_view_mac.h +++ b/chrome/browser/autocomplete/autocomplete_edit_view_mac.h @@ -74,6 +74,7 @@ class AutocompleteEditViewMac : public AutocompleteEditView, bool save_original_selection); virtual bool OnInlineAutocompleteTextMaybeChanged( const std::wstring& display_text, size_t user_text_length); + virtual void OnStartingIME(); virtual void OnRevertTemporaryText(); virtual void OnBeforePossibleChange(); virtual bool OnAfterPossibleChange(); diff --git a/chrome/browser/autocomplete/autocomplete_edit_view_mac.mm b/chrome/browser/autocomplete/autocomplete_edit_view_mac.mm index 97981f9..15d0f97 100644 --- a/chrome/browser/autocomplete/autocomplete_edit_view_mac.mm +++ b/chrome/browser/autocomplete/autocomplete_edit_view_mac.mm @@ -627,6 +627,11 @@ void AutocompleteEditViewMac::OnTemporaryTextMaybeChanged( [field_ clearUndoChain]; } +void AutocompleteEditViewMac::OnStartingIME() { + if (model_->is_keyword_hint() && !model_->keyword().empty()) + model_->AcceptKeyword(); +} + bool AutocompleteEditViewMac::OnInlineAutocompleteTextMaybeChanged( const std::wstring& display_text, size_t user_text_length) { // TODO(shess): Make sure that this actually works. The round trip |