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

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

Issue 925983002: PasswordAutofillAgent: only check visibility if needed (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 5 years, 10 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 | « no previous file | 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_autofill_agent.cc
diff --git a/components/autofill/content/renderer/password_autofill_agent.cc b/components/autofill/content/renderer/password_autofill_agent.cc
index db5d26d027eeef8203b7b5a745c162e348230f6c..0f642204976bdf0169fb66af846ba9bde4e36b19 100644
--- a/components/autofill/content/renderer/password_autofill_agent.cc
+++ b/components/autofill/content/renderer/password_autofill_agent.cc
@@ -893,16 +893,18 @@ void PasswordAutofillAgent::SendPasswordForms(bool only_visible) {
std::vector<PasswordForm> password_forms;
for (size_t i = 0; i < forms.size(); ++i) {
const blink::WebFormElement& form = forms[i];
- bool is_form_visible = IsWebNodeVisible(form);
- if (logger) {
- LogHTMLForm(logger.get(), Logger::STRING_FORM_FOUND_ON_PAGE, form);
- logger->LogBoolean(Logger::STRING_FORM_IS_VISIBLE, is_form_visible);
- }
+ if (only_visible) {
+ bool is_form_visible = IsWebNodeVisible(form);
+ if (logger) {
+ LogHTMLForm(logger.get(), Logger::STRING_FORM_FOUND_ON_PAGE, form);
+ logger->LogBoolean(Logger::STRING_FORM_IS_VISIBLE, is_form_visible);
+ }
- // If requested, ignore non-rendered forms, e.g. those styled with
- // display:none.
- if (only_visible && !is_form_visible)
- continue;
+ // If requested, ignore non-rendered forms, e.g., those styled with
+ // display:none.
+ if (!is_form_visible)
+ continue;
+ }
scoped_ptr<PasswordForm> password_form(CreatePasswordForm(form, nullptr));
if (password_form.get()) {
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698