| 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 797 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 808 return; | 808 return; |
| 809 is_popup_possibly_visible_ = false; | 809 is_popup_possibly_visible_ = false; |
| 810 is_generation_popup_possibly_visible_ = false; | 810 is_generation_popup_possibly_visible_ = false; |
| 811 Send(new AutofillHostMsg_HidePopup(routing_id())); | 811 Send(new AutofillHostMsg_HidePopup(routing_id())); |
| 812 } | 812 } |
| 813 | 813 |
| 814 bool AutofillAgent::IsUserGesture() const { | 814 bool AutofillAgent::IsUserGesture() const { |
| 815 return WebUserGestureIndicator::isProcessingUserGesture(); | 815 return WebUserGestureIndicator::isProcessingUserGesture(); |
| 816 } | 816 } |
| 817 | 817 |
| 818 void AutofillAgent::didAssociateFormControls(const WebVector<WebNode>& nodes) { | 818 void AutofillAgent::didAssociateFormControls() { |
| 819 for (size_t i = 0; i < nodes.size(); ++i) { | 819 blink::WebLocalFrame* frame = render_frame()->GetWebFrame(); |
| 820 WebLocalFrame* frame = nodes[i].document().frame(); | 820 |
| 821 // Only monitors dynamic forms created in the top frame. Dynamic forms | 821 // Frame is only processed if it has finished loading, otherwise you can end |
| 822 // inserted in iframes are not captured yet. Frame is only processed | 822 // up with a partially parsed form. |
| 823 // if it has finished loading, otherwise you can end up with a partially | 823 if (frame && !frame->isLoading()) { |
| 824 // parsed form. | 824 ProcessForms(); |
| 825 if (frame && !frame->isLoading()) { | 825 password_autofill_agent_->OnDynamicFormsSeen(); |
| 826 ProcessForms(); | 826 if (password_generation_agent_) |
| 827 password_autofill_agent_->OnDynamicFormsSeen(); | 827 password_generation_agent_->OnDynamicFormsSeen(); |
| 828 if (password_generation_agent_) | |
| 829 password_generation_agent_->OnDynamicFormsSeen(); | |
| 830 return; | |
| 831 } | |
| 832 } | 828 } |
| 833 } | 829 } |
| 834 | 830 |
| 835 void AutofillAgent::ajaxSucceeded() { | 831 void AutofillAgent::ajaxSucceeded() { |
| 836 OnSamePageNavigationCompleted(); | 832 OnSamePageNavigationCompleted(); |
| 837 password_autofill_agent_->AJAXSucceeded(); | 833 password_autofill_agent_->AJAXSucceeded(); |
| 838 } | 834 } |
| 839 | 835 |
| 840 void AutofillAgent::ConnectToMojoAutofillDriverIfNeeded() { | 836 void AutofillAgent::ConnectToMojoAutofillDriverIfNeeded() { |
| 841 if (mojo_autofill_driver_.is_bound() && | 837 if (mojo_autofill_driver_.is_bound() && |
| (...skipping 21 matching lines...) Expand all Loading... |
| 863 void AutofillAgent::LegacyAutofillAgent::OnDestruct() { | 859 void AutofillAgent::LegacyAutofillAgent::OnDestruct() { |
| 864 // No-op. Don't delete |this|. | 860 // No-op. Don't delete |this|. |
| 865 } | 861 } |
| 866 | 862 |
| 867 void AutofillAgent::LegacyAutofillAgent::FocusChangeComplete() { | 863 void AutofillAgent::LegacyAutofillAgent::FocusChangeComplete() { |
| 868 if (agent_) | 864 if (agent_) |
| 869 agent_->FocusChangeComplete(); | 865 agent_->FocusChangeComplete(); |
| 870 } | 866 } |
| 871 | 867 |
| 872 } // namespace autofill | 868 } // namespace autofill |
| OLD | NEW |