summaryrefslogtreecommitdiffstats
path: root/chrome/browser/autofill/autofill_profile.cc
diff options
context:
space:
mode:
authorisherman@chromium.org <isherman@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2011-02-25 23:47:13 +0000
committerisherman@chromium.org <isherman@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2011-02-25 23:47:13 +0000
commit3540102a3b99033e6f4838f9843721bff47a2aa8 (patch)
treea4cdae31eaf5beaae1a4d57a6ab936c64073b440 /chrome/browser/autofill/autofill_profile.cc
parentad90b5620fc7ec8140b94a64d5f4033356dc5c5b (diff)
downloadchromium_src-3540102a3b99033e6f4838f9843721bff47a2aa8.zip
chromium_src-3540102a3b99033e6f4838f9843721bff47a2aa8.tar.gz
chromium_src-3540102a3b99033e6f4838f9843721bff47a2aa8.tar.bz2
Autofill i18n: Set postal code and state field labels based on the selected country.
* Changes the country field to a <select> field. * Restricts the possible values for the "country" field to a set of known values * Moves the country field to the top of the Autofill dialog * Changes the field labels according to the selected country BUG=56599,56602,56604 TEST= Review URL: http://codereview.chromium.org/6484022 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@76117 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'chrome/browser/autofill/autofill_profile.cc')
-rw-r--r--chrome/browser/autofill/autofill_profile.cc16
1 files changed, 16 insertions, 0 deletions
diff --git a/chrome/browser/autofill/autofill_profile.cc b/chrome/browser/autofill/autofill_profile.cc
index e147e93..448247d 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) {