Chromium Code Reviews| Index: chrome/browser/autocomplete/keyword_provider.cc |
| =================================================================== |
| --- chrome/browser/autocomplete/keyword_provider.cc (revision 81359) |
| +++ chrome/browser/autocomplete/keyword_provider.cc (working copy) |
| @@ -179,11 +179,12 @@ |
| !remaining_input.empty(), |
| &keyword_matches); |
| - // Prune any extension keywords that are disallowed in incognito mode (if |
| - // we're incognito), or disabled. |
| for (std::vector<string16>::iterator i(keyword_matches.begin()); |
| i != keyword_matches.end(); ) { |
| const TemplateURL* template_url(model->GetTemplateURLForKeyword(*i)); |
| + |
| + // Prune any extension keywords that are disallowed in incognito mode (if |
| + // we're incognito), or disabled. |
| if (profile_ && |
| input.matches_requested() == AutocompleteInput::ALL_MATCHES && |
| template_url->IsExtensionKeyword()) { |
| @@ -198,6 +199,14 @@ |
| continue; |
| } |
| } |
| + |
| + // Prune any substituting keywords if there is no substitution. |
| + if (TemplateURL::SupportsReplacement(template_url) && |
| + !input.allow_exact_keyword_match()) { |
| + i = keyword_matches.erase(i); |
| + continue; |
| + } |
| + |
| ++i; |
| } |
| if (keyword_matches.empty()) |
| @@ -425,8 +434,10 @@ |
| FillInURLAndContents(remaining_input, element, &result); |
| if (supports_replacement) |
| - result.template_url = element; |
| + result.keyword_url = element; |
|
Peter Kasting
2011/04/13 21:06:59
Seems like this should be set regardless of |suppo
|
| result.transition = PageTransition::KEYWORD; |
| + result.keyword_state = AutocompleteMatch::KEYWORD; |
| + result.keyword.assign(keyword); |
|
Peter Kasting
2011/04/13 21:06:59
Nit: Just use =
|
| // Create popup entry description based on the keyword name. |
| if (!element->IsExtensionKeyword()) { |