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

Side by Side 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 unified diff | Download patch
« no previous file with comments | « no previous file | no next file » | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 // Copyright 2013 The Chromium Authors. All rights reserved. 1 // Copyright 2013 The Chromium Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be 2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file. 3 // found in the LICENSE file.
4 4
5 #include "components/autofill/content/renderer/password_autofill_agent.h" 5 #include "components/autofill/content/renderer/password_autofill_agent.h"
6 6
7 #include "base/bind.h" 7 #include "base/bind.h"
8 #include "base/command_line.h" 8 #include "base/command_line.h"
9 #include "base/memory/scoped_ptr.h" 9 #include "base/memory/scoped_ptr.h"
10 #include "base/message_loop/message_loop.h" 10 #include "base/message_loop/message_loop.h"
(...skipping 875 matching lines...) Expand 10 before | Expand all | Expand 10 after
886 } 886 }
887 887
888 blink::WebVector<blink::WebFormElement> forms; 888 blink::WebVector<blink::WebFormElement> forms;
889 frame->document().forms(forms); 889 frame->document().forms(forms);
890 if (logger) 890 if (logger)
891 logger->LogNumber(Logger::STRING_NUMBER_OF_ALL_FORMS, forms.size()); 891 logger->LogNumber(Logger::STRING_NUMBER_OF_ALL_FORMS, forms.size());
892 892
893 std::vector<PasswordForm> password_forms; 893 std::vector<PasswordForm> password_forms;
894 for (size_t i = 0; i < forms.size(); ++i) { 894 for (size_t i = 0; i < forms.size(); ++i) {
895 const blink::WebFormElement& form = forms[i]; 895 const blink::WebFormElement& form = forms[i];
896 bool is_form_visible = IsWebNodeVisible(form); 896 if (only_visible) {
897 if (logger) { 897 bool is_form_visible = IsWebNodeVisible(form);
898 LogHTMLForm(logger.get(), Logger::STRING_FORM_FOUND_ON_PAGE, form); 898 if (logger) {
899 logger->LogBoolean(Logger::STRING_FORM_IS_VISIBLE, is_form_visible); 899 LogHTMLForm(logger.get(), Logger::STRING_FORM_FOUND_ON_PAGE, form);
900 logger->LogBoolean(Logger::STRING_FORM_IS_VISIBLE, is_form_visible);
901 }
902
903 // If requested, ignore non-rendered forms, e.g., those styled with
904 // display:none.
905 if (!is_form_visible)
906 continue;
900 } 907 }
901 908
902 // If requested, ignore non-rendered forms, e.g. those styled with
903 // display:none.
904 if (only_visible && !is_form_visible)
905 continue;
906
907 scoped_ptr<PasswordForm> password_form(CreatePasswordForm(form, nullptr)); 909 scoped_ptr<PasswordForm> password_form(CreatePasswordForm(form, nullptr));
908 if (password_form.get()) { 910 if (password_form.get()) {
909 if (logger) { 911 if (logger) {
910 logger->LogPasswordForm(Logger::STRING_FORM_IS_PASSWORD, 912 logger->LogPasswordForm(Logger::STRING_FORM_IS_PASSWORD,
911 *password_form); 913 *password_form);
912 } 914 }
913 password_forms.push_back(*password_form); 915 password_forms.push_back(*password_form);
914 } 916 }
915 } 917 }
916 918
(...skipping 460 matching lines...) Expand 10 before | Expand all | Expand 10 after
1377 void PasswordAutofillAgent::LegacyPasswordAutofillAgent::DidStopLoading() { 1379 void PasswordAutofillAgent::LegacyPasswordAutofillAgent::DidStopLoading() {
1378 agent_->DidStopLoading(); 1380 agent_->DidStopLoading();
1379 } 1381 }
1380 1382
1381 void PasswordAutofillAgent::LegacyPasswordAutofillAgent:: 1383 void PasswordAutofillAgent::LegacyPasswordAutofillAgent::
1382 DidStartProvisionalLoad(blink::WebLocalFrame* navigated_frame) { 1384 DidStartProvisionalLoad(blink::WebLocalFrame* navigated_frame) {
1383 agent_->LegacyDidStartProvisionalLoad(navigated_frame); 1385 agent_->LegacyDidStartProvisionalLoad(navigated_frame);
1384 } 1386 }
1385 1387
1386 } // namespace autofill 1388 } // namespace autofill
OLDNEW
« 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