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 <stddef.h> | 7 #include <stddef.h> |
8 #include <string> | 8 #include <string> |
9 #include <utility> | 9 #include <utility> |
10 | 10 |
11 #include "base/logging.h" | 11 #include "base/logging.h" |
12 #include "base/memory/scoped_ptr.h" | 12 #include "base/memory/scoped_ptr.h" |
13 #include "base/strings/string_util.h" | 13 #include "base/strings/string_util.h" |
14 #include "base/strings/stringprintf.h" | 14 #include "base/strings/stringprintf.h" |
15 #include "base/strings/utf_string_conversions.h" | 15 #include "base/strings/utf_string_conversions.h" |
16 #include "components/autofill/core/browser/address_field.h" | 16 #include "components/autofill/core/browser/address_field.h" |
17 #include "components/autofill/core/browser/autofill_field.h" | 17 #include "components/autofill/core/browser/autofill_field.h" |
| 18 #include "components/autofill/core/browser/autofill_regexes.h" |
18 #include "components/autofill/core/browser/autofill_scanner.h" | 19 #include "components/autofill/core/browser/autofill_scanner.h" |
19 #include "components/autofill/core/browser/credit_card_field.h" | 20 #include "components/autofill/core/browser/credit_card_field.h" |
20 #include "components/autofill/core/browser/email_field.h" | 21 #include "components/autofill/core/browser/email_field.h" |
21 #include "components/autofill/core/browser/form_structure.h" | 22 #include "components/autofill/core/browser/form_structure.h" |
22 #include "components/autofill/core/browser/name_field.h" | 23 #include "components/autofill/core/browser/name_field.h" |
23 #include "components/autofill/core/browser/phone_field.h" | 24 #include "components/autofill/core/browser/phone_field.h" |
24 #include "components/autofill/core/common/autofill_regexes.h" | |
25 | 25 |
26 namespace autofill { | 26 namespace autofill { |
27 namespace { | 27 namespace { |
28 | 28 |
29 bool ShouldBeIgnored(const AutofillField* field) { | 29 bool ShouldBeIgnored(const AutofillField* field) { |
30 // Ignore checkable fields as they interfere with parsers assuming context. | 30 // Ignore checkable fields as they interfere with parsers assuming context. |
31 // Eg., while parsing address, "Is PO box" checkbox after ADDRESS_LINE1 | 31 // Eg., while parsing address, "Is PO box" checkbox after ADDRESS_LINE1 |
32 // interferes with correctly understanding ADDRESS_LINE2. | 32 // interferes with correctly understanding ADDRESS_LINE2. |
33 // Ignore fields marked as presentational. See | 33 // Ignore fields marked as presentational. See |
34 // http://www.w3.org/TR/wai-aria/roles#presentation | 34 // http://www.w3.org/TR/wai-aria/roles#presentation |
(...skipping 201 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
236 if ((match_type & MATCH_PASSWORD) && type == "password") | 236 if ((match_type & MATCH_PASSWORD) && type == "password") |
237 return true; | 237 return true; |
238 | 238 |
239 if ((match_type & MATCH_NUMBER) && type == "number") | 239 if ((match_type & MATCH_NUMBER) && type == "number") |
240 return true; | 240 return true; |
241 | 241 |
242 return false; | 242 return false; |
243 } | 243 } |
244 | 244 |
245 } // namespace autofill | 245 } // namespace autofill |
OLD | NEW |