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 719 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
730 is_generation_popup_possibly_visible_ = false; | 730 is_generation_popup_possibly_visible_ = false; |
731 | 731 |
732 GetAutofillDriver()->HidePopup(); | 732 GetAutofillDriver()->HidePopup(); |
733 } | 733 } |
734 | 734 |
735 bool AutofillAgent::IsUserGesture() const { | 735 bool AutofillAgent::IsUserGesture() const { |
736 return WebUserGestureIndicator::IsProcessingUserGesture(); | 736 return WebUserGestureIndicator::IsProcessingUserGesture(); |
737 } | 737 } |
738 | 738 |
739 void AutofillAgent::DidAssociateFormControlsDynamically() { | 739 void AutofillAgent::DidAssociateFormControlsDynamically() { |
740 blink::WebLocalFrame* frame = render_frame()->GetWebFrame(); | 740 // If the control flow is here than the document was at least loaded. The |
741 | 741 // whole page doesn't have to be loaded. |
742 // Frame is only processed if it has finished loading, otherwise you can end | 742 ProcessForms(); |
vabr (Chromium)
2017/04/28 19:17:33
This comment comes from https://codereview.chromiu
vasilii
2017/04/28 21:26:23
The reply of gcasto@ is wrong today. DidAssociateF
| |
743 // up with a partially parsed form. | 743 password_autofill_agent_->OnDynamicFormsSeen(); |
744 if (frame && !frame->IsLoading()) { | 744 if (password_generation_agent_) |
745 ProcessForms(); | 745 password_generation_agent_->OnDynamicFormsSeen(); |
746 password_autofill_agent_->OnDynamicFormsSeen(); | |
747 if (password_generation_agent_) | |
748 password_generation_agent_->OnDynamicFormsSeen(); | |
749 } | |
750 } | 746 } |
751 | 747 |
752 void AutofillAgent::DidCompleteFocusChangeInFrame() { | 748 void AutofillAgent::DidCompleteFocusChangeInFrame() { |
753 WebDocument doc = render_frame()->GetWebFrame()->GetDocument(); | 749 WebDocument doc = render_frame()->GetWebFrame()->GetDocument(); |
754 WebElement focused_element; | 750 WebElement focused_element; |
755 if (!doc.IsNull()) | 751 if (!doc.IsNull()) |
756 focused_element = doc.FocusedElement(); | 752 focused_element = doc.FocusedElement(); |
757 // PasswordGenerationAgent needs to know about focus changes, even if there is | 753 // PasswordGenerationAgent needs to know about focus changes, even if there is |
758 // no focused element. | 754 // no focused element. |
759 if (password_generation_agent_ && | 755 if (password_generation_agent_ && |
(...skipping 28 matching lines...) Expand all Loading... | |
788 return autofill_driver_; | 784 return autofill_driver_; |
789 } | 785 } |
790 | 786 |
791 const mojom::PasswordManagerDriverPtr& | 787 const mojom::PasswordManagerDriverPtr& |
792 AutofillAgent::GetPasswordManagerDriver() { | 788 AutofillAgent::GetPasswordManagerDriver() { |
793 DCHECK(password_autofill_agent_); | 789 DCHECK(password_autofill_agent_); |
794 return password_autofill_agent_->GetPasswordManagerDriver(); | 790 return password_autofill_agent_->GetPasswordManagerDriver(); |
795 } | 791 } |
796 | 792 |
797 } // namespace autofill | 793 } // namespace autofill |
OLD | NEW |