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

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

Issue 2900713003: [Password Manager, merge to M-59] Make filling robust against changing url by JavaScript. (Closed)
Patch Set: fix merge 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
« no previous file with comments | « components/autofill/content/renderer/password_form_conversion_utils.h ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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 1a0f3d7ed8f9ecb88bbbe0dff1ecc03cfe364dc1..aed99de70572a1983075a952062fd0bd8594e4a8 100644
--- a/components/autofill/content/renderer/password_form_conversion_utils.cc
+++ b/components/autofill/content/renderer/password_form_conversion_utils.cc
@@ -589,10 +589,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()) {
@@ -766,4 +763,9 @@ bool HasCreditCardAutocompleteAttributes(
return false;
}
+std::string GetSignOnRealm(const GURL& origin) {
+ GURL::Replacements rep;
+ rep.SetPathStr("");
+ return origin.ReplaceComponents(rep).spec();
+}
} // namespace autofill
« no previous file with comments | « components/autofill/content/renderer/password_form_conversion_utils.h ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698