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

Unified Diff: chrome/browser/ui/search/instant_controller.cc

Issue 15732014: InstantExtended: Send SearchProvider suggestions to the page. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Filter navsuggest and add tests. Created 7 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
Index: chrome/browser/ui/search/instant_controller.cc
diff --git a/chrome/browser/ui/search/instant_controller.cc b/chrome/browser/ui/search/instant_controller.cc
index 2d4fe0a2e327cae9791d67ed33f8222df9315176..e6e9bdd305e8cc1066c573e052653baed6c1c59a 100644
--- a/chrome/browser/ui/search/instant_controller.cc
+++ b/chrome/browser/ui/search/instant_controller.cc
@@ -652,13 +652,19 @@ void InstantController::HandleAutocompleteResults(
} else {
for (ACProviders::const_iterator provider = providers.begin();
provider != providers.end(); ++provider) {
- // We are talking to remote NTP, skip SearchProvider, since it only echoes
- // suggestions.
- if ((*provider)->type() == AutocompleteProvider::TYPE_SEARCH)
- continue;
-
for (ACMatches::const_iterator match = (*provider)->matches().begin();
match != (*provider)->matches().end(); ++match) {
+ // When the top match is an inline history URL, the page calls
+ // SetSuggestions(url) which calls FinalizeInstantQuery() in
+ // SearchProvider creating a NAVSUGGEST match for the URL. If we sent
+ // this NAVSUGGEST match back to the page, it would be deduped against
+ // the original history match and replace it. But since the page ignores
+ // SearchProvider suggestions, the match would then disappear. Yuck.
+ // TODO(jered): Remove this when FinalizeInstantQuery() is ripped out.
+ if ((*provider)->type() == AutocompleteProvider::TYPE_SEARCH &&
+ match->type == AutocompleteMatchType::NAVSUGGEST) {
+ continue;
+ }
InstantAutocompleteResult result;
PopulateInstantAutocompleteResultFromMatch(*match, kNoMatchIndex,
&result);
« no previous file with comments | « chrome/browser/ui/search/instant_controller.h ('k') | chrome/browser/ui/search/instant_extended_interactive_uitest.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698