OLD | NEW |
1 // Copyright (c) 2010 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2010 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_HOME_ADDRESS_H_ | 5 #ifndef CHROME_BROWSER_AUTOFILL_HOME_ADDRESS_H_ |
6 #define CHROME_BROWSER_AUTOFILL_HOME_ADDRESS_H_ | 6 #define CHROME_BROWSER_AUTOFILL_HOME_ADDRESS_H_ |
7 #pragma once | 7 #pragma once |
8 | 8 |
9 #include "chrome/browser/autofill/address.h" | 9 #include "chrome/browser/autofill/address.h" |
10 #include "chrome/browser/autofill/field_types.h" | 10 #include "chrome/browser/autofill/field_types.h" |
11 | 11 |
12 class FormGroup; | 12 class FormGroup; |
13 | 13 |
14 // A specialization of Address that identifies itself as a home address. | 14 // A specialization of Address that identifies itself as a home address. |
15 class HomeAddress : public Address { | 15 class HomeAddress : public Address { |
16 public: | 16 public: |
17 HomeAddress() {} | 17 HomeAddress(); |
18 virtual FormGroup* Clone() const { return new HomeAddress(*this); } | 18 virtual ~HomeAddress(); |
| 19 virtual FormGroup* Clone() const; |
19 | 20 |
20 protected: | 21 protected: |
21 virtual AutoFillFieldType GetLine1Type() const { | 22 virtual AutoFillFieldType GetLine1Type() const; |
22 return ADDRESS_HOME_LINE1; | 23 virtual AutoFillFieldType GetLine2Type() const; |
23 } | 24 virtual AutoFillFieldType GetAptNumType() const; |
24 | 25 virtual AutoFillFieldType GetCityType() const; |
25 virtual AutoFillFieldType GetLine2Type() const { | 26 virtual AutoFillFieldType GetStateType() const; |
26 return ADDRESS_HOME_LINE2; | 27 virtual AutoFillFieldType GetZipCodeType() const; |
27 } | 28 virtual AutoFillFieldType GetCountryType() const; |
28 | |
29 virtual AutoFillFieldType GetAptNumType() const { | |
30 return ADDRESS_HOME_APT_NUM; | |
31 } | |
32 | |
33 virtual AutoFillFieldType GetCityType() const { | |
34 return ADDRESS_HOME_CITY; | |
35 } | |
36 | |
37 virtual AutoFillFieldType GetStateType() const { | |
38 return ADDRESS_HOME_STATE; | |
39 } | |
40 | |
41 virtual AutoFillFieldType GetZipCodeType() const { | |
42 return ADDRESS_HOME_ZIP; | |
43 } | |
44 | |
45 virtual AutoFillFieldType GetCountryType() const { | |
46 return ADDRESS_HOME_COUNTRY; | |
47 } | |
48 | 29 |
49 private: | 30 private: |
50 explicit HomeAddress(const HomeAddress& address) : Address(address) {} | 31 explicit HomeAddress(const HomeAddress& address) : Address(address) {} |
51 void operator=(const HomeAddress& address); // Not implemented. | 32 void operator=(const HomeAddress& address); // Not implemented. |
52 }; | 33 }; |
53 | 34 |
54 #endif // CHROME_BROWSER_AUTOFILL_HOME_ADDRESS_H_ | 35 #endif // CHROME_BROWSER_AUTOFILL_HOME_ADDRESS_H_ |
OLD | NEW |