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

Unified Diff: components/autofill/core/browser/autofill_profile.h

Issue 212873003: Store the language code for the address in autofill profile. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Fixups Created 6 years, 8 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 side-by-side diff with in-line comments
Download patch
Index: components/autofill/core/browser/autofill_profile.h
diff --git a/components/autofill/core/browser/autofill_profile.h b/components/autofill/core/browser/autofill_profile.h
index 7eb979672687fef1a9762c26645188f4ff963f6c..5768386cc92e1cee09a8445134a2e7077b7dbc5a 100644
--- a/components/autofill/core/browser/autofill_profile.h
+++ b/components/autofill/core/browser/autofill_profile.h
@@ -78,14 +78,21 @@ class AutofillProfile : public AutofillDataModel {
// Comparison for Sync. Returns 0 if the profile is the same as |this|,
// or < 0, or > 0 if it is different. The implied ordering can be used for
// culling duplicates. The ordering is based on collation order of the
- // textual contents of the fields.
- // GUIDs and origins are not compared, only the values of the contents
- // themselves. Full profile comparision, comparison includes multi-valued
- // fields.
+ // textual contents of the fields. Full profile comparison, comparison
+ // includes multi-valued fields.
+ //
+ // GUIDs, origins, and language codes are not compared, only the contents
+ // themselves.
int Compare(const AutofillProfile& profile) const;
- // Equality operators compare GUIDs, origins, and the contents in the
- // comparison.
+ // Same as operator==, but ignores differences in origin.
+ bool EqualsSansOrigin(const AutofillProfile& profile) const;
+
+ // Same as operator==, but ignores differences in GUID.
+ bool EqualsSansGuid(const AutofillProfile& profile) const;
+
+ // Equality operators compare GUIDs, origins, language code, and the contents
+ // in the comparison.
bool operator==(const AutofillProfile& profile) const;
virtual bool operator!=(const AutofillProfile& profile) const;
@@ -132,6 +139,11 @@ class AutofillProfile : public AutofillDataModel {
size_t minimal_fields_shown,
std::vector<base::string16>* labels);
+ const std::string& language_code() const { return language_code_; }
+ void set_language_code(const std::string& language_code) {
+ language_code_ = language_code;
+ }
+
private:
typedef std::vector<const FormGroup*> FormGroupList;
@@ -185,6 +197,9 @@ class AutofillProfile : public AutofillDataModel {
CompanyInfo company_;
std::vector<PhoneNumber> phone_number_;
Address address_;
+
+ // The BCP 47 language code that can be used to format |address_| for display.
+ std::string language_code_;
};
// So we can compare AutofillProfiles with EXPECT_EQ().
« no previous file with comments | « chrome/browser/ui/autofill/data_model_wrapper.cc ('k') | components/autofill/core/browser/autofill_profile.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698