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

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

Issue 116006: Mac: Make sure the popup is closed when losing focus in omnibox. (Closed)
Patch Set: Created 11 years, 7 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
diff --git a/chrome/browser/autocomplete/autocomplete_edit_view_mac.mm b/chrome/browser/autocomplete/autocomplete_edit_view_mac.mm
index 0a22805b31cb63121c3eef57a962ea11686ea27b..d0d1db4421de04f419b2a30d3ee1ef747ae6e007 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.
}
« 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