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/browser/autofill/address_field.h" | 5 #include "chrome/browser/autofill/address_field.h" |
6 | 6 |
7 #include <stddef.h> | 7 #include <stddef.h> |
8 | 8 |
9 #include "base/logging.h" | 9 #include "base/logging.h" |
10 #include "base/memory/scoped_ptr.h" | 10 #include "base/memory/scoped_ptr.h" |
11 #include "base/string16.h" | 11 #include "base/string16.h" |
12 #include "base/string_util.h" | 12 #include "base/string_util.h" |
13 #include "base/utf_string_conversions.h" | 13 #include "base/utf_string_conversions.h" |
14 #include "chrome/browser/autofill/autofill_field.h" | 14 #include "chrome/browser/autofill/autofill_field.h" |
15 #include "chrome/browser/autofill/autofill_regex_constants.h" | 15 #include "chrome/browser/autofill/autofill_regex_constants.h" |
16 #include "chrome/browser/autofill/autofill_scanner.h" | 16 #include "chrome/browser/autofill/autofill_scanner.h" |
17 #include "chrome/browser/autofill/field_types.h" | 17 #include "chrome/browser/autofill/field_types.h" |
18 #include "ui/base/l10n/l10n_util.h" | 18 #include "ui/base/l10n/l10n_util.h" |
19 | 19 |
20 FormField* AddressField::Parse(AutofillScanner* scanner, | 20 FormField* AddressField::Parse(AutofillScanner* scanner) { |
21 bool parse_new_field_types) { | |
22 if (scanner->IsEnd()) | 21 if (scanner->IsEnd()) |
23 return NULL; | 22 return NULL; |
24 | 23 |
25 scoped_ptr<AddressField> address_field(new AddressField); | 24 scoped_ptr<AddressField> address_field(new AddressField); |
26 const AutofillField* const initial_field = scanner->Cursor(); | 25 const AutofillField* const initial_field = scanner->Cursor(); |
27 size_t saved_cursor = scanner->SaveCursor(); | 26 size_t saved_cursor = scanner->SaveCursor(); |
28 | 27 |
29 string16 attention_ignored = UTF8ToUTF16(autofill::kAttentionIgnoredRe); | 28 string16 attention_ignored = UTF8ToUTF16(autofill::kAttentionIgnoredRe); |
30 string16 region_ignored = UTF8ToUTF16(autofill::kRegionIgnoredRe); | 29 string16 region_ignored = UTF8ToUTF16(autofill::kRegionIgnoredRe); |
31 | 30 |
(...skipping 295 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
327 return kBillingAddress; | 326 return kBillingAddress; |
328 | 327 |
329 if (bill == string16::npos && ship != string16::npos) | 328 if (bill == string16::npos && ship != string16::npos) |
330 return kShippingAddress; | 329 return kShippingAddress; |
331 | 330 |
332 if (bill > ship) | 331 if (bill > ship) |
333 return kBillingAddress; | 332 return kBillingAddress; |
334 | 333 |
335 return kShippingAddress; | 334 return kShippingAddress; |
336 } | 335 } |
OLD | NEW |