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 #ifndef COMPONENTS_AUTOFILL_BROWSER_ADDRESS_H_ | 5 #ifndef COMPONENTS_AUTOFILL_BROWSER_ADDRESS_H_ |
6 #define COMPONENTS_AUTOFILL_BROWSER_ADDRESS_H_ | 6 #define COMPONENTS_AUTOFILL_BROWSER_ADDRESS_H_ |
7 | 7 |
8 #include <string> | 8 #include <string> |
9 #include <vector> | 9 #include <vector> |
10 | 10 |
11 #include "base/string16.h" | 11 #include "base/string16.h" |
12 #include "components/autofill/browser/autofill_type.h" | 12 #include "components/autofill/browser/autofill_type.h" |
13 #include "components/autofill/browser/field_types.h" | 13 #include "components/autofill/browser/field_types.h" |
14 #include "components/autofill/browser/form_group.h" | 14 #include "components/autofill/browser/form_group.h" |
15 | 15 |
16 // A form group that stores address information. | 16 // A form group that stores address information. |
17 class Address : public FormGroup { | 17 class Address : public FormGroup { |
18 public: | 18 public: |
19 Address(); | 19 Address(); |
20 Address(const Address& address); | 20 Address(const Address& address); |
21 virtual ~Address(); | 21 virtual ~Address(); |
22 | 22 |
23 Address& operator=(const Address& address); | 23 Address& operator=(const Address& address); |
24 | 24 |
25 // FormGroup: | 25 // FormGroup: |
26 virtual string16 GetRawInfo(AutofillFieldType type) const OVERRIDE; | 26 virtual string16 GetRawInfo(AutofillFieldType type) const OVERRIDE; |
27 virtual void SetRawInfo(AutofillFieldType type, | 27 virtual void SetRawInfo(AutofillFieldType type, |
28 const string16& value) OVERRIDE; | 28 const string16& value) OVERRIDE; |
29 virtual string16 GetInfo(AutofillFieldType type, | |
30 const std::string& app_locale) const OVERRIDE; | |
31 virtual bool SetInfo(AutofillFieldType type, | |
32 const string16& value, | |
33 const std::string& app_locale) OVERRIDE; | |
Ilya Sherman
2013/04/05 09:02:11
nit: Trailing whitespace
| |
29 virtual void GetMatchingTypes(const string16& text, | 34 virtual void GetMatchingTypes(const string16& text, |
30 const std::string& app_locale, | 35 const std::string& app_locale, |
31 FieldTypeSet* matching_types) const OVERRIDE; | 36 FieldTypeSet* matching_types) const OVERRIDE; |
32 | 37 |
33 const std::string& country_code() const { return country_code_; } | |
34 void set_country_code(const std::string& country_code) { | |
35 country_code_ = country_code; | |
36 } | |
37 | |
38 private: | 38 private: |
39 // FormGroup: | 39 // FormGroup: |
40 virtual void GetSupportedTypes(FieldTypeSet* supported_types) const OVERRIDE; | 40 virtual void GetSupportedTypes(FieldTypeSet* supported_types) const OVERRIDE; |
41 | 41 |
42 // Returns the localized country name corresponding to |country_code_|. | |
43 string16 Country() const; | |
44 | |
45 // The address. | 42 // The address. |
46 string16 line1_; | 43 string16 line1_; |
47 string16 line2_; | 44 string16 line2_; |
48 string16 city_; | 45 string16 city_; |
49 string16 state_; | 46 string16 state_; |
50 std::string country_code_; | 47 string16 country_code_; |
51 string16 zip_code_; | 48 string16 zip_code_; |
52 }; | 49 }; |
53 | 50 |
54 #endif // COMPONENTS_AUTOFILL_BROWSER_ADDRESS_H_ | 51 #endif // COMPONENTS_AUTOFILL_BROWSER_ADDRESS_H_ |
OLD | NEW |