| 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/autofill_agent.h" | 5 #include "components/autofill/content/renderer/autofill_agent.h" |
| 6 | 6 |
| 7 #include <stddef.h> | 7 #include <stddef.h> |
| 8 | 8 |
| 9 #include <tuple> | 9 #include <tuple> |
| 10 | 10 |
| (...skipping 744 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 755 is_popup_possibly_visible_ = false; | 755 is_popup_possibly_visible_ = false; |
| 756 is_generation_popup_possibly_visible_ = false; | 756 is_generation_popup_possibly_visible_ = false; |
| 757 | 757 |
| 758 GetAutofillDriver()->HidePopup(); | 758 GetAutofillDriver()->HidePopup(); |
| 759 } | 759 } |
| 760 | 760 |
| 761 bool AutofillAgent::IsUserGesture() const { | 761 bool AutofillAgent::IsUserGesture() const { |
| 762 return WebUserGestureIndicator::isProcessingUserGesture(); | 762 return WebUserGestureIndicator::isProcessingUserGesture(); |
| 763 } | 763 } |
| 764 | 764 |
| 765 void AutofillAgent::didAssociateFormControls(const WebVector<WebNode>& nodes) { | 765 void AutofillAgent::didAssociateFormControlsDynamically() { |
| 766 for (size_t i = 0; i < nodes.size(); ++i) { | 766 blink::WebLocalFrame* frame = render_frame()->GetWebFrame(); |
| 767 WebLocalFrame* frame = nodes[i].document().frame(); | 767 |
| 768 // Only monitors dynamic forms created in the top frame. Dynamic forms | 768 // Frame is only processed if it has finished loading, otherwise you can end |
| 769 // inserted in iframes are not captured yet. Frame is only processed | 769 // up with a partially parsed form. |
| 770 // if it has finished loading, otherwise you can end up with a partially | 770 if (frame && !frame->isLoading()) { |
| 771 // parsed form. | 771 ProcessForms(); |
| 772 if (frame && !frame->isLoading()) { | 772 password_autofill_agent_->OnDynamicFormsSeen(); |
| 773 ProcessForms(); | 773 if (password_generation_agent_) |
| 774 password_autofill_agent_->OnDynamicFormsSeen(); | 774 password_generation_agent_->OnDynamicFormsSeen(); |
| 775 if (password_generation_agent_) | |
| 776 password_generation_agent_->OnDynamicFormsSeen(); | |
| 777 return; | |
| 778 } | |
| 779 } | 775 } |
| 780 } | 776 } |
| 781 | 777 |
| 782 void AutofillAgent::ajaxSucceeded() { | 778 void AutofillAgent::ajaxSucceeded() { |
| 783 OnSamePageNavigationCompleted(); | 779 OnSamePageNavigationCompleted(); |
| 784 password_autofill_agent_->AJAXSucceeded(); | 780 password_autofill_agent_->AJAXSucceeded(); |
| 785 } | 781 } |
| 786 | 782 |
| 787 const mojom::AutofillDriverPtr& AutofillAgent::GetAutofillDriver() { | 783 const mojom::AutofillDriverPtr& AutofillAgent::GetAutofillDriver() { |
| 788 if (!mojo_autofill_driver_) { | 784 if (!mojo_autofill_driver_) { |
| (...skipping 22 matching lines...) Expand all Loading... |
| 811 void AutofillAgent::LegacyAutofillAgent::OnDestruct() { | 807 void AutofillAgent::LegacyAutofillAgent::OnDestruct() { |
| 812 // No-op. Don't delete |this|. | 808 // No-op. Don't delete |this|. |
| 813 } | 809 } |
| 814 | 810 |
| 815 void AutofillAgent::LegacyAutofillAgent::FocusChangeComplete() { | 811 void AutofillAgent::LegacyAutofillAgent::FocusChangeComplete() { |
| 816 if (agent_) | 812 if (agent_) |
| 817 agent_->FocusChangeComplete(); | 813 agent_->FocusChangeComplete(); |
| 818 } | 814 } |
| 819 | 815 |
| 820 } // namespace autofill | 816 } // namespace autofill |
| OLD | NEW |