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

Unified Diff: components/autofill/core/common/password_form_fill_data.cc

Issue 2747733004: [Password Manager] Send username correction votes (Closed)
Patch Set: Changes addressed to reviewer comments Created 3 years, 9 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/common/password_form_fill_data.cc
diff --git a/components/autofill/core/common/password_form_fill_data.cc b/components/autofill/core/common/password_form_fill_data.cc
index a75d9c5e3cac79f8def31eabcda66818e77f9434..82882dd32a899479bea830448dfe7f17539d7913 100644
--- a/components/autofill/core/common/password_form_fill_data.cc
+++ b/components/autofill/core/common/password_form_fill_data.cc
@@ -11,6 +11,20 @@
namespace autofill {
+namespace {
+
+// Extracts username values from |values_and_field_names| and inserts to
+// |values|.
+void InsertUsernameValues(const PossibleUsernamesVector& values_and_field_names,
+ std::vector<base::string16>* values) {
+ DCHECK(values && values->empty());
+
+ for (auto& pair : values_and_field_names)
dvadym 2017/03/22 10:56:18 Nit: const auto&
kolos1 2017/03/22 13:40:39 Done.
+ values->push_back(pair.first);
+}
+
+} // namespace
+
UsernamesCollectionKey::UsernamesCollectionKey() {}
UsernamesCollectionKey::~UsernamesCollectionKey() {}
@@ -84,8 +98,8 @@ void InitPasswordFormFillData(
if (it.second->is_public_suffix_match ||
it.second->is_affiliation_based_match)
key.realm = it.second->signon_realm;
- result->other_possible_usernames[key] =
- it.second->other_possible_usernames;
+ InsertUsernameValues(it.second->other_possible_usernames,
+ &result->other_possible_usernames[key]);
dvadym 2017/03/22 10:56:18 Could you please remove sending OtherPossibleUsern
kolos1 2017/03/22 13:40:39 Agree. Created a separate CL for that (https://cod
}
}
}

Powered by Google App Engine
This is Rietveld 408576698