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

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

Issue 697233002: Remove flag to disable ignore autocomplete='off' for password forms. (Closed) Base URL: https://chromium.googlesource.com/chromium/src@master
Patch Set: Created 6 years, 1 month 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.gypi ('k') | components/autofill/core/common/BUILD.gn » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: components/autofill/content/renderer/password_autofill_agent.cc
diff --git a/components/autofill/content/renderer/password_autofill_agent.cc b/components/autofill/content/renderer/password_autofill_agent.cc
index c5986925655c495ce14568681a46695e53a3f80d..be72dc5abd4d1d869e3f1ba1644b3588450442eb 100644
--- a/components/autofill/content/renderer/password_autofill_agent.cc
+++ b/components/autofill/content/renderer/password_autofill_agent.cc
@@ -14,7 +14,6 @@
#include "components/autofill/content/renderer/password_form_conversion_utils.h"
#include "components/autofill/content/renderer/renderer_save_password_progress_logger.h"
#include "components/autofill/core/common/form_field_data.h"
-#include "components/autofill/core/common/password_autofill_util.h"
#include "components/autofill/core/common/password_form.h"
#include "components/autofill/core/common/password_form_fill_data.h"
#include "content/public/renderer/document_state.h"
@@ -185,14 +184,9 @@ bool DoUsernamesMatch(const base::string16& username1,
return StartsWith(username1, username2, true);
}
-// Returns |true| if the given element is both editable and has permission to be
-// autocompleted. The latter can be either because there is no
-// autocomplete='off' set for the element, or because the flag is set to ignore
-// autocomplete='off'. Otherwise, returns |false|.
+// Returns |true| if the given element is editable. Otherwise, returns |false|.
bool IsElementAutocompletable(const blink::WebInputElement& element) {
- return IsElementEditable(element) &&
- (ShouldIgnoreAutocompleteOffForPasswordFields() ||
- element.autoComplete());
+ return IsElementEditable(element);
}
// Returns true if the password specified in |form| is a default value.
@@ -397,15 +391,11 @@ bool FillFormOnPasswordRecieved(
if (password_element.document().frame()->parent())
return false;
- bool form_contains_username_field = FillDataContainsUsername(fill_data);
- if (!ShouldIgnoreAutocompleteOffForPasswordFields() &&
- form_contains_username_field && !username_element.form().autoComplete())
- return false;
-
// If we can't modify the password, don't try to set the username
if (!IsElementAutocompletable(password_element))
return false;
+ bool form_contains_username_field = FillDataContainsUsername(fill_data);
// Try to set the username to the preferred name, but only if the field
// can be set and isn't prefilled.
if (form_contains_username_field &&
« no previous file with comments | « components/autofill.gypi ('k') | components/autofill/core/common/BUILD.gn » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698