| 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/core/browser/form_field.h" | 5 #include "components/autofill/core/browser/form_field.h" |
| 6 | 6 |
| 7 #include <algorithm> | 7 #include <algorithm> |
| 8 #include <cstddef> | 8 #include <cstddef> |
| 9 #include <iterator> | 9 #include <iterator> |
| 10 #include <memory> |
| 10 #include <string> | 11 #include <string> |
| 11 #include <utility> | 12 #include <utility> |
| 12 | 13 |
| 13 #include "base/logging.h" | 14 #include "base/logging.h" |
| 14 #include "base/memory/scoped_ptr.h" | |
| 15 #include "base/strings/string_util.h" | 15 #include "base/strings/string_util.h" |
| 16 #include "base/strings/stringprintf.h" | 16 #include "base/strings/stringprintf.h" |
| 17 #include "base/strings/utf_string_conversions.h" | 17 #include "base/strings/utf_string_conversions.h" |
| 18 #include "components/autofill/core/browser/address_field.h" | 18 #include "components/autofill/core/browser/address_field.h" |
| 19 #include "components/autofill/core/browser/autofill_field.h" | 19 #include "components/autofill/core/browser/autofill_field.h" |
| 20 #include "components/autofill/core/browser/autofill_scanner.h" | 20 #include "components/autofill/core/browser/autofill_scanner.h" |
| 21 #include "components/autofill/core/browser/credit_card_field.h" | 21 #include "components/autofill/core/browser/credit_card_field.h" |
| 22 #include "components/autofill/core/browser/email_field.h" | 22 #include "components/autofill/core/browser/email_field.h" |
| 23 #include "components/autofill/core/browser/form_structure.h" | 23 #include "components/autofill/core/browser/form_structure.h" |
| 24 #include "components/autofill/core/browser/name_field.h" | 24 #include "components/autofill/core/browser/name_field.h" |
| (...skipping 142 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 167 | 167 |
| 168 return false; | 168 return false; |
| 169 } | 169 } |
| 170 | 170 |
| 171 // static | 171 // static |
| 172 void FormField::ParseFormFieldsPass(ParseFunction parse, | 172 void FormField::ParseFormFieldsPass(ParseFunction parse, |
| 173 const std::vector<AutofillField*>& fields, | 173 const std::vector<AutofillField*>& fields, |
| 174 FieldCandidatesMap* field_candidates) { | 174 FieldCandidatesMap* field_candidates) { |
| 175 AutofillScanner scanner(fields); | 175 AutofillScanner scanner(fields); |
| 176 while (!scanner.IsEnd()) { | 176 while (!scanner.IsEnd()) { |
| 177 scoped_ptr<FormField> form_field(parse(&scanner)); | 177 std::unique_ptr<FormField> form_field(parse(&scanner)); |
| 178 if (form_field == nullptr) { | 178 if (form_field == nullptr) { |
| 179 scanner.Advance(); | 179 scanner.Advance(); |
| 180 } else { | 180 } else { |
| 181 // Add entries into |field_candidates| for each field type found in | 181 // Add entries into |field_candidates| for each field type found in |
| 182 // |fields|. | 182 // |fields|. |
| 183 form_field->AddClassifications(field_candidates); | 183 form_field->AddClassifications(field_candidates); |
| 184 } | 184 } |
| 185 } | 185 } |
| 186 } | 186 } |
| 187 | 187 |
| (...skipping 17 matching lines...) Expand all Loading... |
| 205 if ((match_type & MATCH_PASSWORD) && type == "password") | 205 if ((match_type & MATCH_PASSWORD) && type == "password") |
| 206 return true; | 206 return true; |
| 207 | 207 |
| 208 if ((match_type & MATCH_NUMBER) && type == "number") | 208 if ((match_type & MATCH_NUMBER) && type == "number") |
| 209 return true; | 209 return true; |
| 210 | 210 |
| 211 return false; | 211 return false; |
| 212 } | 212 } |
| 213 | 213 |
| 214 } // namespace autofill | 214 } // namespace autofill |
| OLD | NEW |