| 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/phone_field.h" | 5 #include "components/autofill/core/browser/phone_field.h" |
| 6 | 6 |
| 7 #include <string.h> | 7 #include <string.h> |
| 8 | 8 |
| 9 #include <memory> | 9 #include <memory> |
| 10 #include <utility> | 10 #include <utility> |
| 11 | 11 |
| 12 #include "base/logging.h" | 12 #include "base/logging.h" |
| 13 #include "base/macros.h" | 13 #include "base/macros.h" |
| 14 #include "base/strings/string16.h" | 14 #include "base/strings/string16.h" |
| 15 #include "base/strings/string_util.h" | 15 #include "base/strings/string_util.h" |
| 16 #include "base/strings/utf_string_conversions.h" | 16 #include "base/strings/utf_string_conversions.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_regex_constants.h" | |
| 19 #include "components/autofill/core/browser/autofill_scanner.h" | 18 #include "components/autofill/core/browser/autofill_scanner.h" |
| 19 #include "components/autofill/core/common/autofill_regex_constants.h" |
| 20 | 20 |
| 21 namespace autofill { | 21 namespace autofill { |
| 22 namespace { | 22 namespace { |
| 23 | 23 |
| 24 // This string includes all area code separators, including NoText. | 24 // This string includes all area code separators, including NoText. |
| 25 std::string GetAreaRegex() { | 25 std::string GetAreaRegex() { |
| 26 std::string area_code = kAreaCodeRe; | 26 std::string area_code = kAreaCodeRe; |
| 27 area_code.append("|"); // Regexp separator. | 27 area_code.append("|"); // Regexp separator. |
| 28 area_code.append(kAreaCodeNotextRe); | 28 area_code.append(kAreaCodeNotextRe); |
| 29 return area_code; | 29 return area_code; |
| (...skipping 260 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 290 bool PhoneField::ParsePhoneField(AutofillScanner* scanner, | 290 bool PhoneField::ParsePhoneField(AutofillScanner* scanner, |
| 291 const std::string& regex, | 291 const std::string& regex, |
| 292 AutofillField** field) { | 292 AutofillField** field) { |
| 293 return ParseFieldSpecifics(scanner, | 293 return ParseFieldSpecifics(scanner, |
| 294 base::UTF8ToUTF16(regex), | 294 base::UTF8ToUTF16(regex), |
| 295 MATCH_DEFAULT | MATCH_TELEPHONE | MATCH_NUMBER, | 295 MATCH_DEFAULT | MATCH_TELEPHONE | MATCH_NUMBER, |
| 296 field); | 296 field); |
| 297 } | 297 } |
| 298 | 298 |
| 299 } // namespace autofill | 299 } // namespace autofill |
| OLD | NEW |