| OLD | NEW |
| 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 Loading... |
| 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 Loading... |
| 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 |
| OLD | NEW |