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

Unified Diff: chrome/browser/autofill/autofill_profile.cc

Issue 6484022: Autofill i18n: Set postal code and state field labels based on the selected country. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Properly merged with ToT Created 9 years, 10 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
« no previous file with comments | « chrome/browser/autofill/autofill_profile.h ('k') | chrome/browser/autofill/autofill_profile_unittest.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: chrome/browser/autofill/autofill_profile.cc
diff --git a/chrome/browser/autofill/autofill_profile.cc b/chrome/browser/autofill/autofill_profile.cc
index e147e9359471dd29b5459e3b4ae0439973d0a432..448247d00ba10cce326b30eabee61c47beabf862 100644
--- a/chrome/browser/autofill/autofill_profile.cc
+++ b/chrome/browser/autofill/autofill_profile.cc
@@ -200,6 +200,22 @@ const string16 AutoFillProfile::Label() const {
return label_;
}
+const std::string AutoFillProfile::CountryCode() const {
+ FormGroup* form_group =
+ personal_info_.find(AutoFillType::ADDRESS_HOME)->second;
+ DCHECK(form_group);
+ Address* address = static_cast<Address*>(form_group);
+ return address->country_code();
+}
+
+void AutoFillProfile::SetCountryCode(const std::string& country_code) {
+ FormGroup* form_group =
+ personal_info_.find(AutoFillType::ADDRESS_HOME)->second;
+ DCHECK(form_group);
+ Address* address = static_cast<Address*>(form_group);
+ address->set_country_code(country_code);
+}
+
// static
bool AutoFillProfile::AdjustInferredLabels(
std::vector<AutoFillProfile*>* profiles) {
« no previous file with comments | « chrome/browser/autofill/autofill_profile.h ('k') | chrome/browser/autofill/autofill_profile_unittest.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698