| 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/form_cache.h" | 5 #include "components/autofill/content/renderer/form_cache.h" |
| 6 | 6 |
| 7 #include "base/logging.h" | 7 #include "base/logging.h" |
| 8 #include "base/macros.h" | 8 #include "base/macros.h" |
| 9 #include "base/stl_util.h" | 9 #include "base/stl_util.h" |
| 10 #include "base/strings/utf_string_conversions.h" | 10 #include "base/strings/utf_string_conversions.h" |
| (...skipping 105 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 116 std::vector<WebFormControlElement> control_elements = | 116 std::vector<WebFormControlElement> control_elements = |
| 117 form_util::ExtractAutofillableElementsInForm(form_element); | 117 form_util::ExtractAutofillableElementsInForm(form_element); |
| 118 size_t num_editable_elements = | 118 size_t num_editable_elements = |
| 119 ScanFormControlElements(control_elements, log_deprecation_messages); | 119 ScanFormControlElements(control_elements, log_deprecation_messages); |
| 120 | 120 |
| 121 if (num_editable_elements == 0) | 121 if (num_editable_elements == 0) |
| 122 continue; | 122 continue; |
| 123 | 123 |
| 124 FormData form; | 124 FormData form; |
| 125 if (!WebFormElementToFormData(form_element, WebFormControlElement(), | 125 if (!WebFormElementToFormData(form_element, WebFormControlElement(), |
| 126 extract_mask, &form, nullptr)) { | 126 nullptr, extract_mask, &form, nullptr)) { |
| 127 continue; | 127 continue; |
| 128 } | 128 } |
| 129 | 129 |
| 130 num_fields_seen += form.fields.size(); | 130 num_fields_seen += form.fields.size(); |
| 131 if (num_fields_seen > form_util::kMaxParseableFields) | 131 if (num_fields_seen > form_util::kMaxParseableFields) |
| 132 return forms; | 132 return forms; |
| 133 | 133 |
| 134 if (!ContainsKey(parsed_forms_, form) && | 134 if (!ContainsKey(parsed_forms_, form) && |
| 135 IsFormInteresting(form, num_editable_elements)) { | 135 IsFormInteresting(form, num_editable_elements)) { |
| 136 for (auto it = parsed_forms_.begin(); it != parsed_forms_.end(); ++it) { | 136 for (auto it = parsed_forms_.begin(); it != parsed_forms_.end(); ++it) { |
| (...skipping 232 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 369 const WebInputElement* input_element = toWebInputElement(&element); | 369 const WebInputElement* input_element = toWebInputElement(&element); |
| 370 if (form_util::IsCheckableElement(input_element)) { | 370 if (form_util::IsCheckableElement(input_element)) { |
| 371 initial_checked_state_.insert( | 371 initial_checked_state_.insert( |
| 372 std::make_pair(*input_element, input_element->isChecked())); | 372 std::make_pair(*input_element, input_element->isChecked())); |
| 373 } | 373 } |
| 374 } | 374 } |
| 375 } | 375 } |
| 376 } | 376 } |
| 377 | 377 |
| 378 } // namespace autofill | 378 } // namespace autofill |
| OLD | NEW |