| OLD | NEW |
| 1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2012 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_AUTOFILL_PROFILE_H_ | 5 #ifndef COMPONENTS_AUTOFILL_BROWSER_AUTOFILL_PROFILE_H_ |
| 6 #define COMPONENTS_AUTOFILL_BROWSER_AUTOFILL_PROFILE_H_ | 6 #define COMPONENTS_AUTOFILL_BROWSER_AUTOFILL_PROFILE_H_ |
| 7 | 7 |
| 8 #include <stddef.h> | 8 #include <stddef.h> |
| 9 | 9 |
| 10 #include <iosfwd> | 10 #include <iosfwd> |
| (...skipping 64 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 75 // profiles. Shows at least 2 fields that differentiate profile from other | 75 // profiles. Shows at least 2 fields that differentiate profile from other |
| 76 // profiles. See AdjustInferredLabels() further down for more description. | 76 // profiles. See AdjustInferredLabels() further down for more description. |
| 77 const string16 Label() const; | 77 const string16 Label() const; |
| 78 | 78 |
| 79 // This guid is the primary identifier for |AutofillProfile| objects. | 79 // This guid is the primary identifier for |AutofillProfile| objects. |
| 80 // TODO(estade): remove this and just use GetGUID(). |guid_| can probably | 80 // TODO(estade): remove this and just use GetGUID(). |guid_| can probably |
| 81 // be moved to FormGroup. | 81 // be moved to FormGroup. |
| 82 const std::string guid() const { return guid_; } | 82 const std::string guid() const { return guid_; } |
| 83 void set_guid(const std::string& guid) { guid_ = guid; } | 83 void set_guid(const std::string& guid) { guid_ = guid; } |
| 84 | 84 |
| 85 // Accessors for the stored address's country code. | |
| 86 const std::string CountryCode() const; | |
| 87 void SetCountryCode(const std::string& country_code); | |
| 88 | |
| 89 // Returns true if there are no values (field types) set. | 85 // Returns true if there are no values (field types) set. |
| 90 bool IsEmpty() const; | 86 bool IsEmpty() const; |
| 91 | 87 |
| 92 // Comparison for Sync. Returns 0 if the profile is the same as |this|, | 88 // Comparison for Sync. Returns 0 if the profile is the same as |this|, |
| 93 // or < 0, or > 0 if it is different. The implied ordering can be used for | 89 // or < 0, or > 0 if it is different. The implied ordering can be used for |
| 94 // culling duplicates. The ordering is based on collation order of the | 90 // culling duplicates. The ordering is based on collation order of the |
| 95 // textual contents of the fields. | 91 // textual contents of the fields. |
| 96 // GUIDs are not compared, only the values of the contents themselves. | 92 // GUIDs are not compared, only the values of the contents themselves. |
| 97 // Full profile comparision, comparison includes multi-valued fields. | 93 // Full profile comparision, comparison includes multi-valued fields. |
| 98 int Compare(const AutofillProfile& profile) const; | 94 int Compare(const AutofillProfile& profile) const; |
| (...skipping 103 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 202 std::vector<EmailInfo> email_; | 198 std::vector<EmailInfo> email_; |
| 203 CompanyInfo company_; | 199 CompanyInfo company_; |
| 204 std::vector<PhoneNumber> home_number_; | 200 std::vector<PhoneNumber> home_number_; |
| 205 Address address_; | 201 Address address_; |
| 206 }; | 202 }; |
| 207 | 203 |
| 208 // So we can compare AutofillProfiles with EXPECT_EQ(). | 204 // So we can compare AutofillProfiles with EXPECT_EQ(). |
| 209 std::ostream& operator<<(std::ostream& os, const AutofillProfile& profile); | 205 std::ostream& operator<<(std::ostream& os, const AutofillProfile& profile); |
| 210 | 206 |
| 211 #endif // COMPONENTS_AUTOFILL_BROWSER_AUTOFILL_PROFILE_H_ | 207 #endif // COMPONENTS_AUTOFILL_BROWSER_AUTOFILL_PROFILE_H_ |
| OLD | NEW |