From 143e0135fd5e70e152dec0e9fdb4a8aa122dbb3c Mon Sep 17 00:00:00 2001 From: "isherman@chromium.org" Date: Wed, 1 Sep 2010 23:06:24 +0000 Subject: OS X: Clicking on search keyword autocomplete result should update the omnibox BUG=54052 TEST=none Review URL: http://codereview.chromium.org/3300004 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@58264 0039d316-1c4b-4281-b951-d872f2087c98 --- chrome/browser/autocomplete/autocomplete_popup_view_mac.h | 3 +++ chrome/browser/autocomplete/autocomplete_popup_view_mac.mm | 7 ++++++- 2 files changed, 9 insertions(+), 1 deletion(-) (limited to 'chrome') diff --git a/chrome/browser/autocomplete/autocomplete_popup_view_mac.h b/chrome/browser/autocomplete/autocomplete_popup_view_mac.h index a5e4e9a..e0a27d5 100644 --- a/chrome/browser/autocomplete/autocomplete_popup_view_mac.h +++ b/chrome/browser/autocomplete/autocomplete_popup_view_mac.h @@ -62,6 +62,9 @@ class AutocompletePopupViewMac : public AutocompletePopupView { } virtual void UpdatePopupAppearance(); + // Set |line| to be selected. + void SetSelectedLine(size_t line); + // This is only called by model in SetSelectedLine() after updating // everything. Popup should already be visible. virtual void PaintUpdatesNow(); diff --git a/chrome/browser/autocomplete/autocomplete_popup_view_mac.mm b/chrome/browser/autocomplete/autocomplete_popup_view_mac.mm index 5adc929..c53fb4d 100644 --- a/chrome/browser/autocomplete/autocomplete_popup_view_mac.mm +++ b/chrome/browser/autocomplete/autocomplete_popup_view_mac.mm @@ -448,6 +448,10 @@ void AutocompletePopupViewMac::UpdatePopupAppearance() { PositionPopup(rows * cellHeight); } +void AutocompletePopupViewMac::SetSelectedLine(size_t line) { + model_->SetSelectedLine(line, false); +} + // This is only called by model in SetSelectedLine() after updating // everything. Popup should already be visible. void AutocompletePopupViewMac::PaintUpdatesNow() { @@ -673,7 +677,8 @@ void AutocompletePopupViewMac::OpenURLForRow(int row, bool force_background) { NSInteger row, column; if ([self getRow:&row column:&column forPoint:point]) { DCHECK_EQ(column, 0); - [self selectCellAtRow:row column:column]; + DCHECK(popupView_); + popupView_->SetSelectedLine(row); return YES; } return NO; -- cgit v1.1