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

Side by Side Diff: components/autofill/core/browser/address_field.h

Issue 853523004: Autofill: Set requirements for number of recognized fields in an autofillable form (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: More relaxed check for form tag Created 5 years, 11 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
OLDNEW
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 #ifndef COMPONENTS_AUTOFILL_CORE_BROWSER_ADDRESS_FIELD_H_ 5 #ifndef COMPONENTS_AUTOFILL_CORE_BROWSER_ADDRESS_FIELD_H_
6 #define COMPONENTS_AUTOFILL_CORE_BROWSER_ADDRESS_FIELD_H_ 6 #define COMPONENTS_AUTOFILL_CORE_BROWSER_ADDRESS_FIELD_H_
7 7
8 #include <vector> 8 #include <vector>
9 9
10 #include "base/basictypes.h" 10 #include "base/basictypes.h"
11 #include "base/compiler_specific.h" 11 #include "base/compiler_specific.h"
12 #include "base/gtest_prod_util.h" 12 #include "base/gtest_prod_util.h"
13 #include "base/memory/scoped_ptr.h" 13 #include "base/memory/scoped_ptr.h"
14 #include "base/strings/string16.h" 14 #include "base/strings/string16.h"
15 #include "components/autofill/core/browser/autofill_type.h" 15 #include "components/autofill/core/browser/autofill_type.h"
16 #include "components/autofill/core/browser/form_field.h" 16 #include "components/autofill/core/browser/form_field.h"
17 17
18 namespace autofill { 18 namespace autofill {
19 19
20 class AutofillField; 20 class AutofillField;
21 class AutofillScanner; 21 class AutofillScanner;
22 22
23 class AddressField : public FormField { 23 class AddressField : public FormField {
24 public: 24 public:
25 static scoped_ptr<FormField> Parse(AutofillScanner* scanner); 25 static scoped_ptr<FormField> Parse(AutofillScanner* scanner);
26 26
27 protected: 27 protected:
28 // FormField: 28 // FormField:
29 bool ClassifyField(ServerFieldTypeMap* map) const override; 29 bool ClassifyField(ServerFieldTypeMap* map) const override;
30 size_t FieldCount() const override;
30 31
31 private: 32 private:
32 FRIEND_TEST_ALL_PREFIXES(AddressFieldTest, ParseOneLineAddress); 33 FRIEND_TEST_ALL_PREFIXES(AddressFieldTest, ParseOneLineAddress);
33 FRIEND_TEST_ALL_PREFIXES(AddressFieldTest, ParseTwoLineAddress); 34 FRIEND_TEST_ALL_PREFIXES(AddressFieldTest, ParseTwoLineAddress);
34 FRIEND_TEST_ALL_PREFIXES(AddressFieldTest, ParseThreeLineAddress); 35 FRIEND_TEST_ALL_PREFIXES(AddressFieldTest, ParseThreeLineAddress);
35 FRIEND_TEST_ALL_PREFIXES(AddressFieldTest, ParseStreetAddressFromTextArea); 36 FRIEND_TEST_ALL_PREFIXES(AddressFieldTest, ParseStreetAddressFromTextArea);
36 FRIEND_TEST_ALL_PREFIXES(AddressFieldTest, ParseCity); 37 FRIEND_TEST_ALL_PREFIXES(AddressFieldTest, ParseCity);
37 FRIEND_TEST_ALL_PREFIXES(AddressFieldTest, ParseState); 38 FRIEND_TEST_ALL_PREFIXES(AddressFieldTest, ParseState);
38 FRIEND_TEST_ALL_PREFIXES(AddressFieldTest, ParseZip); 39 FRIEND_TEST_ALL_PREFIXES(AddressFieldTest, ParseZip);
39 FRIEND_TEST_ALL_PREFIXES(AddressFieldTest, ParseStateAndZipOneLabel); 40 FRIEND_TEST_ALL_PREFIXES(AddressFieldTest, ParseStateAndZipOneLabel);
(...skipping 20 matching lines...) Expand all
60 AutofillField* zip_; 61 AutofillField* zip_;
61 AutofillField* zip4_; // optional ZIP+4; we don't fill this yet. 62 AutofillField* zip4_; // optional ZIP+4; we don't fill this yet.
62 AutofillField* country_; 63 AutofillField* country_;
63 64
64 DISALLOW_COPY_AND_ASSIGN(AddressField); 65 DISALLOW_COPY_AND_ASSIGN(AddressField);
65 }; 66 };
66 67
67 } // namespace autofill 68 } // namespace autofill
68 69
69 #endif // COMPONENTS_AUTOFILL_CORE_BROWSER_ADDRESS_FIELD_H_ 70 #endif // COMPONENTS_AUTOFILL_CORE_BROWSER_ADDRESS_FIELD_H_
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698