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

Unified Diff: components/autofill/core/browser/autocomplete_history_manager.cc

Issue 1208133002: [Autofill/Autocomplete Feature] Substring matching instead of prefix matching. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Added |match_start| usage. Created 5 years, 6 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: components/autofill/core/browser/autocomplete_history_manager.cc
diff --git a/components/autofill/core/browser/autocomplete_history_manager.cc b/components/autofill/core/browser/autocomplete_history_manager.cc
index 44e766660ead2209857df440c279c8a45a6b0a3a..2c1fac8ae3abb338c0d358c6449f5c518485e966 100644
--- a/components/autofill/core/browser/autocomplete_history_manager.cc
+++ b/components/autofill/core/browser/autocomplete_history_manager.cc
@@ -103,6 +103,7 @@ void AutocompleteHistoryManager::OnGetAutocompleteSuggestions(
}
if (database_.get()) {
+ pending_query_prefix_ = prefix;
pending_query_handle_ = database_->GetFormValuesForElementName(
name, prefix, kMaxAutocompleteMenuItems, this);
}
@@ -175,8 +176,11 @@ void AutocompleteHistoryManager::SendSuggestions(
}
}
- if (unique)
- autofill_suggestions_.push_back(Suggestion(new_result));
+ if (unique) {
+ Suggestion s(new_result);
+ s.match_start = pending_query_prefix_.size();
+ autofill_suggestions_.push_back(s);
+ }
}
}
« no previous file with comments | « components/autofill/core/browser/autocomplete_history_manager.h ('k') | components/autofill/core/browser/autofill_driver.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698