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

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: Still needs tests 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
Index: chrome/browser/autofill/autofill_profile.cc
diff --git a/chrome/browser/autofill/autofill_profile.cc b/chrome/browser/autofill/autofill_profile.cc
index f6bcb13336d6db70f9fd72caca33f7e4011a4627..1a1172faef3c5646829e86f6e3433190e29383b3 100644
--- a/chrome/browser/autofill/autofill_profile.cc
+++ b/chrome/browser/autofill/autofill_profile.cc
@@ -197,10 +197,26 @@ FormGroup* AutoFillProfile::Clone() const {
return new AutoFillProfile(*this);
}
-const string16 AutoFillProfile::Label() const {
+string16 AutoFillProfile::Label() const {
return label_;
}
+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) {

Powered by Google App Engine
This is Rietveld 408576698