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

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

Issue 2893633002: [Password Manager] Make filling robust against changing url by JavaScript (Closed)
Patch Set: Test added Created 3 years, 7 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_form_conversion_utils.cc
diff --git a/components/autofill/content/renderer/password_form_conversion_utils.cc b/components/autofill/content/renderer/password_form_conversion_utils.cc
index 5d56dc545bee414ea11b71317057401f2708b16b..825f44621b91938fe3c784629d38498141d2b701 100644
--- a/components/autofill/content/renderer/password_form_conversion_utils.cc
+++ b/components/autofill/content/renderer/password_form_conversion_utils.cc
@@ -593,10 +593,7 @@ bool GetPasswordForm(
password_form->origin =
form_util::GetCanonicalOriginForDocument(form.document);
- GURL::Replacements rep;
- rep.SetPathStr("");
- password_form->signon_realm =
- password_form->origin.ReplaceComponents(rep).spec();
+ password_form->signon_realm = GetSignOnRealm(password_form->origin);
password_form->other_possible_usernames.swap(other_possible_usernames);
if (!password.IsNull()) {
@@ -781,4 +778,10 @@ bool IsCreditCardVerificationPasswordField(
MatchesPattern(field.GetAttribute("name").Utf16(), kCardCvcReCached);
}
+std::string GetSignOnRealm(const GURL& origin) {
kolos1 2017/05/18 09:52:53 There might be confusion with GetSignonRealm from
dvadym 2017/05/18 11:08:52 GetSignOnRealm is very good name :). I don't think
kolos1 2017/05/18 11:11:50 Acknowledged.
+ GURL::Replacements rep;
+ rep.SetPathStr("");
kolos1 2017/05/18 09:52:53 Shall we also clear Query, Ref, Username, Password
dvadym 2017/05/18 11:08:52 This is just extracting of logic that we had for c
kolos1 2017/05/18 11:11:50 Acknowledged.
+ return origin.ReplaceComponents(rep).spec();
+}
+
} // namespace autofill

Powered by Google App Engine
This is Rietveld 408576698