| OLD | NEW |
| 1 // Copyright (c) 2011 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2011 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/form_autofill_util.h" | 5 #include "chrome/renderer/autofill/form_autofill_util.h" |
| 6 | 6 |
| 7 #include <map> | 7 #include <map> |
| 8 | 8 |
| 9 #include "base/callback_old.h" | 9 #include "base/callback_old.h" |
| 10 #include "base/logging.h" | 10 #include "base/logging.h" |
| (...skipping 763 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 774 | 774 |
| 775 // Copy the created FormFields into the resulting FormData object. | 775 // Copy the created FormFields into the resulting FormData object. |
| 776 for (ScopedVector<FormField>::const_iterator iter = form_fields.begin(); | 776 for (ScopedVector<FormField>::const_iterator iter = form_fields.begin(); |
| 777 iter != form_fields.end(); ++iter) { | 777 iter != form_fields.end(); ++iter) { |
| 778 form->fields.push_back(**iter); | 778 form->fields.push_back(**iter); |
| 779 } | 779 } |
| 780 | 780 |
| 781 return true; | 781 return true; |
| 782 } | 782 } |
| 783 | 783 |
| 784 bool FindFormAndFieldForFormControlElement(const WebFormControlElement& element, | 784 bool FindFormAndFieldForInputElement(const WebInputElement& element, |
| 785 FormData* form, | 785 FormData* form, |
| 786 webkit_glue::FormField* field) { | 786 webkit_glue::FormField* field, |
| 787 RequirementsMask requirements) { |
| 787 if (!IsAutofillableElement(element)) | 788 if (!IsAutofillableElement(element)) |
| 788 return false; | 789 return false; |
| 789 | 790 |
| 790 const WebFormElement form_element = element.form(); | 791 const WebFormElement form_element = element.form(); |
| 791 if (form_element.isNull()) | 792 if (form_element.isNull()) |
| 792 return false; | 793 return false; |
| 793 | 794 |
| 794 ExtractMask extract_mask = | 795 ExtractMask extract_mask = |
| 795 static_cast<ExtractMask>(EXTRACT_VALUE | EXTRACT_OPTIONS); | 796 static_cast<ExtractMask>(EXTRACT_VALUE | EXTRACT_OPTIONS); |
| 796 return WebFormElementToFormData(form_element, | 797 return WebFormElementToFormData(form_element, |
| 797 element, | 798 element, |
| 798 REQUIRE_NONE, | 799 requirements, |
| 799 extract_mask, | 800 extract_mask, |
| 800 form, | 801 form, |
| 801 field); | 802 field); |
| 802 } | 803 } |
| 803 | 804 |
| 804 void FillForm(const FormData& form, const WebInputElement& element) { | 805 void FillForm(const FormData& form, const WebInputElement& element) { |
| 805 WebFormElement form_element = element.form(); | 806 WebFormElement form_element = element.form(); |
| 806 if (form_element.isNull()) | 807 if (form_element.isNull()) |
| 807 return; | 808 return; |
| 808 | 809 |
| (...skipping 74 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 883 continue; | 884 continue; |
| 884 | 885 |
| 885 if (input_element->isAutofilled()) | 886 if (input_element->isAutofilled()) |
| 886 return true; | 887 return true; |
| 887 } | 888 } |
| 888 | 889 |
| 889 return false; | 890 return false; |
| 890 } | 891 } |
| 891 | 892 |
| 892 } // namespace autofill | 893 } // namespace autofill |
| OLD | NEW |