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

Unified Diff: chrome/browser/autofill/address.h

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/address.h
diff --git a/chrome/browser/autofill/address.h b/chrome/browser/autofill/address.h
index a2b4dd3701996f5704ec686e0e6ac50ca64500a5..be1fb504a829538f25e9d0461b7474b03a2a2f15 100644
--- a/chrome/browser/autofill/address.h
+++ b/chrome/browser/autofill/address.h
@@ -6,6 +6,7 @@
#define CHROME_BROWSER_AUTOFILL_ADDRESS_H_
#pragma once
+#include <string>
#include <vector>
#include "base/string16.h"
@@ -28,6 +29,11 @@ class Address : public FormGroup {
virtual string16 GetFieldText(const AutoFillType& type) const;
virtual void SetInfo(const AutoFillType& type, const string16& value);
+ const std::string& country_code() const { return country_code_; }
+ void set_country_code(const std::string& country_code) {
+ country_code_ = country_code;
+ }
+
// Sets all of the fields to the empty string.
void Clear();
@@ -46,17 +52,22 @@ class Address : public FormGroup {
const string16& apt_num() const { return apt_num_; }
const string16& city() const { return city_; }
const string16& state() const { return state_; }
- const string16& country() const { return country_; }
const string16& zip_code() const { return zip_code_; }
+ // Returns the localized country name corresponding to |country_code_|.
+ string16 Country() const;
+
void set_line1(const string16& line1);
void set_line2(const string16& line2);
void set_apt_num(const string16& apt_num) { apt_num_ = apt_num; }
void set_city(const string16& city) { city_ = city; }
void set_state(const string16& state) { state_ = state; }
- void set_country(const string16& country) { country_ = country; }
void set_zip_code(const string16& zip_code) { zip_code_ = zip_code; }
+ // Sets the |country_code_| based on |country|, which should be a localized
+ // country name.
+ void SetCountry(const string16& country);
+
void operator=(const Address& address);
// The following functions match |text| against the various values of the
@@ -102,7 +113,7 @@ class Address : public FormGroup {
string16 apt_num_;
string16 city_;
string16 state_;
- string16 country_;
+ std::string country_code_;
string16 zip_code_;
};

Powered by Google App Engine
This is Rietveld 408576698