| OLD | NEW |
| 1 // Copyright 2015 The Chromium Authors. All rights reserved. | 1 // Copyright 2015 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 "chrome/renderer/autofill/password_generation_test_utils.h" | 5 #include "chrome/renderer/autofill/password_generation_test_utils.h" |
| 6 | 6 |
| 7 #include <vector> | 7 #include <vector> |
| 8 | 8 |
| 9 #include "components/autofill/content/common/autofill_messages.h" | 9 #include "components/autofill/content/common/autofill_messages.h" |
| 10 #include "components/autofill/content/renderer/form_autofill_util.h" | 10 #include "components/autofill/content/renderer/form_autofill_util.h" |
| (...skipping 19 matching lines...) Expand all Loading... |
| 30 void SetAccountCreationFormsDetectedMessage( | 30 void SetAccountCreationFormsDetectedMessage( |
| 31 TestPasswordGenerationAgent* generation_agent, | 31 TestPasswordGenerationAgent* generation_agent, |
| 32 blink::WebDocument document, | 32 blink::WebDocument document, |
| 33 int form_index, | 33 int form_index, |
| 34 int field_index) { | 34 int field_index) { |
| 35 blink::WebVector<blink::WebFormElement> web_forms; | 35 blink::WebVector<blink::WebFormElement> web_forms; |
| 36 document.forms(web_forms); | 36 document.forms(web_forms); |
| 37 | 37 |
| 38 autofill::FormData form_data; | 38 autofill::FormData form_data; |
| 39 WebFormElementToFormData( | 39 WebFormElementToFormData( |
| 40 web_forms[form_index], blink::WebFormControlElement(), | 40 web_forms[form_index], blink::WebFormControlElement(), nullptr, |
| 41 form_util::EXTRACT_NONE, &form_data, nullptr /* FormFieldData */); | 41 form_util::EXTRACT_NONE, &form_data, nullptr /* FormFieldData */); |
| 42 | 42 |
| 43 std::vector<autofill::PasswordFormGenerationData> forms; | 43 std::vector<autofill::PasswordFormGenerationData> forms; |
| 44 forms.push_back(autofill::PasswordFormGenerationData{ | 44 forms.push_back(autofill::PasswordFormGenerationData{ |
| 45 form_data.name, form_data.action, form_data.fields[field_index]}); | 45 form_data.name, form_data.action, form_data.fields[field_index]}); |
| 46 AutofillMsg_FoundFormsEligibleForGeneration msg(0, forms); | 46 AutofillMsg_FoundFormsEligibleForGeneration msg(0, forms); |
| 47 static_cast<IPC::Listener*>(generation_agent)->OnMessageReceived(msg); | 47 static_cast<IPC::Listener*>(generation_agent)->OnMessageReceived(msg); |
| 48 } | 48 } |
| 49 | 49 |
| 50 } // namespace autofill | 50 } // namespace autofill |
| OLD | NEW |