diff options
author | jhawkins@chromium.org <jhawkins@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2010-01-07 19:35:57 +0000 |
---|---|---|
committer | jhawkins@chromium.org <jhawkins@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2010-01-07 19:35:57 +0000 |
commit | 849b7f811d6781920f43d1403ed6baad0fa0dd82 (patch) | |
tree | 700fb849885c32eccaf46357f6f6d89bc050dc76 /chrome/browser | |
parent | cf741e7c8bc8a31b74b778a06ab70ecd3ce1eee4 (diff) | |
download | chromium_src-849b7f811d6781920f43d1403ed6baad0fa0dd82.zip chromium_src-849b7f811d6781920f43d1403ed6baad0fa0dd82.tar.gz chromium_src-849b7f811d6781920f43d1403ed6baad0fa0dd82.tar.bz2 |
Add HomeAddress and BillingAddress, specializations of Address.
BUG=none
TEST=none
Review URL: http://codereview.chromium.org/523112
git-svn-id: svn://svn.chromium.org/chrome/trunk/src@35721 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'chrome/browser')
-rw-r--r-- | chrome/browser/autofill/billing_address.h | 53 | ||||
-rw-r--r-- | chrome/browser/autofill/home_address.h | 53 |
2 files changed, 106 insertions, 0 deletions
diff --git a/chrome/browser/autofill/billing_address.h b/chrome/browser/autofill/billing_address.h new file mode 100644 index 0000000..f0aae86 --- /dev/null +++ b/chrome/browser/autofill/billing_address.h @@ -0,0 +1,53 @@ +// Copyright (c) 2010 The Chromium Authors. All rights reserved. +// Use of this source code is governed by a BSD-style license that can be +// found in the LICENSE file. + +#ifndef CHROME_BROWSER_AUTOFILL_BILLING_ADDRESS_H_ +#define CHROME_BROWSER_AUTOFILL_BILLING_ADDRESS_H_ + +#include "chrome/browser/autofill/address.h" +#include "chrome/browser/autofill/field_types.h" + +class FormGroup; + +// A specialization of Address that identifies itself as a billing address. +class BillingAddress : public Address { + public: + BillingAddress() {} + FormGroup* Clone() const { return new BillingAddress(*this); } + + protected: + virtual AutoFillFieldType GetLine1Type() const { + return ADDRESS_BILLING_LINE1; + } + + virtual AutoFillFieldType GetLine2Type() const { + return ADDRESS_BILLING_LINE2; + } + + virtual AutoFillFieldType GetApptNumType() const { + return ADDRESS_BILLING_APPT_NUM; + } + + virtual AutoFillFieldType GetCityType() const { + return ADDRESS_BILLING_CITY; + } + + virtual AutoFillFieldType GetStateType() const { + return ADDRESS_BILLING_STATE; + } + + virtual AutoFillFieldType GetZipCodeType() const { + return ADDRESS_BILLING_ZIP; + } + + virtual AutoFillFieldType GetCountryType() const { + return ADDRESS_BILLING_COUNTRY; + } + + private: + explicit BillingAddress(const BillingAddress& address) : Address(address) {} + void operator=(const BillingAddress& address); // Not implemented. +}; + +#endif // CHROME_BROWSER_AUTOFILL_BILLING_ADDRESS_H_ diff --git a/chrome/browser/autofill/home_address.h b/chrome/browser/autofill/home_address.h new file mode 100644 index 0000000..2d1709c --- /dev/null +++ b/chrome/browser/autofill/home_address.h @@ -0,0 +1,53 @@ +// Copyright (c) 2010 The Chromium Authors. All rights reserved. +// Use of this source code is governed by a BSD-style license that can be +// found in the LICENSE file. + +#ifndef CHROME_BROWSER_AUTOFILL_HOME_ADDRESS_H_ +#define CHROME_BROWSER_AUTOFILL_HOME_ADDRESS_H_ + +#include "chrome/browser/autofill/address.h" +#include "chrome/browser/autofill/field_types.h" + +class FormGroup; + +// A specialization of Address that identifies itself as a home address. +class HomeAddress : public Address { + public: + HomeAddress() {} + FormGroup* Clone() const { return new HomeAddress(*this); } + + protected: + virtual AutoFillFieldType GetLine1Type() const { + return ADDRESS_HOME_LINE1; + } + + virtual AutoFillFieldType GetLine2Type() const { + return ADDRESS_HOME_LINE2; + } + + virtual AutoFillFieldType GetApptNumType() const { + return ADDRESS_HOME_APPT_NUM; + } + + virtual AutoFillFieldType GetCityType() const { + return ADDRESS_HOME_CITY; + } + + virtual AutoFillFieldType GetStateType() const { + return ADDRESS_HOME_STATE; + } + + virtual AutoFillFieldType GetZipCodeType() const { + return ADDRESS_HOME_ZIP; + } + + virtual AutoFillFieldType GetCountryType() const { + return ADDRESS_HOME_COUNTRY; + } + + private: + explicit HomeAddress(const HomeAddress& address) : Address(address) {} + void operator=(const HomeAddress& address); // Not implemented. +}; + +#endif // CHROME_BROWSER_AUTOFILL_HOME_ADDRESS_H_ |