summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorshess@chromium.org <shess@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2009-04-27 21:15:40 +0000
committershess@chromium.org <shess@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2009-04-27 21:15:40 +0000
commit8982034a08290c86e70a4e6ebaed9055a2fdbe7f (patch)
tree500c377a220a683a1539e351ebe78d828ec7235b
parent8ef0637fffc0ad76943be9a6e3bd72b9e5fab07b (diff)
downloadchromium_src-8982034a08290c86e70a4e6ebaed9055a2fdbe7f.zip
chromium_src-8982034a08290c86e70a4e6ebaed9055a2fdbe7f.tar.gz
chromium_src-8982034a08290c86e70a4e6ebaed9055a2fdbe7f.tar.bz2
Update selected line in model before accepting input when the user clicks in the popup.
BUG=10932 Review URL: http://codereview.chromium.org/93130 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@14659 0039d316-1c4b-4281-b951-d872f2087c98
-rw-r--r--chrome/browser/autocomplete/autocomplete_popup_view_mac.h2
-rw-r--r--chrome/browser/autocomplete/autocomplete_popup_view_mac.mm9
2 files changed, 6 insertions, 5 deletions
diff --git a/chrome/browser/autocomplete/autocomplete_popup_view_mac.h b/chrome/browser/autocomplete/autocomplete_popup_view_mac.h
index 9cb2af7..4a69413 100644
--- a/chrome/browser/autocomplete/autocomplete_popup_view_mac.h
+++ b/chrome/browser/autocomplete/autocomplete_popup_view_mac.h
@@ -72,7 +72,7 @@ class AutocompletePopupViewMac : public AutocompletePopupView {
const std::wstring& ResultContentsAt(size_t i);
bool ResultStarredAt(size_t i);
const std::wstring& ResultDescriptionAt(size_t i);
- void AcceptInput(WindowOpenDisposition disposition, bool for_drop);
+ void AcceptInput();
private:
// Create the popup_ instance if needed.
diff --git a/chrome/browser/autocomplete/autocomplete_popup_view_mac.mm b/chrome/browser/autocomplete/autocomplete_popup_view_mac.mm
index f1dbc8e..4a6a85f 100644
--- a/chrome/browser/autocomplete/autocomplete_popup_view_mac.mm
+++ b/chrome/browser/autocomplete/autocomplete_popup_view_mac.mm
@@ -181,9 +181,10 @@ const std::wstring& AutocompletePopupViewMac::ResultDescriptionAt(size_t i) {
return model_->result().match_at(i).description;
}
-void AutocompletePopupViewMac::AcceptInput(
- WindowOpenDisposition disposition, bool for_drop) {
- edit_view_->AcceptInput(disposition, for_drop);
+void AutocompletePopupViewMac::AcceptInput() {
+ NSTableView* table = [popup_ contentView];
+ model_->SetSelectedLine([table selectedRow], false);
+ edit_view_->AcceptInput(CURRENT_TAB, false);
}
@implementation AutocompleteTableTarget
@@ -249,7 +250,7 @@ objectValueForTableColumn:(NSTableColumn*)aTableColumn
- (void)select:sender {
DCHECK(popup_view_);
- popup_view_->AcceptInput(CURRENT_TAB, false);
+ popup_view_->AcceptInput();
}
@end