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

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

Issue 845693002: [Password Generation] Require full form match to allow generation (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 5 years, 11 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 | « chrome/renderer/autofill/password_generation_agent_browsertest.cc ('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_generation_agent.cc
diff --git a/components/autofill/content/renderer/password_generation_agent.cc b/components/autofill/content/renderer/password_generation_agent.cc
index 945c50fc71fd15ddd97b77416d911e1618a673a2..8771dcfb3658bebb66200e7989501985fa4ff5c4 100644
--- a/components/autofill/content/renderer/password_generation_agent.cc
+++ b/components/autofill/content/renderer/password_generation_agent.cc
@@ -70,21 +70,11 @@ bool ContainsURL(const std::vector<GURL>& urls, const GURL& url) {
return std::find(urls.begin(), urls.end(), url) != urls.end();
}
-// Returns true if the |form1| is essentially equal to |form2|.
-bool FormsAreEqual(const autofill::FormData& form1,
- const PasswordForm& form2) {
- // TODO(zysxqn): use more signals than just origin to compare.
- // Note that FormData strips the fragement from the url while PasswordForm
- // strips both the fragement and the path, so we can't just compare these
- // two directly.
- return form1.origin.GetOrigin() == form2.origin.GetOrigin();
-}
-
bool ContainsForm(const std::vector<autofill::FormData>& forms,
const PasswordForm& form) {
for (std::vector<autofill::FormData>::const_iterator it =
forms.begin(); it != forms.end(); ++it) {
- if (FormsAreEqual(*it, form))
+ if (it->SameFormAs(form.form_data))
return true;
}
return false;
« no previous file with comments | « chrome/renderer/autofill/password_generation_agent_browsertest.cc ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698