Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(220)

Unified Diff: components/autofill/content/renderer/password_form_conversion_utils.cc

Issue 2715433004: [Password Manager] Check the success of extracting FormData in PasswordForm creation (Closed)
Patch Set: Fixed compilation error in tests Created 3 years, 9 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « no previous file | components/autofill/content/renderer/password_form_conversion_utils_browsertest.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: components/autofill/content/renderer/password_form_conversion_utils.cc
diff --git a/components/autofill/content/renderer/password_form_conversion_utils.cc b/components/autofill/content/renderer/password_form_conversion_utils.cc
index 3aa8e5b3da25c1c96eaf019356d909f6da733c89..b92ff5f757e1d0f71f0f63e064422090d27e3a88 100644
--- a/components/autofill/content/renderer/password_form_conversion_utils.cc
+++ b/components/autofill/content/renderer/password_form_conversion_utils.cc
@@ -680,10 +680,11 @@ std::unique_ptr<PasswordForm> CreatePasswordFormFromWebForm(
SyntheticForm synthetic_form;
PopulateSyntheticFormFromWebForm(web_form, &synthetic_form);
- WebFormElementToFormData(web_form, blink::WebFormControlElement(),
- field_value_and_properties_map,
- form_util::EXTRACT_NONE, &password_form->form_data,
- NULL /* FormFieldData */);
+ if (!WebFormElementToFormData(
+ web_form, blink::WebFormControlElement(),
+ field_value_and_properties_map, form_util::EXTRACT_NONE,
+ &password_form->form_data, NULL /* FormFieldData */))
+ return std::unique_ptr<PasswordForm>();
if (!GetPasswordForm(synthetic_form, password_form.get(),
field_value_and_properties_map, form_predictions))
@@ -705,10 +706,12 @@ std::unique_ptr<PasswordForm> CreatePasswordFormFromUnownedInputElements(
return std::unique_ptr<PasswordForm>();
std::unique_ptr<PasswordForm> password_form(new PasswordForm());
- UnownedPasswordFormElementsAndFieldSetsToFormData(
- synthetic_form.fieldsets, synthetic_form.control_elements, nullptr,
- frame.document(), field_value_and_properties_map, form_util::EXTRACT_NONE,
- &password_form->form_data, nullptr /* FormFieldData */);
+ if (!UnownedPasswordFormElementsAndFieldSetsToFormData(
+ synthetic_form.fieldsets, synthetic_form.control_elements, nullptr,
+ frame.document(), field_value_and_properties_map,
+ form_util::EXTRACT_NONE, &password_form->form_data,
+ nullptr /* FormFieldData */))
+ return std::unique_ptr<PasswordForm>();
if (!GetPasswordForm(synthetic_form, password_form.get(),
field_value_and_properties_map, form_predictions))
return std::unique_ptr<PasswordForm>();
« no previous file with comments | « no previous file | components/autofill/content/renderer/password_form_conversion_utils_browsertest.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698