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

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: 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/app/generated_resources.grd ('k') | chrome/browser/autofill/address.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: chrome/browser/autofill/address.h
diff --git a/chrome/browser/autofill/address.h b/chrome/browser/autofill/address.h
index ff0c7f66c33c55317fa76e35bba352c4385d35b4..219234a0a7e67928dfd3430d23e2c49aabf74f0e 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();
@@ -39,9 +45,16 @@ class Address : public FormGroup {
void operator=(const Address& address);
+ // Returns the localized country name corresponding to |country_code_|.
+ string16 Country() const;
+
void set_line1(const string16& line1);
void set_line2(const string16& line2);
+ // Sets the |country_code_| based on |country|, which should be a localized
+ // country name.
+ void SetCountry(const string16& country);
+
// The following functions match |text| against the various values of the
// address, returning true on match.
virtual bool IsLine1(const string16& text) const;
@@ -73,7 +86,7 @@ class Address : public FormGroup {
string16 line2_;
string16 city_;
string16 state_;
- string16 country_;
+ std::string country_code_;
string16 zip_code_;
};
« no previous file with comments | « chrome/app/generated_resources.grd ('k') | chrome/browser/autofill/address.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698