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

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

Issue 2906383003: Teach PasswordAutofillAgent sometimes match prefixes of usernames (Closed)
Patch Set: . 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/core/common/autofill_util.cc
diff --git a/components/autofill/core/common/autofill_util.cc b/components/autofill/core/common/autofill_util.cc
index 50e50176d8c336e700bef8af1c7e6bfd865250fd..edde2d48c5ecd6e613f0460ee5f51fecf62fd831 100644
--- a/components/autofill/core/common/autofill_util.cc
+++ b/components/autofill/core/common/autofill_util.cc
@@ -115,6 +115,12 @@ bool FieldIsSuggestionSubstringStartingOnTokenBoundary(
base::string16::npos;
}
+bool IsPrefixOfEmailEndingWithAtSign(const base::string16& full_string,
+ const base::string16& prefix) {
+ return base::StartsWith(full_string, prefix + base::UTF8ToUTF16(""),
vabr (Chromium) 2017/06/21 12:28:07 "" -> "@"
+ base::CompareCase::SENSITIVE);
+}
+
size_t GetTextSelectionStart(const base::string16& suggestion,
const base::string16& field_contents,
bool case_sensitive) {

Powered by Google App Engine
This is Rietveld 408576698