summaryrefslogtreecommitdiffstats
path: root/chrome/browser/autofill/address.h
diff options
context:
space:
mode:
authorjhawkins@chromium.org <jhawkins@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2010-02-22 22:22:01 +0000
committerjhawkins@chromium.org <jhawkins@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2010-02-22 22:22:01 +0000
commitc52b0758d6286483215d395c62aad0b333e5d6a4 (patch)
treef52d6c4ec05862d731eb0d6aaedba07ab3eacacf /chrome/browser/autofill/address.h
parentc2de68aeea9a829af41f087f2c3b3c347f7f196e (diff)
downloadchromium_src-c52b0758d6286483215d395c62aad0b333e5d6a4.zip
chromium_src-c52b0758d6286483215d395c62aad0b333e5d6a4.tar.gz
chromium_src-c52b0758d6286483215d395c62aad0b333e5d6a4.tar.bz2
Add tests for BillingAddress::GetPossibleFieldTypes. Fix a few issues that popped up as a result of writing the tests. Remove an unnecessary test fixture from the AutoFillProfile unit test.
BUG=none TEST=BillingAddress.GetPossibleFieldTypes Review URL: http://codereview.chromium.org/652057 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@39646 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'chrome/browser/autofill/address.h')
-rw-r--r--chrome/browser/autofill/address.h26
1 files changed, 14 insertions, 12 deletions
diff --git a/chrome/browser/autofill/address.h b/chrome/browser/autofill/address.h
index a8307f2..191dfa7 100644
--- a/chrome/browser/autofill/address.h
+++ b/chrome/browser/autofill/address.h
@@ -10,8 +10,6 @@
#include "base/string16.h"
#include "chrome/browser/autofill/form_group.h"
-typedef std::vector<string16> LineTokens;
-
// A form group that stores address information.
class Address : public FormGroup {
public:
@@ -34,6 +32,13 @@ class Address : public FormGroup {
// Sets the values of this object to the values in |address|.
void Clone(const Address& address);
+ protected:
+ explicit Address(const Address& address);
+
+ private:
+ // Vector of tokens in an address line.
+ typedef std::vector<string16> LineTokens;
+
string16 line1() const { return line1_; }
string16 line2() const { return line2_; }
string16 apt_num() const { return apt_num_; }
@@ -50,8 +55,6 @@ class Address : public FormGroup {
void set_country(const string16& country) { country_ = country; }
void set_zip_code(const string16& zip_code) { zip_code_ = zip_code; }
- protected:
- explicit Address(const Address& address);
void operator=(const Address& address);
// The following functions match |text| against the various values of the
@@ -80,6 +83,13 @@ class Address : public FormGroup {
const string16& info,
string16* match) const;
+ // Returns true if all of the tokens in |text| match the tokens in
+ // |line_tokens|.
+ bool IsLineMatch(const string16& text, const LineTokens& line_tokens) const;
+
+ // Returns true if |word| is one of the tokens in |line_tokens|.
+ bool IsWordInLine(const string16& word, const LineTokens& line_tokens) const;
+
// List of tokens in each part of |line1_| and |line2_|.
LineTokens line1_tokens_;
LineTokens line2_tokens_;
@@ -92,14 +102,6 @@ class Address : public FormGroup {
string16 state_;
string16 country_;
string16 zip_code_;
-
- private:
- // Returns true if all of the tokens in |text| match the tokens in
- // |line_tokens|.
- bool IsLineMatch(const string16& text, const LineTokens& line_tokens) const;
-
- // Returns true if |word| is one of the tokens in |line_tokens|.
- bool IsWordInLine(const string16& word, const LineTokens& line_tokens) const;
};
#endif // CHROME_BROWSER_AUTOFILL_ADDRESS_H_