Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(326)

Side by Side Diff: chrome/browser/autofill/address_field.h

Issue 7043027: Autofill refactor form_field.h/cc. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: OVERRIDE glitch. Created 9 years, 7 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch | Annotate | Revision Log
« no previous file with comments | « no previous file | chrome/browser/autofill/address_field.cc » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
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 #ifndef CHROME_BROWSER_AUTOFILL_ADDRESS_FIELD_H_ 5 #ifndef CHROME_BROWSER_AUTOFILL_ADDRESS_FIELD_H_
6 #define CHROME_BROWSER_AUTOFILL_ADDRESS_FIELD_H_ 6 #define CHROME_BROWSER_AUTOFILL_ADDRESS_FIELD_H_
7 #pragma once 7 #pragma once
8 8
9 #include <vector> 9 #include <vector>
10 10
11 #include "base/basictypes.h" 11 #include "base/basictypes.h"
12 #include "base/compiler_specific.h" 12 #include "base/compiler_specific.h"
13 #include "base/gtest_prod_util.h"
13 #include "base/string16.h" 14 #include "base/string16.h"
14 #include "chrome/browser/autofill/autofill_type.h" 15 #include "chrome/browser/autofill/autofill_type.h"
15 #include "chrome/browser/autofill/field_types.h" 16 #include "chrome/browser/autofill/field_types.h"
16 #include "chrome/browser/autofill/form_field.h" 17 #include "chrome/browser/autofill/form_field.h"
17 18
18 class AutofillField; 19 class AutofillField;
19 class AutofillScanner; 20 class AutofillScanner;
20 21
21 class AddressField : public FormField { 22 class AddressField : public FormField {
22 public: 23 public:
23 virtual bool GetFieldInfo(FieldTypeMap* field_type_map) const OVERRIDE;
24
25 static AddressField* Parse(AutofillScanner* scanner, bool is_ecml); 24 static AddressField* Parse(AutofillScanner* scanner, bool is_ecml);
26 25
27 // Tries to determine the billing/shipping type of this address. 26 // Tries to determine the billing/shipping type of this address.
28 AddressType FindType() const; 27 AddressType FindType() const;
29 28
30 // Returns true if this is a full address as opposed to an address fragment 29 protected:
31 // such as a stand-alone ZIP code. 30 // FormField:
32 bool IsFullAddress(); 31 virtual bool ClassifyField(FieldTypeMap* map) const OVERRIDE;
33 32
34 private: 33 private:
34 FRIEND_TEST_ALL_PREFIXES(AddressFieldTest, ParseOneLineAddress);
35 FRIEND_TEST_ALL_PREFIXES(AddressFieldTest, ParseOneLineAddressBilling);
36 FRIEND_TEST_ALL_PREFIXES(AddressFieldTest, ParseOneLineAddressShipping);
37 FRIEND_TEST_ALL_PREFIXES(AddressFieldTest, ParseOneLineAddressEcml);
38 FRIEND_TEST_ALL_PREFIXES(AddressFieldTest, ParseTwoLineAddress);
39 FRIEND_TEST_ALL_PREFIXES(AddressFieldTest, ParseThreeLineAddress);
40 FRIEND_TEST_ALL_PREFIXES(AddressFieldTest, ParseTwoLineAddressEcml);
41 FRIEND_TEST_ALL_PREFIXES(AddressFieldTest, ParseCity);
42 FRIEND_TEST_ALL_PREFIXES(AddressFieldTest, ParseCityEcml);
43 FRIEND_TEST_ALL_PREFIXES(AddressFieldTest, ParseState);
44 FRIEND_TEST_ALL_PREFIXES(AddressFieldTest, ParseStateEcml);
45 FRIEND_TEST_ALL_PREFIXES(AddressFieldTest, ParseZip);
46 FRIEND_TEST_ALL_PREFIXES(AddressFieldTest, ParseZipEcml);
47 FRIEND_TEST_ALL_PREFIXES(AddressFieldTest, ParseStateAndZipOneLabel);
48 FRIEND_TEST_ALL_PREFIXES(AddressFieldTest, ParseCountry);
49 FRIEND_TEST_ALL_PREFIXES(AddressFieldTest, ParseCountryEcml);
50 FRIEND_TEST_ALL_PREFIXES(AddressFieldTest, ParseTwoLineAddressMissingLabel);
51 FRIEND_TEST_ALL_PREFIXES(AddressFieldTest, ParseCompany);
52 FRIEND_TEST_ALL_PREFIXES(AddressFieldTest, ParseCompanyEcml);
53
35 AddressField(); 54 AddressField();
36 55
37 static bool ParseCompany(AutofillScanner* scanner, 56 static bool ParseCompany(AutofillScanner* scanner,
38 bool is_ecml, 57 bool is_ecml,
39 AddressField* address_field); 58 AddressField* address_field);
40 static bool ParseAddressLines(AutofillScanner* scanner, 59 static bool ParseAddressLines(AutofillScanner* scanner,
41 bool is_ecml, 60 bool is_ecml,
42 AddressField* address_field); 61 AddressField* address_field);
43 static bool ParseCountry(AutofillScanner* scanner, 62 static bool ParseCountry(AutofillScanner* scanner,
44 bool is_ecml, 63 bool is_ecml,
(...skipping 20 matching lines...) Expand all
65 const AutofillField* zip_; 84 const AutofillField* zip_;
66 const AutofillField* zip4_; // optional ZIP+4; we don't fill this yet 85 const AutofillField* zip4_; // optional ZIP+4; we don't fill this yet
67 const AutofillField* country_; // optional 86 const AutofillField* country_; // optional
68 87
69 AddressType type_; 88 AddressType type_;
70 89
71 DISALLOW_COPY_AND_ASSIGN(AddressField); 90 DISALLOW_COPY_AND_ASSIGN(AddressField);
72 }; 91 };
73 92
74 #endif // CHROME_BROWSER_AUTOFILL_ADDRESS_FIELD_H_ 93 #endif // CHROME_BROWSER_AUTOFILL_ADDRESS_FIELD_H_
OLDNEW
« no previous file with comments | « no previous file | chrome/browser/autofill/address_field.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698