summaryrefslogtreecommitdiffstats
path: root/chrome
diff options
context:
space:
mode:
authorisherman@chromium.org <isherman@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2010-11-19 08:01:01 +0000
committerisherman@chromium.org <isherman@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2010-11-19 08:01:01 +0000
commitafff21e3a947accb6c57cb5d5d170a11de23f80f (patch)
treeba35a8b6d8158ad0f99b7e13ab744d8334ce0a4d /chrome
parent6a13e6b8080b08cde1a57e8210a943bb93007b78 (diff)
downloadchromium_src-afff21e3a947accb6c57cb5d5d170a11de23f80f.zip
chromium_src-afff21e3a947accb6c57cb5d5d170a11de23f80f.tar.gz
chromium_src-afff21e3a947accb6c57cb5d5d170a11de23f80f.tar.bz2
Don't show autocomplete suggestions redundant with autofill suggestions.
BUG=63410 TEST=unit_tests --gtest_filter=AutoFillManagerTest.* Review URL: http://codereview.chromium.org/5154004 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@66746 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'chrome')
-rw-r--r--chrome/browser/autofill/autofill_manager_unittest.cc2
-rw-r--r--chrome/browser/renderer_host/render_view_host.cc7
2 files changed, 4 insertions, 5 deletions
diff --git a/chrome/browser/autofill/autofill_manager_unittest.cc b/chrome/browser/autofill/autofill_manager_unittest.cc
index 182148d..2a0e9e4 100644
--- a/chrome/browser/autofill/autofill_manager_unittest.cc
+++ b/chrome/browser/autofill/autofill_manager_unittest.cc
@@ -891,6 +891,8 @@ TEST_F(AutoFillManagerTest, GetCombinedAutoFillAndAutocompleteSuggestions) {
// This triggers the combined message send.
std::vector<string16> suggestions;
suggestions.push_back(ASCIIToUTF16("Jay"));
+ // This suggestion is a duplicate, and should be trimmed.
+ suggestions.push_back(ASCIIToUTF16("Elvis"));
suggestions.push_back(ASCIIToUTF16("Jason"));
rvh()->AutocompleteSuggestionsReturned(suggestions);
diff --git a/chrome/browser/renderer_host/render_view_host.cc b/chrome/browser/renderer_host/render_view_host.cc
index c2a8360..9d701fc 100644
--- a/chrome/browser/renderer_host/render_view_host.cc
+++ b/chrome/browser/renderer_host/render_view_host.cc
@@ -1791,11 +1791,8 @@ void RenderViewHost::AutocompleteSuggestionsReturned(
for (size_t i = 0; i < suggestions.size(); ++i) {
bool unique = true;
for (size_t j = 0; j < autofill_values_.size(); ++j) {
- // TODO(isherman): Why just when the label is empty?
- // If the AutoFill label is empty, we need to make sure we don't add a
- // duplicate value.
- if (autofill_labels_[j].empty() &&
- autofill_values_[j] == suggestions[i]) {
+ // Don't add duplicate values.
+ if (autofill_values_[j] == suggestions[i]) {
unique = false;
break;
}