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

Unified Diff: components/password_manager/core/browser/password_generation_manager.cc

Issue 2318533002: [Password Generation] Use signatures for form matching (Closed)
Patch Set: Rebase Created 4 years, 3 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/password_manager/core/browser/password_generation_manager.cc
diff --git a/components/password_manager/core/browser/password_generation_manager.cc b/components/password_manager/core/browser/password_generation_manager.cc
index 607a7adc26a533a9fe5f3c7635ccf057a007488c..d33425534a6f30af8970c21831b58d98d3ea0f40 100644
--- a/components/password_manager/core/browser/password_generation_manager.cc
+++ b/components/password_manager/core/browser/password_generation_manager.cc
@@ -14,24 +14,6 @@
namespace password_manager {
-namespace {
-
-// Helper function that returns canonical action based on |target_url| and
-// |source_url|.
-GURL GetCanonicalAction(const GURL& source_url, const GURL& target_url) {
- GURL action = target_url;
- if (action.is_empty())
- action = source_url;
- GURL::Replacements rep;
- rep.ClearUsername();
- rep.ClearPassword();
- rep.ClearQuery();
- rep.ClearRef();
- return action.ReplaceComponents(rep);
-}
-
-} // namespace
-
PasswordGenerationManager::PasswordGenerationManager(
PasswordManagerClient* client,
PasswordManagerDriver* driver)
@@ -59,10 +41,8 @@ void PasswordGenerationManager::DetectFormsEligibleForGeneration(
if (field->server_type() == autofill::ACCOUNT_CREATION_PASSWORD ||
field->server_type() == autofill::NEW_PASSWORD) {
forms_eligible_for_generation.push_back(
- autofill::PasswordFormGenerationData{
- form->form_name(),
- GetCanonicalAction(form->source_url(), form->target_url()),
- *field});
+ autofill::PasswordFormGenerationData{form->form_signature(),
+ field->GetFieldSignature()});
break;
}
}

Powered by Google App Engine
This is Rietveld 408576698