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

Unified Diff: components/autofill/content/renderer/password_autofill_agent.cc

Issue 2947403003: Prefer the exact match over prefix match for the password manager filling.
Patch Set: Prefer the exact match over prefix match. Created 3 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/content/renderer/password_autofill_agent.cc
diff --git a/components/autofill/content/renderer/password_autofill_agent.cc b/components/autofill/content/renderer/password_autofill_agent.cc
index e55f1988a3cea78d960e13538346351a51c9e673..ac1e4060717f3ffa5f834681e459db870d76cc5e 100644
--- a/components/autofill/content/renderer/password_autofill_agent.cc
+++ b/components/autofill/content/renderer/password_autofill_agent.cc
@@ -452,8 +452,14 @@ bool FillUserNameAndPassword(
base::string16 username;
base::string16 password;
- FindMatchesByUsername(fill_data, current_username, exact_username_match,
- logger, &username, &password);
+ FindMatchesByUsername(fill_data, current_username,
+ true /* exact_username_match */, logger, &username,
+ &password);
+
+ if (!exact_username_match && password.empty()) {
+ FindMatchesByUsername(fill_data, current_username, exact_username_match,
+ logger, &username, &password);
+ }
if (password.empty())
return false;

Powered by Google App Engine
This is Rietveld 408576698