diff options
author | shess@chromium.org <shess@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2009-05-20 00:11:36 +0000 |
---|---|---|
committer | shess@chromium.org <shess@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2009-05-20 00:11:36 +0000 |
commit | 8582b16142aee838ff892cf43ab9da7c413d310f (patch) | |
tree | dafd089c4eccac564b6037268c0a99dc66dcdd93 /chrome/browser | |
parent | 479c0872c85513f61aeddaadff7e3b673ee11701 (diff) | |
download | chromium_src-8582b16142aee838ff892cf43ab9da7c413d310f.zip chromium_src-8582b16142aee838ff892cf43ab9da7c413d310f.tar.gz chromium_src-8582b16142aee838ff892cf43ab9da7c413d310f.tar.bz2 |
Mac: Make sure the popup is closed when losing focus in omnibox.
Moved detection from -controlTextDidEndEditing: to
-control:textShouldEditEditing: in case any of the code depends on
still having focus when this happens.
http://crbug.com/12252
TEST=Type "word" in omnibox. Click on page. Popup should dissappear.
Review URL: http://codereview.chromium.org/116006
git-svn-id: svn://svn.chromium.org/chrome/trunk/src@16441 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'chrome/browser')
-rw-r--r-- | chrome/browser/autocomplete/autocomplete_edit_view_mac.mm | 8 |
1 files changed, 7 insertions, 1 deletions
diff --git a/chrome/browser/autocomplete/autocomplete_edit_view_mac.mm b/chrome/browser/autocomplete/autocomplete_edit_view_mac.mm index 0a22805..d0d1db4 100644 --- a/chrome/browser/autocomplete/autocomplete_edit_view_mac.mm +++ b/chrome/browser/autocomplete/autocomplete_edit_view_mac.mm @@ -443,6 +443,10 @@ void AutocompleteEditViewMac::OnSetFocus(bool f) { model_->OnSetFocus(f); } void AutocompleteEditViewMac::OnKillFocus() { + // TODO(shess): This would seem to be a job for |model_|. + ClosePopup(); + + // Tell the model to reset itself. model_->OnKillFocus(); } void AutocompleteEditViewMac::AcceptInput( @@ -524,9 +528,11 @@ void AutocompleteEditViewMac::FocusLocation() { edit_view_->OnBeforePossibleChange(); } -- (void)controlTextDidEndEditing:(NSNotification*)aNotification { +- (BOOL)control:(NSControl*)control textShouldEndEditing:(NSText*)fieldEditor { edit_view_->OnKillFocus(); + return YES; + // TODO(shess): Figure out where the selection belongs. On GTK, // it's set to the start of the text. } |