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_AUTOFILL_PROFILE_H_ | 5 #ifndef CHROME_BROWSER_AUTOFILL_AUTOFILL_PROFILE_H_ |
6 #define CHROME_BROWSER_AUTOFILL_AUTOFILL_PROFILE_H_ | 6 #define CHROME_BROWSER_AUTOFILL_AUTOFILL_PROFILE_H_ |
7 | 7 |
8 #include <map> | 8 #include <map> |
9 #include <vector> | 9 #include <vector> |
10 | 10 |
(...skipping 35 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
46 // of use_billing_address. | 46 // of use_billing_address. |
47 void set_use_billing_address(bool use); | 47 void set_use_billing_address(bool use); |
48 bool use_billing_address() const { return use_billing_address_; } | 48 bool use_billing_address() const { return use_billing_address_; } |
49 | 49 |
50 int unique_id() const { return unique_id_; } | 50 int unique_id() const { return unique_id_; } |
51 | 51 |
52 // For use in std containers. | 52 // For use in std containers. |
53 void operator=(const AutoFillProfile&); | 53 void operator=(const AutoFillProfile&); |
54 | 54 |
55 // Used by tests. | 55 // Used by tests. |
| 56 // TODO(jhawkins): Move these to private and add the test as a friend. |
56 bool operator==(const AutoFillProfile& profile) const; | 57 bool operator==(const AutoFillProfile& profile) const; |
57 void set_label(const string16& label) { label_ = label; } | 58 void set_label(const string16& label) { label_ = label; } |
58 void set_unique_id(int id) { unique_id_ = id; } | 59 void set_unique_id(int id) { unique_id_ = id; } |
59 | 60 |
60 private: | 61 private: |
61 Address* GetBillingAddress(); | 62 Address* GetBillingAddress(); |
62 Address* GetHomeAddress(); | 63 Address* GetHomeAddress(); |
63 | 64 |
64 // The label presented to the user when selecting a profile. | 65 // The label presented to the user when selecting a profile. |
65 string16 label_; | 66 string16 label_; |
66 | 67 |
67 // The unique ID of this profile. | 68 // The unique ID of this profile. |
68 int unique_id_; | 69 int unique_id_; |
69 | 70 |
70 // If true, the billing address will be used for the home address. Correlates | 71 // If true, the billing address will be used for the home address. Correlates |
71 // with the "Use billing address" option on some billing forms. | 72 // with the "Use billing address" option on some billing forms. |
72 bool use_billing_address_; | 73 bool use_billing_address_; |
73 | 74 |
74 // Personal information for this profile. | 75 // Personal information for this profile. |
75 FormGroupMap personal_info_; | 76 FormGroupMap personal_info_; |
76 }; | 77 }; |
77 | 78 |
| 79 // So we can compare AutoFillProfiles with EXPECT_EQ(). |
| 80 std::ostream& operator<<(std::ostream& os, const AutoFillProfile& profile); |
| 81 |
78 #endif // CHROME_BROWSER_AUTOFILL_AUTOFILL_PROFILE_H_ | 82 #endif // CHROME_BROWSER_AUTOFILL_AUTOFILL_PROFILE_H_ |
OLD | NEW |