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

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

Issue 6650014: Autofill extend profiles to include multi-valued fields, part 2. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Nit Created 9 years, 9 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/browser/autofill/address.h ('k') | chrome/browser/autofill/autofill_manager_unittest.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: chrome/browser/autofill/address.cc
diff --git a/chrome/browser/autofill/address.cc b/chrome/browser/autofill/address.cc
index 59d1b1ea90c5fa769585f700ae4b4d17fa066864..183b5e179102caf910b62aea3dab7a365dfb4a20 100644
--- a/chrome/browser/autofill/address.cc
+++ b/chrome/browser/autofill/address.cc
@@ -29,10 +29,25 @@ const int kAutoFillAddressLength = arraysize(kAutoFillAddressTypes);
Address::Address() {}
+Address::Address(const Address& address) : FormGroup() {
+ *this = address;
+}
+
Address::~Address() {}
-FormGroup* Address::Clone() const {
- return new Address(*this);
+Address& Address::operator=(const Address& address) {
+ if (this == &address)
+ return *this;
+
+ line1_tokens_ = address.line1_tokens_;
+ line2_tokens_= address.line2_tokens_;
+ line1_ = address.line1_;
+ line2_ = address.line2_;
+ city_ = address.city_;
+ state_ = address.state_;
+ country_code_ = address.country_code_;
+ zip_code_ = address.zip_code_;
+ return *this;
}
void Address::GetPossibleFieldTypes(const string16& text,
@@ -154,18 +169,6 @@ void Address::Clear() {
zip_code_.clear();
}
-Address::Address(const Address& address)
- : FormGroup(),
- line1_tokens_(address.line1_tokens_),
- line2_tokens_(address.line2_tokens_),
- line1_(address.line1_),
- line2_(address.line2_),
- city_(address.city_),
- state_(address.state_),
- country_code_(address.country_code_),
- zip_code_(address.zip_code_) {
-}
-
string16 Address::Country() const {
if (country_code().empty())
return string16();
« no previous file with comments | « chrome/browser/autofill/address.h ('k') | chrome/browser/autofill/autofill_manager_unittest.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698