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

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

Issue 2334543003: [Password Generation] Move canonical action computation from rendered to browser part (Closed)
Patch Set: 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/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 83146b4feb98293dc2a9390b1d280f8a3a455283..74a6113d0116924139ac304ff72777ab7c4e183b 100644
--- a/components/autofill/content/renderer/password_generation_agent.cc
+++ b/components/autofill/content/renderer/password_generation_agent.cc
@@ -33,8 +33,6 @@
namespace autofill {
-using form_util::StripAuthAndParams;
-
namespace {
// Returns true if we think that this form is for account creation. |passwords|
@@ -58,18 +56,11 @@ bool ContainsURL(const std::vector<GURL>& urls, const GURL& url) {
}
// Finds a form in |forms| that has the same action and name as |form|.
-// If the action of a form in |forms| is empty, it uses |base_url| as action. It
-// also strips parameters of the action.
const PasswordFormGenerationData* FindFormGenerationData(
const std::vector<PasswordFormGenerationData>& forms,
- const PasswordForm& form,
- const GURL& base_url) {
+ const PasswordForm& form) {
for (const auto& form_it : forms) {
- GURL action = form_it.action;
- if (action.is_empty())
- action = base_url;
- action = form_util::StripAuthAndParams(action);
- if (form_it.name == form.form_data.name && action == form.action)
+ if (form_it.name == form.form_data.name && form_it.action == form.action)
return &form_it;
}
return nullptr;
@@ -391,9 +382,8 @@ void PasswordGenerationAgent::DetermineGenerationElement() {
<< "blacklisted";
continue;
} else {
- generation_data = FindFormGenerationData(
- generation_enabled_forms_, *possible_password_form,
- render_frame()->GetWebFrame()->document().baseURL());
+ generation_data = FindFormGenerationData(generation_enabled_forms_,
+ *possible_password_form);
if (!generation_data) {
if (AutocompleteAttributesSetForGeneration(*possible_password_form)) {
VLOG(2) << "Ignoring lack of Autofill signal due to Autocomplete "

Powered by Google App Engine
This is Rietveld 408576698