| 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 "base/bind.h" | 7 #include "base/bind.h" |
| 8 #include "base/command_line.h" | 8 #include "base/command_line.h" |
| 9 #include "base/message_loop.h" | 9 #include "base/message_loop.h" |
| 10 #include "base/strings/string_split.h" | 10 #include "base/strings/string_split.h" |
| (...skipping 726 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 737 Send(new AutofillHostMsg_FormsSeen(routing_id(), forms, | 737 Send(new AutofillHostMsg_FormsSeen(routing_id(), forms, |
| 738 forms_seen_timestamp_, | 738 forms_seen_timestamp_, |
| 739 NO_SPECIAL_FORMS_SEEN)); | 739 NO_SPECIAL_FORMS_SEEN)); |
| 740 } | 740 } |
| 741 | 741 |
| 742 void AutofillAgent::OnRequestAutocompleteResult( | 742 void AutofillAgent::OnRequestAutocompleteResult( |
| 743 WebFormElement::AutocompleteResult result, const FormData& form_data) { | 743 WebFormElement::AutocompleteResult result, const FormData& form_data) { |
| 744 if (in_flight_request_form_.isNull()) | 744 if (in_flight_request_form_.isNull()) |
| 745 return; | 745 return; |
| 746 | 746 |
| 747 if (result == WebFormElement::AutocompleteResultSuccess) | 747 if (result == WebFormElement::AutocompleteResultSuccess) { |
| 748 FillFormIncludingNonFocusableElements(form_data, in_flight_request_form_); | 748 FillFormIncludingNonFocusableElements(form_data, in_flight_request_form_); |
| 749 if (!in_flight_request_form_.checkValidityWithoutDispatchingEvents()) |
| 750 result = WebFormElement::AutocompleteResultErrorInvalid; |
| 751 } |
| 749 | 752 |
| 750 in_flight_request_form_.finishRequestAutocomplete(result); | 753 in_flight_request_form_.finishRequestAutocomplete(result); |
| 751 in_flight_request_form_.reset(); | 754 in_flight_request_form_.reset(); |
| 752 } | 755 } |
| 753 | 756 |
| 754 void AutofillAgent::OnFillFormsAndClick( | 757 void AutofillAgent::OnFillFormsAndClick( |
| 755 const std::vector<FormData>& forms, | 758 const std::vector<FormData>& forms, |
| 756 const std::vector<WebElementDescriptor>& click_elements_before_form_fill, | 759 const std::vector<WebElementDescriptor>& click_elements_before_form_fill, |
| 757 const std::vector<WebElementDescriptor>& click_elements_after_form_fill, | 760 const std::vector<WebElementDescriptor>& click_elements_after_form_fill, |
| 758 const WebElementDescriptor& click_element_descriptor) { | 761 const WebElementDescriptor& click_element_descriptor) { |
| (...skipping 238 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 997 if (!forms.empty()) { | 1000 if (!forms.empty()) { |
| 998 if (click_timer_.IsRunning()) | 1001 if (click_timer_.IsRunning()) |
| 999 click_timer_.Stop(); | 1002 click_timer_.Stop(); |
| 1000 Send(new AutofillHostMsg_FormsSeen(routing_id(), forms, | 1003 Send(new AutofillHostMsg_FormsSeen(routing_id(), forms, |
| 1001 forms_seen_timestamp_, | 1004 forms_seen_timestamp_, |
| 1002 state)); | 1005 state)); |
| 1003 } | 1006 } |
| 1004 } | 1007 } |
| 1005 | 1008 |
| 1006 } // namespace autofill | 1009 } // namespace autofill |
| OLD | NEW |