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

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

Issue 970403002: Don't suggest autofill profiles that are subsets of other profiles. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 5 years, 10 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
« no previous file with comments | « no previous file | components/autofill/core/browser/autofill_profile.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: components/autofill/core/browser/autofill_manager.cc
diff --git a/components/autofill/core/browser/autofill_manager.cc b/components/autofill/core/browser/autofill_manager.cc
index 20121fc6410def11ac0c61cb2b0d51b134c00977..a822ec9c95f6eef2e88e0855df9fb28da09f236c 100644
--- a/components/autofill/core/browser/autofill_manager.cc
+++ b/components/autofill/core/browser/autofill_manager.cc
@@ -67,20 +67,6 @@ const size_t kMaxRecentFormSignaturesToRemember = 3;
// cache, simply to prevent unbounded memory consumption.
const size_t kMaxFormCacheSize = 100;
-// Removes duplicate suggestions whilst preserving their original order.
-void RemoveDuplicateSuggestions(std::vector<Suggestion>* suggestions) {
- std::set<std::pair<base::string16, base::string16>> seen_suggestions;
-
- for (int i = 0; i < static_cast<int>(suggestions->size()); ++i) {
- if (!seen_suggestions.insert(std::make_pair(
- (*suggestions)[i].value, (*suggestions)[i].label)).second) {
- // Duplicate found, delete it.
- suggestions->erase(suggestions->begin() + i);
- i--;
- }
- }
-}
-
// Precondition: |form_structure| and |form| should correspond to the same
// logical form. Returns true if any field in the given |section| within |form|
// is auto-filled.
@@ -534,13 +520,6 @@ void AutofillManager::OnQueryFormFieldAutofill(int query_id,
}
}
- // When filling credit card suggestions, the values and labels are
- // typically obfuscated, which makes detecting duplicates hard. Since
- // duplicates only tend to be a problem when filling address forms
- // anyway, only don't de-dup credit card suggestions.
- if (!is_filling_credit_card)
- RemoveDuplicateSuggestions(&suggestions);
-
// The first time we show suggestions on this page, log the number of
// suggestions available.
// TODO(mathp): Differentiate between number of suggestions available
« no previous file with comments | « no previous file | components/autofill/core/browser/autofill_profile.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698