diff options
-rw-r--r-- | chrome/browser/autocomplete/search_provider.cc | 4 | ||||
-rw-r--r-- | chrome/browser/autocomplete/search_provider_unittest.cc | 7 |
2 files changed, 11 insertions, 0 deletions
diff --git a/chrome/browser/autocomplete/search_provider.cc b/chrome/browser/autocomplete/search_provider.cc index 2f123d8..b028587 100644 --- a/chrome/browser/autocomplete/search_provider.cc +++ b/chrome/browser/autocomplete/search_provider.cc @@ -697,6 +697,10 @@ void SearchProvider::AddMatchToMap(const std::wstring& query_string, match.fill_into_edit.assign(L"?"); ++search_start; } + if (is_keyword) { + match.fill_into_edit.append(providers_.keyword_provider().keyword() + L" "); + match.template_url = &providers_.keyword_provider(); + } match.fill_into_edit.append(query_string); // NOTE: All Google suggestions currently start with the original input, but // not all Yahoo! suggestions do. diff --git a/chrome/browser/autocomplete/search_provider_unittest.cc b/chrome/browser/autocomplete/search_provider_unittest.cc index 530e7ee..5b81dc5 100644 --- a/chrome/browser/autocomplete/search_provider_unittest.cc +++ b/chrome/browser/autocomplete/search_provider_unittest.cc @@ -243,4 +243,11 @@ TEST_F(SearchProviderTest, QueryKeywordProvider) { // term keyword. AutocompleteMatch match = FindMatchWithDestination(keyword_url_); ASSERT_TRUE(!match.destination_url.is_empty()); + + // The match should have a TemplateURL. + EXPECT_TRUE(match.template_url); + + // The fill into edit should contain the keyword. + EXPECT_EQ(keyword_t_url_->keyword() + L" " + keyword_term_, + match.fill_into_edit); } |